[MPlayer-users] [AO_ALSA] Unable to set buffer time near: Invalid argument

Raymond Yau superquad.vortex2 at gmail.com
Sat May 8 02:25:44 CEST 2010

>> On Sun, 2009-12-20 at 09:55 -0500, Robert Henney wrote:

>* the latest svn appears to have an alsa issue when playing more than one
*>* file on some particular files I have.  it's reproducible too.
*>* the audio will consistently fail to initialize for the second video file,
*>* though if the files are reversed or played separately or -ao oss is used
*>* then the problem does not occur.
*>* mplayer -ao alsa "[SpoonSubs]_Sketchbook_full_color's_02_[E80DF436].mkv" \
*>*                  "[SpoonSubs]_Sketchbook_full_color's_03_[FFE2F973].mkv"
*>* results in:
*>*   Building audio filter chain for 44100Hz/2ch/s16le -> 0Hz/0ch/??...
*>*   [AO_ALSA] Unable to set buffer time near: Invalid argument
*>*   Failed to initialize audio driver 'alsa'
*>* the sample files are in http://rut.org/sketch/
>> Do you still get this error with the current git repo
(git://repo.or.cz/mplayer-build.git)? I fixed some issues that could
perhaps cause this, but as I can't reproduce your problem on my machine
I don't know whether those were the ones you hit.

It is because you changed the setting of buffer size/period size to
buffer time/period time

When you are using mmap , those PCI audio controller use DMA transfer
and the period size is usually multiple of PCI/PCIE brust size
so the drivers have constraint that the period size is multple of
PCI/PCIE brust size

Since sampling rate of audio is 44100 or 48000 which are multiple of 3
or 9 , the driver would not give you the exact period time/buffer time
which you want

e.g. the most common HDA audio has a constraint of multiple of 128 bytes


More information about the MPlayer-users mailing list