[vlc-devel] ALSA problems

Rémi Denis-Courmont remi at remlab.net
Wed Jul 21 14:28:13 CEST 2010

On Wed, 21 Jul 2010 13:41:18 +0200, Grigori Goronzy <greg at chown.ath.cx>
> Much of audio hardware does not support arbitrary sample rates and lots
> of (older) integrated chipsets only support a sample rate of 48 KHz in
> hardware. So, software resampling is needed for all other sample rates.
> I'm sure the problem is somehow related to that.

Yeah, the Maemo port is forcing 48000 by default already for that reason.

> VLC should warn if they requested sample rate cannot be used, though...
> Have you tried explicitely enabling resampling?

On the VLC side, yes and it works as said earlier.

> This can be done with snd_pcm_hw_params_set_rate_resample().

I wonder if it is better to resample in VLC or in ALSA since both can do it

> Anyway, IIRC using a hw: or plughw: device will always bypass automatic
> resampling, so you're pretty much SOL.

That would explain it. But my reading of the VLC ALSA code is that it
requests the (input) audio codec's sample rate, and if that fails, falls
back to whatever ALSA wants. In this case, ALSA-lib accepts 44100 even
though it does not work properly.

Or maybe I misinterpreted ALSA-lib:
(I did not write that code snippet)

Rémi Denis-Courmont

More information about the vlc-devel mailing list