Bug#663239: mplayer opens audio device in 48000 Hz for 44100 source material

Uoti Urpala uoti.urpala at pp1.inet.fi
Sun Apr 15 16:17:34 UTC 2012


As far as I can see there is no bug.

This is expected behavior with ALSA dmix. It has a fixed hardware output
frequency, in your case 48000 Hz. Anything played through dmix will be
resampled to 48000 Hz. mplayer2 could feed data to ALSA at 44100 Hz if
it left ALSA resampling enabled, but the only difference that would make
is that the resampling would happen on the ALSA side rather than on the
mplayer2 side.

There's no way hardware would support everything in the 4000-4294967295
range. That range only tells which rates ALSA is willing to resample to
48000 Hz. The values reported for the hw device, "44100 48000 96000
192000", are the ones your hardware can actually play without
resampling. If you select the hw device then you should be able to play
these rates without resampling (note that in contrast to dmix, using the
hw device directly reserves the device and no other audio source can
play at the same time).

The only thing here that could potentially be improved would be to allow
dmix to change the hardware playback rate depending on input streams, so
it could switch the hardware rate to 44100 Hz if that's the rate of the
only stream being played. But this would be nontrivial - what happens if
another stream is opened at a different frequency, etc.






More information about the pkg-multimedia-maintainers mailing list