27 May 2024, 21:30 | #21 |
Registered User
Join Date: Aug 2010
Location: Italy
Posts: 901
|
|
27 May 2024, 22:51 | #22 |
Registered User
Join Date: Dec 2018
Location: Earth
Posts: 1,117
|
Great Stereo Panning !
Very cool stuff Saimo |
27 May 2024, 23:53 | #23 |
Registered User
Join Date: Jul 2009
Location: Lala Land
Posts: 608
|
Is there any chance you could elaborate on this? Thanks!
|
28 May 2024, 11:13 | #24 |
Registered User
Join Date: Aug 2010
Location: Italy
Posts: 901
|
Quick answer during a break at work...
It is strictly necessary that all the channels operate in perfect sync. However, there's no way to start all of them at the same time due to the fact that they start when the AUDxDAT registers are written to, and neither the CPU, nor Copper, nor Paula itself via DMA (due to the CHIP bus slots allocation) can do that. CPU-wise things are even more complicated because the access timings vary depending on the CPU and on the expansion board. Therefore, I resorted to the method illustrated in the code below, which is a snippet of the Copperlist that gets executed only once and when no bitplane DMA is going on. Code:
* Set the periods to values decreasing by 4 ticks to compensate the fact that the channels are started with a difference * of 4 color clocks by the writes to AUD*DAT below here - thanks to such periods, all the channels will end playing the * first samples at the same time, thus synchronizing the playback of the following samples. * * NOTE * a) The synchronization must be done by the Copper as tests showed that the stock Amiga and the expanded Amiga have * different access times to the chipset registers (i.e. the writes to AUD*DAT would happen at different and possibly * irregular times). * b) The periods are such that they can be comfortably fixed later (see below). dc.w RO_AUD0PER,400 dc.w RO_AUD1PER,396 dc.w RO_AUD2PER,392 dc.w RO_AUD3PER,388 * Wait for a color clock beyond the memory refresh slots. dc.w $00e1,$80fe dc.w $0011,$80fe * Clear the AUD* interrupt requests and enable the AUD0 interrupt. dc.w RO_INTREQ,$0780 dc.w RO_INTENA,$8080 * Start the channels with null samples. * * NOTE * This causes the transition 000 -> 010. Before the samples finish playing (i.e. before the 011 -> 010 transition), the * proper periods must be set so that: the next samples will be played at the right frequency; the channels will restart * at the same time. Initially Paula loads the internal period counters from AUD*PER after the writes to AUD*DAT (i.e at * transition 000 -> 010), so writing AUD*PER before the transition 011 -> 010 (when AUD*PER will be read again) has no * no immediate effect. dc.w RO_AUD0DAT,0 dc.w RO_AUD1DAT,0 dc.w RO_AUD2DAT,0 dc.w RO_AUD3DAT,0 * Fix the periods. Copperlist_FP dc.w RO_AUD0PER,PERIOD dc.w RO_AUD1PER,PERIOD dc.w RO_AUD2PER,PERIOD dc.w RO_AUD3PER,PERIOD Last edited by saimo; 10 June 2024 at 22:53. Reason: Fixed broken English. |
28 May 2024, 12:59 | #25 | |
Registered User
Join Date: Aug 2020
Location: Sydney/Australia
Posts: 1,151
|
Quote:
I have both A1200 rev1d4 and A500 rev6A. Last edited by hammer; 28 May 2024 at 13:09. |
|
28 May 2024, 13:20 | #26 |
Registered User
Join Date: Aug 2010
Location: Italy
Posts: 901
|
Regarding the bottom note in my previous post: editing the post to add that note magically fixed the code! I don't dare touching that post again.
@hammer Even if emu68k would have an easier life, it still would be severely slowed down by the continuous, constant and numerous interrupts and writes to the Paula registers. An AHI driver should be possible, but its use would be limited because the CPU-driven method is inherently limited and not suitable for multitasking contexts. Last edited by saimo; 10 June 2024 at 22:54. Reason: Fixed broken English and newlines. |
28 May 2024, 14:49 | #27 |
Registered User
Join Date: Oct 2007
Location: ManCave, Canada
Posts: 1,676
|
@ saimo
sweet Demo! I can really here the quality of the music when played through my amp and 14" old school Boston Acoustics speakers |
28 May 2024, 15:15 | #28 | |
Registered User
Join Date: Aug 2010
Location: Italy
Posts: 901
|
@klx300r
Thank you (also for the tests on your 68060 machines) @all Some remarks by Gunnar in this thread on AmigaWorld made me realize a major flaw of this playback method - quoting myself: Quote:
Any thoughts? EDIT: line feeds are becoming a serious problem; I'm using FireFox. Last edited by saimo; 28 May 2024 at 15:27. |
|
28 May 2024, 15:56 | #29 |
Registered User
Join Date: Jul 2015
Location: The Netherlands
Posts: 3,464
|
Quite a cool demo, thanks for sharing it
Also, that Copper-synchronisation trick is pretty cool! May I ask how you figured out the exact values? Calculation or experimentation? |
28 May 2024, 16:05 | #30 | |
Registered User
Join Date: Aug 2010
Location: Italy
Posts: 901
|
My pleasure
Quote:
|
|
28 May 2024, 16:51 | #31 | |
Registered User
Join Date: Jul 2015
Location: The Netherlands
Posts: 3,464
|
Quote:
Then, the synchronisation happens and lastly the desired actual period values get written. Thanks for explaining it |
|
28 May 2024, 19:17 | #32 | |
Registered User
Join Date: Jun 2010
Location: PL?
Posts: 2,917
|
Quote:
|
|
28 May 2024, 19:38 | #33 | |
Registered User
Join Date: Aug 2010
Location: Italy
Posts: 901
|
Quote:
Due to this last realization, I've spent the afternoon looking into dithering and noise shaping. I have downloaded a number of tools and made a few tests (I've just finished) by reducing the original 32-bit float waveform to 8 bits, keeping the 192 kHz rate. These are the results, quantization noise-wise: * Audacity, with all its dithering methods (including shaping): very audible; * foobar2000 (https://www.foobar2000.org), which offers a SSRC resampler: very audible; * Acoustica (https://acondigital.com/products/acoustica), with the 8 bit aggressive noise shaping (the others are worse): better than the ones above, but still distinctly audible; * Reaper (https://www.reaper.fm) - barely audible at 176400 Hz; beyond my (poor ears) perception at 192000 Hz. Apart from the very last case, none of the other tests comes even close to the (albeit flawed) 14-bit playback (at the much lower rate of about 70938 Hz) as regards quality. Of course I'm a total noob, so somebody with experience and proper tools might achieve better results, but, on the other hand, only Acoustica provides configuration options, so... maybe there's only so much that can be done with 8 bits? Make no mistake, I'm impressed that 8 bits can sound so good at 192 kHz, but that's too taxing for a poor stock A1200. |
|
28 May 2024, 21:47 | #34 |
Alien Bleed
Join Date: Aug 2022
Location: UK
Posts: 4,861
|
Is it possible to use the CPU to drive the volume control in tandem with an 8 bit stream? Maybe a volume modulated, preprocessed 8 bit stream could sound better than a vanilla 8-bit one at fixed volume. This is a variation on an idea I had a long time ago that was to be based on channel modulation.
|
28 May 2024, 22:26 | #35 | |
Registered User
Join Date: Aug 2010
Location: Italy
Posts: 901
|
Quote:
That said, I'm not sure that your idea is feasible: according to the audio state diagram on the AHRM, the volume counter does not get reloaded when it's the CPU that writes to AUDxDAT - and that sounds plausible, otherwise, at volume 1, the low 6 bits would never be heard and the demo music wouldn't sound so good (especially the coda, where the signal is so weak that it would drown in the 8 bit quantization noise); on the other hand, in DMA mode, the volume counters do get reloaded, so it would be natural and much cheaper to keep the same behaviour... I don't know, but I'll make a few tests right away and see what the actual behaviour is. Edit: given the result of the tests, your idea should be definitely doable and should work great at 3546895/64 = 55420 Hz also, it just occurred to me that I implemented the same concept to remove the noise at the end of the music of my other demo THE CURE: the music there is just 8-bit and its clean guitar arpeggio at the end would be totally noisy without volume control (but the solution there is really basic and rough: from a certain point on to the very end, I amplified linearly the waveform from 100% to the maximum and then the code performs the fade-out by decreasing AUDxVOL). Last edited by saimo; 28 May 2024 at 23:52. |
|
28 May 2024, 22:49 | #36 |
Registered User
Join Date: Aug 2010
Location: Italy
Posts: 901
|
@Karlos
I just did a couple of quick tests: 1. writing to AUDxVOL the low 6 bits (which is basically what the player based on your idea would do): the sound was totally distorted, which proves that the volume counters do get reloaded also in non-DMA mode; 2. setting AUDxVOL to 0 for the low 6 bits channels: even my poor ears could hear the quantization noise! What gives?!? Edit: could it be that Paula scales the internal volume counters to the period value, when the latter is less than 64? how can the fact that a volume of 1 works (or at least has a certain effect) when the period is less than 64? Last edited by saimo; 28 May 2024 at 23:55. |
28 May 2024, 22:56 | #37 | |
Registered User
Join Date: Jun 2010
Location: PL?
Posts: 2,917
|
Quote:
I will try to use 64489Hz sample rate (close to two times oversampled 32kHz) - personally not hear anything above 15kHz. |
|
28 May 2024, 23:05 | #38 | |
Registered User
Join Date: Aug 2010
Location: Italy
Posts: 901
|
Quote:
In turn, tomorrow I'll prepare a modifed version of the playback tool that simply plays 8 bit data, so that anybody can make tests. Edit: relatively to the dither + noise shaping tests, I forgot to mention that I listened to the resulting waveforms directly on the PC where the processing was done, not on the Amiga (so the results were not affected by the Amiga's hardware). Last edited by saimo; 28 May 2024 at 23:14. |
|
29 May 2024, 06:59 | #39 | |
Registered User
Join Date: Jul 2009
Location: Lala Land
Posts: 608
|
Quote:
|
|
29 May 2024, 09:31 | #40 | |
Alien Bleed
Join Date: Aug 2022
Location: UK
Posts: 4,861
|
Quote:
I'm not sure if the concept is still clear, so just to recap, the original idea was that your source 16 bit audio (for example) would be preprocessed into a set of frames (minimum size of 2 samples) of 8 bit that have been scaled so that it can be played back at a particular volume to re-approximate what the 16 bit sample levels would be. This 2:1 sample to volume data rate was a side effect of how channel modulation works and the fact that Paula DMA fetches 16 bits. My original experiments were all in pure software and used a bigger ratio, e.g 16:1 as this reduces the stream size quite a bit and didn't degrade the output too much. Paraj (or another gentleman of quality) did implement the proposed HW playback mechanism in a prototype, which sounded pretty good to me, but unfortunately, that was all under emulation as my real HW is not currently in a working state. |
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
ArtPazz - New game for AGA Amigas [WIP] | saimo | Amiga scene | 38 | 07 June 2023 15:08 |
RNOPDF for ECS/AGA Amigas released | jPV | News | 5 | 10 July 2020 07:57 |
Recommend a good Hertz switcher? | lordofchaos | request.Apps | 5 | 28 June 2013 04:55 |
How does a 50 Hertz image get displayed? | Richardcavell | Coders. Asm / Hardware | 14 | 15 March 2013 13:59 |
AGA Amigas | Kitty | Retrogaming General Discussion | 25 | 13 October 2009 12:56 |
|
|