Welcome, Guest. Please login or register.

Author Topic: Maximum Paula sample rate in PAL mode?  (Read 9072 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline Zac67

  • Hero Member
  • *****
  • Join Date: Nov 2004
  • Posts: 2890
    • Show all replies
Re: Maximum Paula sample rate in PAL mode?
« on: October 09, 2012, 08:22:21 PM »
From AHRM 89, p. 137:
Minimum sample time in DMA mode is 124 ticks for NTSC, 123 for PAL.

Ticks are based on 28.63636 MHz (NTSC) or 28.37516 MHz (PAL) main oscillator, divide by 8.
Maximum sample rate for a PAL machine in PAL mode: 28,836.54 Hz.
The absolute maximum is an NTSC machine in PAL mode: 29,101.99 Hz.

Of course, you can also feed Paula from the CPU - don't think there's a real limit here other than chipmem bandwidth and CPU latency, but you'll need some software to support that. Anyone?
 

Offline Zac67

  • Hero Member
  • *****
  • Join Date: Nov 2004
  • Posts: 2890
    • Show all replies
Re: Maximum Paula sample rate in PAL mode?
« Reply #1 on: October 10, 2012, 06:42:16 PM »
Hmm...

Have never actually banged Paula, but DMA mode seems pretty straightforward. You allocate two buffers, initialize hardware, start DMA and when the IRQ for 1st buffer empty comes switch to 2nd buffer, reload 1st and so on. I guess the IRQ comes pretty late (last sample pair loaded) and you (=audio.device) need to react pretty quickly to set the other buffer (within 69 µs) - may be a bit tight with an 68000 w/o fast RAM, but an '020+ should really be able to do it. Think I need to try it out some day.

BTW: has anyone ever used the Copper to load samples in non-DMA mode? :lol:
Seriously, that might be a reliable way to run high sample rates on low bandwidth machines. You'd need to stay low with bitplane DMA but that's probably the same with CPU loading and even in DMA mode since you need to access the registers before the last sample's been played - so no superhires full overscan screens please.
« Last Edit: October 10, 2012, 06:55:45 PM by Zac67 »
 

Offline Zac67

  • Hero Member
  • *****
  • Join Date: Nov 2004
  • Posts: 2890
    • Show all replies
Re: Maximum Paula sample rate in PAL mode?
« Reply #2 on: October 10, 2012, 07:28:31 PM »
@ChaosLord: care to elaborate?

Of course, it'd waste lots of chipmem but feeding e.g. triple hsync frequency should be fairly easy. Running arbitrary sample rates is somewhat more complicated but you only need to calculate the 'Copper feed coordinates' for a single screen or maybe two or three and then reuse them as often as the sample requires.
Where does it waste CPU cycles other than for inserting the samples into the prebuilt Copper list?

Quote
But generally it is not good idea push hardware to the limits but leave small error margin...

Why not? Nothing's gonna break, just samples repeating if you fail.
 

Offline Zac67

  • Hero Member
  • *****
  • Join Date: Nov 2004
  • Posts: 2890
    • Show all replies
Re: Maximum Paula sample rate in PAL mode?
« Reply #3 on: October 15, 2012, 06:47:12 PM »
All Amiga chipset DMA is tightly coupled to horizontal video timing. Paula's audio data has one DMA timeslot per scanline allocated for each of the audio channels. The bus is 16 bit wide, so two samples can theoretically be played during each scanline. Some internas of the chipset limit the theoretical 31+ kHz max sample rate to 28867 Hz (according to AHRM).

So, if you increase the horizontal scan frequency Paula is allocated more DMA slot time (shorter intervals) and can increase the sample rate without underrunning DMA throughput.

Another way is to feed data through the CPU - but that would require very fast IRQ handling and produce significant overhead. It should also be possible to use the Copper to feed data into the D/A registers (like in CPU mode) but apparently nobody has done it yet.