[alsa-devel] Backported sbxfi driver, possible fix

Takashi Iwai tiwai at suse.de
Tue Oct 28 10:31:54 CET 2008


At Mon, 27 Oct 2008 20:08:04 +0000,
James Courtier-Dutton wrote:
> 
> Alexander E. Patrakov wrote:
> > Takashi Iwai wrote:
> > 
> >> Note: 44.1kHz is possible, but is more complex because it uses a method
> >> whereby the channel ring marks each sample in the channel ring as valid
> >> or not, so to get 44.1kHz, some samples are simply tagged invalid. The
> >> "channel ring" is not the ring buffer that is used to get sound samples
> >> to the card. The "channel ring" is used to pass samples between
> >> different processing modules on the card. One of these processing
> >> modules is the SRC, another is the INs/OUTs, another is the hardware
> >> mixer, and yet another is the DSP.
> > 
> > Do I understand correctly that the card internally resamples the sound 
> > to a different rate using the zero-order-hold method? If so, I'd rather 
> > not see this feature at all unless the "i_want_horrible_sound" parameter 
> > is passed, because software can do it better, and some program will 
> > surely default to using this hardware misfeature.
> > 
> 
> 
> Alex,
> 
> I added that comment (takashi cut and pasted my text). No resampling is
> done.
> Say you have a buffer that is running at 48kHz.
> So you have say 480 samples at the 48kHz rate.
> But if you want to transfer 44.1kHz rate samples over it, you only want
> 441 samples to be there, so what to do with the left over 39 samples.
> What the xfi does is next to each sample it adds a "valid" tag.
> So, the xfi adds those 39 samples but marks them as "invalid".
> The xfi then drops the 39 "invalid" samples, leaving only the 441
> "valid" samples just before sending them at 44.1kHz to the DAC.
> Does this explain things a bit better.
> FYI, the xfi actually works internally at 384kHz, so it is actually
> marking a lot of samples as "invalid".

Hm, so what is special about using 44.1kHz if many samples in the
audio-ring are already marked as invalid even with 48kHz?

It'd be helpful if you could provide a bit more information (or a
pseudo-code) for supporting non-48/96kHz samples.


thanks,

Takashi


More information about the Alsa-devel mailing list