06 March 2023, 23:50 | #1 |
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? |
07 March 2023, 17:50 | #2 |
Registered User
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 |
09 March 2023, 01:31 | #3 |
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). |
09 March 2023, 11:34 | #4 |
Registered User
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.
|
09 March 2023, 13:26 | #5 | |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,476
|
Quote:
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 |
|
09 March 2023, 14:06 | #6 | |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,326
|
Quote:
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. |
|
09 March 2023, 14:46 | #7 | |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,476
|
Quote:
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. |
|
09 March 2023, 16:03 | #8 | |||
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,326
|
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:
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:
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:
You can prove this yourself, by just attempting to make audio work with the copper, and failing like everyone else before |
|||
09 March 2023, 17:57 | #9 | ||||||
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,476
|
Quote:
Quote:
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:
At the very least, tests can be done with the system disabled. And then we go back to the beginning. Quote:
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:
Quote:
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? |
||||||
09 March 2023, 18:52 | #10 | ||||||||
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,326
|
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:
Quote:
A slow machine wouldn't be able to give it enough data to start with - so you need an accelerated machine anyhow. Quote:
Quote:
Quote:
Quote:
Quote:
I think you'd better preload from HD. Quote:
- 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 |
||||||||
09 March 2023, 19:09 | #11 | ||
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,476
|
And OCS
Quote:
Ok, above 28KHz, but a short one then, the data that can be played from a floppy contents, preloaded in memory. Quote:
|
||
09 March 2023, 19:36 | #12 |
Registered User
Join Date: Sep 2019
Location: Finland
Posts: 364
|
Well, this escalated quickly grabs some popcorn
|
09 March 2023, 19:55 | #13 |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,326
|
Can copper access full chipset on OCS ?
You could crunch it (and decrunch real time). As the cpu is supposed to be available for something else with this method. |
09 March 2023, 20:08 | #14 | |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,476
|
Do you mean all the RGA bus?
No, it can't, but that's okay, the registers you need are available. Quote:
|
|
09 March 2023, 20:43 | #15 | |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,326
|
Quote:
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. |
|
09 March 2023, 21:12 | #16 | |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,476
|
Quote:
I just have to write the code |
|
10 March 2023, 00:19 | #17 |
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) |
10 April 2023, 12:42 | #18 |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,326
|
|
10 April 2023, 13:51 | #19 |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,476
|
Let me guess...
You will be really surprised |
10 April 2023, 14:10 | #20 |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,326
|
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... |
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 |
|
|