English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Asm / Hardware

 
 
Thread Tools
Old 06 March 2023, 23:50   #1
Gorack
Registered User
 
Join Date: Sep 2019
Location: Melbourne/Australia
Posts: 3
AUDxPER for maximum playback rate

Various information on the web states that 124 is the minimum value that can be used in this register.
But is this a limitation caused by the number of DMA cycles?
Can a faster sampling rate be achieved if the AUDxDAT registers are fed by the CPU instead?
If so what is the fastest theoretical rate that could be achieved?
Gorack is offline  
Old 07 March 2023, 17:50   #2
paraj
Registered User
 
paraj's Avatar
 
Join Date: Feb 2017
Location: Denmark
Posts: 1,115
Discussion of the minimum period: https://eab.abime.net/showthread.php?t=70783
Maximum rate: http://bax.comlab.uni-rostock.de/dl/...mTheoretic.pdf (54567 Hz)

Also some other discussions here you may find interesting:

https://eab.abime.net/showthread.php?t=112931
https://eab.abime.net/showthread.php?t=105355
paraj is offline  
Old 09 March 2023, 01:31   #3
Gorack
Registered User
 
Join Date: Sep 2019
Location: Melbourne/Australia
Posts: 3
Thanks, a lot more information than most web sites (and books) that say, 124 is the minimum value that can be put into these registers.

So if DMA limits it to 28.8 kHz because there is only one DMA access slot allocated to each of the audio channels per scan line, I was thinking of trying to feed the registers using the copper. That way more than a single update can occur on a scan line but still be mostly DMA driven. However, the CPU will need to refresh parts of the copper list per frame (but now the sample data can be in fast ram).
Gorack is offline  
Old 09 March 2023, 11:34   #4
koobo
Registered User
 
koobo's Avatar
 
Join Date: Sep 2019
Location: Finland
Posts: 364
This is interesting! I'm guessing the max output rate in non-DMA mode is likely related to the clock frequency used to run Paula.
koobo is offline  
Old 09 March 2023, 13:26   #5
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,476
Quote:
Originally Posted by koobo View Post
This is interesting! I'm guessing the max output rate in non-DMA mode is likely related to the clock frequency used to run Paula.
Well, everything in Paula is CCK (PAL: 3546895Hz) related

So if you set AUDxPER/AUDxLEN=1, AUDxVOL=64 and AUDxDAT=$7F81 you can generate a perfect square wave with 50% duty cycle at 1.7xMHz.
The problem is that you have to get the signal directly on the AUDx pins because otherwise it would be heavily filtered.

The main impediment in using the non-DMA mode is related to the fact that you are practically forced to use the Copper (otherwise the processor could do practically nothing else and also the synchronization would change depending on the CPU model).

And also using the Copper is not so trivial because to load the values in AUDxDAT you must somehow generate a synchronous stream and in the meantime maybe you would also like to use the Copper to make some video effects. So usually you ends up use a (sub)multiple of the video line frequency.

Also mixing DMA mode with non-DMA mode is a pain... the complication is just not worth it and you end up using one of two 'natural' ways.

To conclude: there are no free lunches
ross is offline  
Old 09 March 2023, 14:06   #6
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,326
Quote:
Originally Posted by ross View Post
The main impediment in using the non-DMA mode is related to the fact that you are practically forced to use the Copper (otherwise the processor could do practically nothing else and also the synchronization would change depending on the CPU model).
I don't think so.
To feed AUDxDAT 'by hand', the cpu remains the best option as you can use audio interrupts. You get 1 irq per 2 samples (AUDxDAT holds 2 samples). Thus, if you want to play at f.e. 50khz, you need 25,000 ints/sec - which seem perfectly doable.
meynaf is offline  
Old 09 March 2023, 14:46   #7
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,476
Quote:
Originally Posted by meynaf View Post
I don't think so.
To feed AUDxDAT 'by hand', the cpu remains the best option as you can use audio interrupts. You get 1 irq per 2 samples (AUDxDAT holds 2 samples). Thus, if you want to play at f.e. 50khz, you need 25,000 ints/sec - which seem perfectly doable.
Try it on a 7Mhz 68000


EDIT: I was thinking that even on fast machines the use of resources would be exaggerated, I imagine that at least a fast 030 would be needed to have a somewhat responsive machine in such a situation.
Almost two IRQs per video line, with the latency of IRQ acknowledging, saving registers and the routine itself is way too much to be usable.
I don't think it's a solution that anyone has used, at least not in a non-test environment.
So I confirm, in my opinion CPU usage to manual feed AUDxDAT is the worst situation, not the best.
But always happy to be proved wrong

Last edited by ross; 09 March 2023 at 15:09.
ross is offline  
Old 09 March 2023, 16:03   #8
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,326
Quote:
Originally Posted by ross View Post
Try it on a 7Mhz 68000
I haven't, but i guess it can reach something like 16000 ints/sec or even more.
But where's the point anyway ? If you have very slow machine there is little incentive to go over what DMA can do.


