10 February 2021, 10:53 | #101 |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
|
@meynaf: yesterday I did an edit to an answer to Don_Adan to indicate what a big problem is: http://eab.abime.net/showpost.php?p=...3&postcount=69
Even if you correct the phase 'manually', syncing the AUDxDATs writes (if and only if it is truly ascertained that it is due to that) then you cannot use anymore the DMA. And this would be a very big limitation (especially to maintain a constant flow at high frequencies). |
10 February 2021, 11:02 | #102 | |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,322
|
Quote:
And if not, then we can attempt to alter it. So it all boils down to knowing what exactly gives said phase shift. |
|
10 February 2021, 11:21 | #103 | |||
Registered User
Join Date: Feb 2021
Location: Becej / Serbia
Posts: 120
|
Quote:
Quote:
Quote:
I think I know how we can find out how big the shift exactly is. Since we know it is less than 0.5 because the noise is amplified if I use the LUT approach and delay the 63 values by 1 sample. So, in that case we can do this. measurement 1: channel 0 data: 255,-255,255,-255 channel 3 data: 0, 0, 0, 0 measurement 2: channel 0 data: 255, -255, 255, -255 channel 3 data: -255, 255, -255, 255 we loop with these values forever and sample the output. then we measure the amplitude of the resulting audio and we have the phase shift. If the audio amplitude of measurement 2 is the same as measurement 1, then the phase shift is exactly 0.5, if measurement 2 results in silence, then the shift is 0 and in between the amplitude changes linearly depending on the shift. |
|||
10 February 2021, 11:34 | #104 |
Registered User
Join Date: Jan 2020
Location: oslo/norway
Posts: 1,607
|
I got new handle for you :P
Pytagoras Orangespider |
10 February 2021, 12:38 | #105 |
Registered User
Join Date: Jun 2010
Location: PL?
Posts: 2,741
|
If there is any chance for using 2 audio channels with normal DMA to play samples but in interleaved way - like for example |cn| where c means Channel and n is sample e.g. 00,10,01,11,02,12,03,13 etc? If yes and samples can be interleaved then easily 8 bit but double speed audio (without productivity) can be created and this together with aggressive noise shaping should provide HQ samples - similar to 14 bit mode but without too many complications...
|
10 February 2021, 12:57 | #106 | |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
|
Quote:
In any case then you should modify the samples on both channels, as they work in hold mode (but that would be simple ) |
|
10 February 2021, 12:57 | #107 | |
Registered User
Join Date: Feb 2021
Location: Becej / Serbia
Posts: 120
|
Quote:
c0: 0000.1111.2222.3333.4444 c3: x000.0111.1222.2333.3444 So you have say 25% of 0 and 75% of 1 from c3 while c0 is holding 1. So you can then get those 2 values to compensate to 2 values from the original file. Say you wanted to play 10 and 14 during 1 frequency tick. You would have to adjust 01, 30 and 31 to produce what you want. But to get to the exact values, you need to know the exact shift. edit: For the example above we would already have the 30 set in the previous sample, let's say it was 8. So to get 10 and 14, we would have to set 01 at 4 and 31 at 24, which would then give us for the first half of the sample: (8 + 4*2 + 24)/4 = 10 and for the other half: (4+24)/2 = 14 This is one of the things my program currently does, altho it does with an assumed phase shift value which is incorrect. But it also spreads the errors and has the channels set to volume 64 and 63 to be able to get a greater number of combinations. Last edited by orangespider; 10 February 2021 at 13:08. |
|
10 February 2021, 13:04 | #108 |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
|
|
10 February 2021, 13:12 | #109 | |
Registered User
Join Date: Jan 2008
Location: Warsaw/Poland
Age: 55
Posts: 1,957
|
Quote:
For me you can choose very good quality mono 16 bit raw sample, 256KB length. Set only left channels 2 buffers, every 128KB (AudLen = $0000). And try to choose the best 64 and 63 tables for left channel. Later set right channel only and choose different (best) tables 64 and 63 tables for right channel. Fiinally you will be have 4 tables for 4 Amiga channels. |
|
10 February 2021, 13:12 | #110 | |
Registered User
Join Date: Feb 2021
Location: Becej / Serbia
Posts: 120
|
Quote:
edit: The sample I am talking about is this one: http://s000.tinyupload.com/index.php...43813088953288 If you listen to it you'll notice there are frequencies in there that shouldn't exist at 27710. Altho since I am using wrong shift values, the output is not good enough yet. |
|
10 February 2021, 14:16 | #111 |
Moderator
Join Date: Dec 2010
Location: Wisconsin USA
Age: 60
Posts: 839
|
|
10 February 2021, 14:27 | #112 | |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
|
Quote:
Ok, I saw your (two) edits with the additions only after |
|
10 February 2021, 14:32 | #113 |
Registered User
Join Date: Feb 2021
Location: Becej / Serbia
Posts: 120
|
Ok, so nikosidis and I have finished the measurement process and I know the actual phase shift. It appears to be around 4 bus cycles or 1/886718.75 seconds on a PAL screen regardless of the playback frequency - which btw is the exact delay of DMA writes.
edit: At 27710Hz this translates exactly into: channel0 start: 0/32 samples channel1 start: 1/32 samples channel2 start: 2/32 samples channel3 start: 3/32 samples edit 2: At any AUDxPER the delay translates into this: channel0 start: 0/AUDxPER samples channel1 start: 4/AUDxPER samples channel2 start: 8/AUDxPER samples channel3 start: 12/AUDxPER samples Don't know about the scandoubled values though, they might or might not differ. Last edited by orangespider; 10 February 2021 at 14:47. |
10 February 2021, 14:45 | #114 |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
|
AUxDATA write by DMA is spaced 2 bus cycles, 1 bus cycle is 3546895Hz (~282ns), so is double the DMA writes.
|
10 February 2021, 15:00 | #115 |
Registered User
Join Date: Feb 2021
Location: Becej / Serbia
Posts: 120
|
|
10 February 2021, 15:08 | #116 | |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
|
Quote:
Maybe something related to DMAL? |
|
10 February 2021, 15:15 | #117 | |
Registered User
Join Date: May 2017
Location: Munich/Bavaria
Posts: 2,294
|
Quote:
But percentage or degree wise the influence is bigger on shorter periods (= higher playback frequency) So 12 cycles delay are <10% for a 128 ticks period or ~33° phase for 27kHz But for a 64 ticks period this are ~19% or 67.5° phase mismatch at 54kHz... (that is for channel 0+3) For channel 1+2 it is no problem at all for normal PAL and and can maybe even be neglected for 54kHz playback, or should at least be fine with your "dominance switch avoidance". Last edited by Gorf; 10 February 2021 at 15:28. |
|
10 February 2021, 15:47 | #118 |
Registered User
Join Date: May 2017
Location: Munich/Bavaria
Posts: 2,294
|
For the 0+3 channel @54kHz playback we could maybe take the following approach:
we would need a high quality audio sample and convert it to 5x of our target frequently - in this case 277kHz. for every point in time a regular 54kHz playback would need we have now 4 additional points between them. Let's call them t0, t1, t2 t3, t4 t0 is the time channel 0 starts playing - the next value comes in at t(0+5) t1 is due to the delay of about 20% or 1/5 the time channel 3 starts playing - the next value comes in at (t1+5) at t0 channel 0 needs to play a value that in combination with the previous value of channel 3 at time t(1-5) represents the desired "14.5bit" value at the timecode t0 of our 277kHz sample. at t1 channel 3 needs to play a value that in combination with the value we did put in channel 0 at t0 gives us a good representation of the value at the timecode t1 of our 277kHz sample. the values at timecode t2, t3 and t4 of our 277kHz sample are ignored and we repeat our procedure at t(0+5) .... Last edited by Gorf; 10 February 2021 at 15:55. |
10 February 2021, 15:51 | #119 |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
|
Nah .. this can't be the case, deleted
Last edited by ross; 10 February 2021 at 16:09. |
10 February 2021, 16:39 | #120 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,502
|
Bit late answer but I wasn't sure if this thread will become one of those threads or not..
But yes, volume counter is reset when: audio channel state transitions from 0 to 2 (=Copper/CPU AUDxDAT write) or DMA does AUDxDAT write (channel's horizontal slot position) and state is 5. Check "volcntrld" in HRM audio state diagram. I think it can be reset manually by doing this: 1: Make sure audio channel is idle. 2: CPU/copper write to AUDxDAT. Volume counter is reset. (Probably needs copper to guarantee correct timing?) 3: Switch DMA on. DMA mode "starts" and volume counter is not reset because state transition from 5 to 2 didn't happen. 4: Audio continues in DMA mode with original AUDxDAT position "synced" volume counter. Step 3 needs extra care because DMA must be switched on before period has counted down. It also bypasses stages 1-5-2 which means DMA continues from previously latched position, which is not necessarily same as AUDxLC, same with AUDxLEN. To make this work, you probably need to start normal audio DMA first, wait a bit, turn off DMA. Wait until audio state is back to zero. Now AUDxLC and AUDxLEN has been "prelatched". Then continue with step 1. This is not tested but should work |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
15 bit 44 khz audio idea. | Thorham | Coders. General | 33 | 15 September 2021 06:22 |
24 or 32 bit audio capture within WinUAE | EAUniW | support.WinUAE | 7 | 17 September 2018 22:22 |
Questions about 14 bit audio playback | xxxxx | Coders. Asm / Hardware | 16 | 22 December 2014 19:30 |
High Quality reproduction of Audio on 8 bit. | pandy71 | Amiga scene | 0 | 01 July 2013 15:08 |
Simple 14 bit audio question... | Thorham | Coders. General | 7 | 06 June 2010 10:55 |
|
|