20 October 2012, 19:10 | #61 |
Registered User
Join Date: Mar 2008
Location: Poland
Posts: 159
|
|
20 October 2012, 19:16 | #62 | |
Registered User
Join Date: Jan 2012
Location: USA
Posts: 372
|
Quote:
Amiga audio is interesting in that the output rate per channel is variable. If the output rate is low enough, the CPU is more than capable of keeping up. And as Toni has pointed out before, the Amiga has a clever way of avoiding autovectoring for interrupts (autovector interrupts are a big hassle on Atari ST as they add a variable number of additional cycles to interrupt processing). This keeps interrupt response time low. I think the maximum is 40 cycles. As mentioned early, though, the COPPER can update audio outputs, too, and that's very fast indeed, but less flexible of course. I'd be interested in seeing if a hybrid approach might work: use DMA for some of the samples, but use the COPPER to sneak-in a few extra samples at those times when Paula requests a word from Agnus that can't be delivered in time. The max DMA rate is two outputs per scanline per channel. If the period is set to 63, then two samples are output in the first half of a scanline. A COPPER list that causes the COPPER to wait mid-scanline can then load the next two samples for the second half of the scanline. This would give an output rate of 56K. To make things fast, perhaps the blitter could be used to fill in the values for the COPPER list. |
|
20 October 2012, 20:24 | #63 |
Registered User
Join Date: Mar 2009
Location: moon
Posts: 373
|
Constantly resetting the volume counter will also give strange results below 56 kHz. But you will get results - by "won't work" I just meant they won't be normal (i.e. volume 32 won't necessarily give you half amplitude).
|
20 October 2012, 21:58 | #64 | |
Registered User
Join Date: Jun 2010
Location: PL?
Posts: 2,766
|
Quote:
Thx Toni, OK, so seems that i've not misunderstood HRM - there is no chance to bang directly AUDxDAT without processing interrupts generated after each word. |
|
20 October 2012, 22:29 | #65 | ||||
Registered User
Join Date: Jun 2010
Location: PL?
Posts: 2,766
|
Quote:
Quote:
Quote:
Quote:
|
||||
20 October 2012, 23:56 | #66 | |
Registered User
Join Date: Jan 2012
Location: USA
Posts: 372
|
Quote:
It should be possible to drive Paula directly with the CPU by polling INTREQR to see which channel needs a new sample, then clear the right bit in INTREQ, and then load the next word and loop. |
|
21 October 2012, 00:03 | #67 | |
Registered User
Join Date: Jun 2010
Location: PL?
Posts: 2,766
|
Quote:
CPU is "asynchronous" when Copper is fully synchronous to audio - CPU should focus on how to prepare data but Copper should be responsible for perfect timing. |
|
21 October 2012, 00:50 | #68 | |
Registered User
Join Date: Jan 2012
Location: USA
Posts: 372
|
Quote:
But I think in non-DMA mode Paula will simply continue to output the last value written to AUDxDAT until INTREQ is cleared and a new value is written to AUDxDAT. If the period value is very short, then Paula simply waits for the next INTREQ clear and AUDxDAT load which can be controlled by a COPPER list. And no need to process interrupts. |
|
21 October 2012, 14:45 | #69 | |
Registered User
Join Date: Jun 2010
Location: PL?
Posts: 2,766
|
Quote:
|
|
21 October 2012, 15:00 | #70 | |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,515
|
Quote:
I am more surprised that the diagram actually matches what real hardware does.. But there is one mistake (I finally remembered it): state 011 to 010 transition has condition "perfin * (AUDxON + /AUDxIP)", it should be "perfin * (/AUDxON + /AUDxIP)" = return back to state 010 when period counted to zero and audio dma is off and interrupt request is cleared. -- EDIT: I remembered wrong, it is correct. Go back to state 010 if period ended and (dma is on or interrupt status is cleared).. Without the AUDxON condition DMA mode wouldn't work at all. (and above "corrected" wrong condition was supposed to be "perfin * /AUDxON * /AUDxIP") -- It is confirmed correct because pseudo code like this works: Clear interrupt request, write only _once_ to AUDxDAT, Wait for audio interrupt Clear interrupt Wait for audio interrupt Clear interrupt and so on.. 010->011->010 state changes keep happening as long as interrupt is cleared. AUDxDAT write is only required to start the state machine. Last edited by Toni Wilen; 21 October 2012 at 18:15. |
|
22 October 2012, 19:34 | #71 | |
Registered User
Join Date: Dec 2007
Location: Dark Kingdom
Posts: 213
|
Quote:
Toni, the HRM and my memory says that you have to clear INTREQ. You don't need to enable interrupts to do that. You can keep interrupts disabled and just do a busy loop that waits for the bit in INTREQ to be set (to 1) by Paula. When this happens, you reset (to 0) it. This is what I recall and how I understand Toni's words |
|
22 October 2012, 19:51 | #72 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,515
|
Yeah, only channel's INTREQ bit needs to be cleared before both samples (one word) has finished playing. Paula won't care how you do it
|
23 October 2012, 23:30 | #73 |
Registered User
Join Date: Jun 2010
Location: PL?
Posts: 2,766
|
I understand correctly - however anything over wrote to AUDxDAT is unacceptable overhead on such bandwidth machine.
I understand that Copper need to make additional write and this is problem - i prefer bang AUDxDAT then dont care except those moment when i need "bang" - but i'm not a programmer... so perhaps this is doable without problems. |
15 September 2013, 21:34 | #74 |
Registered User
Join Date: Sep 2009
Location: Norway
Posts: 1,711
|
Bump.
This thread is very interesting, and we need more research on this topic. Too bad Jeri won't share the inner chip diagram of Paula.. I guess it makes sense though, those diagrams weren't probably meant to be spread. Last edited by 8bitbubsy; 15 August 2016 at 23:53. |
07 November 2013, 19:47 | #75 |
Registered User
Join Date: Dec 2002
Location: sweden
Age: 46
Posts: 430
|
any news on this?
|
11 November 2013, 17:53 | #76 |
Registered User
Join Date: Jun 2010
Location: PL?
Posts: 2,766
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
USB Flash Disk Low-Level Format | prowler | support.Hardware | 53 | 03 August 2012 21:39 |
Low level format utility for the A1200 | Fabie | support.Hardware | 20 | 11 January 2010 19:13 |
I'm stuck on the final level (level 3) of Ghostbusters II. | Ironclaw | support.Games | 34 | 24 October 2007 07:19 |
When to low level format | Galaxy | support.Hardware | 6 | 30 January 2007 12:39 |
Low Level Format??? | Djay | support.Hardware | 4 | 01 March 2003 20:58 |
|
|