Quote:
Originally Posted by ross View Post
EDIT: I was thinking that even on fast machines the use of resources would be exaggerated, I imagine that at least a fast 030 would be needed to have a somewhat responsive machine in such a situation.
Almost two IRQs per video line, with the latency of IRQ acknowledging, saving registers and the routine itself is way too much to be usable.
The routine can be quite simple and there is no need to save all registers.
My 68030 could do 25000 ints/sec even under OS and the machine was responsive enough - audio just wasn't stable due to other system activity.

Which leaves us with another very interesting problem : how to feed that player with data, as file I/O from hard drive requires working OS and all the solutions presented here need to kill the system...


Quote:
Originally Posted by ross View Post
I don't think it's a solution that anyone has used, at least not in a non-test environment.
It has been done by myself and probably also by others. The main problem isn't cpu load here (see above).
So i can tell you for a fact that using the cpu to feed audio data has been done with some success, contrary to using the copper for which AFAIK all attempts have failed.


Quote:
Originally Posted by ross View Post
So I confirm, in my opinion CPU usage to manual feed AUDxDAT is the worst situation, not the best.
The best solution is a solution that actually works. With cpu it does work, with some limits. With the copper it never has.


Quote:
Originally Posted by ross View Post
But always happy to be proved wrong
You can prove this yourself, by just attempting to make audio work with the copper, and failing like everyone else before
meynaf is offline  
Old 09 March 2023, 17:57   #9
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,476
Quote:
Originally Posted by meynaf View Post
But where's the point anyway ? If you have very slow machine there is little incentive to go over what DMA can do.
That this can be done even on a slow machine (a proof of concept)

Quote:
The routine can be quite simple and there is no need to save all registers.
My 68030 could do 25000 ints/sec even under OS and the machine was responsive enough - audio just wasn't stable due to other system activity.
Well, if the audio is not stable I would say that it means that in a multi-tasking environment it can't be done. Period.
Of course for a demo or similar with 030 50 there would be no problem, but in any case it would eat up a good part of your resources.
And for a slow machine, basically all resources..

Quote:
Which leaves us with another very interesting problem : how to feed that player with data, as file I/O from hard drive requires working OS and all the solutions presented here need to kill the system...
And this is another sore point to which there is no answer.
At the very least, tests can be done with the system disabled.
And then we go back to the beginning.

