Re: [linux-audio-dev] using SB Live (emu 10K1) for realtime sample rate conversion?

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: Re: [linux-audio-dev] using SB Live (emu 10K1) for realtime sample rate conversion?
From: Frank van de Pol (fvdpol_AT_home.nl)
Date: Thu Aug 08 2002 - 00:02:34 EEST


On Wed, Aug 07, 2002 at 10:01:39AM +0200, olaf_AT_expansions.nl wrote:
> > Hi Olaf,
> >
> > most (if not all) soundcards that feature downloadable wavetable synths
> > feature a number of phase accumulators to perform the sample rate
> > conversion. As a bonus these voices typically also provide (resonant)
> > filters :-). Routing individual voices to different busses (to get your 4
> > distinct outputs) could be an interesting challenge. On the other hand the
> > emu10k driver supports reverb/chorus 'effect sends' per voice, so it can
> > address at least 4 busses (mix L/R + eff 1/2).
> >
> > The voice should be set to loop; while your program replaces the
> > to-be-player portion of the buffer with the appropriate fresh data.
> >
> > An example of the implementation of wavetable support can be found in the
> > alsa synth subsystem (in alsa-kernel). The Gravis Ultrasound Classic
> driver
> > could serve as an example where the synth is used to playback a pcm
> stream.
> > I know code exists to play audio files through the emu8k synth but have no
> > experience with it
> (http://www.maz-sound.com/archives/awewaveplayer-03f.tgz)
> >
> >
> > Of course all this hassle makes your mp3 box very hardware dependend and
> not
> > very portable. If CPU power is no objection I would opt for the software
> > solution (which could give you also the possibility to scrub/play the
> sample
> > backward like on a normal deck (turntable). (see alsaplayer /
> terminatorx).
> >
>
> unfortunately CPU power is a problem, so it doesn't seem an option to do
> high quality sample rate conversion and anti-aliasing in software as our CPU
> will probably run out of juice... btw, there is also hardware that can do
> the scrub thing these days, my idea was as most DAC's (like the Crystal DA
> converters) offer sample rates from 2kHz up to 100kHz by setting the
> masterclock freq this could also be done using a hardware solution...

I don't think changing the sample rate is the way to go since the
programmable clock dividers featured in most have a reasonably course
interval, and when turning towards a low sample rate you'd also need to
adjust the (steep and therefore high order) low pass filters to avoid
aliasing.

Keep the DAC running at a constant rate, and resample the data send towards
the DAC. Instead of feeding every sample from the buffer 1:1 to the DAC you
need to resample the data. Typically this is done using a phase accumulator
driving the index into the buffer of sampled data. This way you can have a
fractional number of samples 'played' for each phyiscal (hardware driven)
sample.
 
I know this smells like a software job, and that you don't have the juice
for it in your cpu. Fortunate hardware exists that feature DSPs that handle
this task. The good news is that your probably already have such DSP in your
machine :-)

A typical wavetable synth or sampler does exactly what you want. It has
multiple voices of which each is capable of playing at a different pitch
(=resampling at variable rate!). The challenge would be to write a driver
which does not simply feed data towards the DAC, but feed it through the
synth (have the synth play some circular buffer, in which the driver places
the appropriate data).

Are you really sure that the CPU has not enough juice to perform resampling?
If this is true you definitly NOT want to decode MP3 (which is a way more
cpu intensive process). Way back in 1988 I could already have my 8 MHz ARM2
based (Acorn Archimedes) computer playback 4 channels of resampled (and
interpolated) data at nearly CD quality (32 kHz).

Frank.

>
> wat i don't understand right now: f.e. the EMU 10K1 chip also offers custom
> sample rates by setting a master clock, but non of the drivers i've seen
> seems to have implemented this...i think this is because of the fact that
> the Creative hardware on which the emu chip is used doesn't cater for
> non-regular sample-rates?
>
> thanks for all the feedback!
>
> Olaf
>
>
> > Cheers,
> > Frank
> >
> >
> >
> > --
> > +---- --- -- - - - -
> > | Frank van de Pol -o) A-L-S-A
> > | FvdPol_AT_home.nl /\\ Sounds good!
> > | http://www.alsa-project.org _\_v
> > | Linux - Why use Windows if we have doors available?
> >

-- 
+---- --- -- -  -   -    - 
| Frank van de Pol                  -o)    A-L-S-A
| FvdPol_AT_home.nl                    /\\  Sounds good!
| http://www.alsa-project.org      _\_v
| Linux - Why use Windows if we have doors available?


New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : Thu Aug 08 2002 - 00:10:41 EEST