Quote:
It has been done by myself and probably also by others. The main problem isn't cpu load here (see above).
So i can tell you for a fact that using the cpu to feed audio data has been done with some success, contrary to using the copper for which AFAIK all attempts have failed.
Yeah, I absolutely do not argue that it can be done or that someone has done it, but that "at least not in a non-test environment."
I don't know of any released programs or demos or games that use it for a player instead of the DMA mode, but I could be wrong.
(I'm obviously talking about IRQ code that plays one word at a time, not IRQ handling that uses a block of memory; there are thousands of those )

Quote:
The best solution is a solution that actually works. With cpu it does work, with some limits. With the copper it never has.
Some attempts have been made and working, with some limitations to the frequency due to the specific use of Copper during the line.

Quote:
You can prove this yourself, by just attempting to make audio work with the copper, and failing like everyone else before
Ok, challenge accepted.
But we have to define the specifications.
I'm fine with a 68000 at 7Mhz, but with the system disabled.

The data problem can also be solved by loading it from floppy, so not at too high a frequency...
The important thing is that the DMA or the IRQs are not used but only and exclusively manually through the Copper.
All right?
ross is offline  
Old 09 March 2023, 18:52   #10
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,326
Quote:
Originally Posted by ross View Post
That this can be done even on a slow machine (a proof of concept)
A mere proof of concept may be fun, but frankly i'd prefer the ability to play straight 44.1khz wave files on a PAL display.


Quote:
Originally Posted by ross View Post
Well, if the audio is not stable I would say that it means that in a multi-tasking environment it can't be done. Period.
Depends what you call "be done". It can really be done, it's just that it sometimes misses. Don't expect the copper to never miss either.


Quote:
Originally Posted by ross View Post
Of course for a demo or similar with 030 50 there would be no problem, but in any case it would eat up a good part of your resources.
And for a slow machine, basically all resources..
This is a non-issue, really.
A slow machine wouldn't be able to give it enough data to start with - so you need an accelerated machine anyhow.


Quote:
Originally Posted by ross View Post
And this is another sore point to which there is no answer.
At the very least, tests can be done with the system disabled.
And then we go back to the beginning.
IOW, it can only be a proof of concept - of course with system disabled as the situation is worse than with the cpu.


Quote:
Originally Posted by ross View Post
Yeah, I absolutely do not argue that it can be done or that someone has done it, but that "at least not in a non-test environment."
I don't know of any released programs or demos or games that use it for a player instead of the DMA mode, but I could be wrong.
(I'm obviously talking about IRQ code that plays one word at a time, not IRQ handling that uses a block of memory; there are thousands of those )
Same can be said for the copper method (except that i still have to see it working at all).


Quote:
Originally Posted by ross View Post
Some attempts have been made and working, with some limitations to the frequency due to the specific use of Copper during the line.
Really ? I've never seen any. All attempts i know of could just play square waves with errors.


Quote:
Originally Posted by ross View Post
Ok, challenge accepted.
But we have to define the specifications.
I'm fine with a 68000 at 7Mhz, but with the system disabled.
And OCS chipset maybe ?


Quote:
Originally Posted by ross View Post
The data problem can also be solved by loading it from floppy, so not at too high a frequency...
You will end up below 28khz this way. Makes the proof of concept much less interesting.
I think you'd better preload from HD.


Quote:
Originally Posted by ross View Post
The important thing is that the DMA or the IRQs are not used but only and exclusively manually through the Copper.
All right?
Important things for me are :
- the copper must be the only one sending data to AUDxDAT
- no parasite noise - IOW it must not miss a sample
- must play real samples - not just a simple tone
meynaf is offline  
Old 09 March 2023, 19:09   #11
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,476
Quote:
Originally Posted by meynaf View Post
And OCS chipset maybe ?
And OCS

Quote:
You will end up below 28khz this way. Makes the proof of concept much less interesting.
I think you'd better preload from HD.
Gasp...
Ok, above 28KHz, but a short one then, the data that can be played from a floppy contents, preloaded in memory.

Quote:
Important things for me are :
- the copper must be the only one sending data to AUDxDAT
- no parasite noise - IOW it must not miss a sample
- must play real samples - not just a simple tone
Agreed.
ross is offline  
Old 09 March 2023, 19:36   #12
koobo
Registered User
 
koobo's Avatar
 
Join Date: Sep 2019
Location: Finland
Posts: 364
Well, this escalated quickly grabs some popcorn
koobo is offline  
Old 09 March 2023, 19:55   #13
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,326
Quote:
Originally Posted by ross View Post
And OCS
Can copper access full chipset on OCS ?


Quote:
Originally Posted by ross View Post
Gasp...
Ok, above 28KHz, but a short one then, the data that can be played from a floppy contents, preloaded in memory.
You could crunch it (and decrunch real time). As the cpu is supposed to be available for something else with this method.
meynaf is offline  
Old 09 March 2023, 20:08   #14
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,476
Quote:
Originally Posted by meynaf View Post
Can copper access full chipset on OCS ?
Do you mean all the RGA bus?
No, it can't, but that's okay, the registers you need are available.

Quote:
You could crunch it (and decrunch real time). As the cpu is supposed to be available for something else with this method.
Addition challenge accepted
ross is offline  
Old 09 March 2023, 20:43   #15
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,326
Quote:
Originally Posted by ross View Post
Do you mean all the RGA bus?
No, it can't, but that's okay, the registers you need are available.
Audio yes, but what about INTREQ ?
Chances are big that audio interrupt must be cleared before writing to AUDxDAT again, otherwise you'll play first two samples and after that, silence on the line.
meynaf is offline  
Old 09 March 2023, 21:12   #16
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,476
Quote:
Originally Posted by meynaf View Post
Audio yes, but what about INTREQ ?
Chances are big that audio interrupt must be cleared before writing to AUDxDAT again, otherwise you'll play first two samples and after that, silence on the line.
Yes, it's already all planned out in my mind on how to do it.
I just have to write the code
ross is offline  
Old 10 March 2023, 00:19   #17
pandy71
Registered User
 
Join Date: Jun 2010
Location: PL?
Posts: 2,786
If i recall correctly someone already provided Copper Audio code on EAB - can't find it at this moment.
Isn't possible to use quasi DMA mode ie set period intentionally beyond DMA capability and just feed audio samples in more or less regular mode by CPU/Copper - if DMA buffer will be filled with zeros then CPU/Copper samples will be separated by null samples from memory (OK from math perspective) but timing should be constant (unless writing something by CPU to AUDxDAT disarm DMA)
pandy71 is offline  
Old 10 April 2023, 12:42   #18
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,326
One month later, still nothing ?

Quote:
Originally Posted by ross View Post
I just have to write the code
Let me guess...
Step 1 : establish a plan
Step 2 : write the code
Step 3 : find out why it doesn't work
Step 4 : drop the plan
meynaf is offline  
Old 10 April 2023, 13:51   #19
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,476
Let me guess...
You will be really surprised
ross is offline  
Old 10 April 2023, 14:10   #20
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,326
Quote:
Originally Posted by ross View Post
Let me guess...
You will be really surprised
So far it hasn't been the case. How long do we have to wait to see something, one year ?
As code takes ages to write, you have to admit at least that it is very convoluted method, a lot more complex than just feeding the data with the cpu.
And if we see nothing at all at the end...
meynaf is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
"EaglePlayer" playback VS "real" playback chip support.Other 31 27 September 2020 13:14
winuae 3.4.0 - cd playback honx support.WinUAE 10 26 February 2017 00:00
XBox 1 video playback Peter Retrogaming General Discussion 19 18 January 2011 16:33
Q: recording 4-channels sound output and "Playback Rate" jbl007 support.WinUAE 0 07 June 2005 18:23
DivX Playback Echo support.Hardware 10 24 January 2003 18:45

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 20:24.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.13545 seconds with 14 queries