[MPlayer-dev-eng] alsa driver and pcm devices (bugfix maybe)

Florian Schmidt mista.tapas at gmx.net
Sun Apr 20 15:52:28 CEST 2003


Hi,

i wrote about my experiences with mplayer and the alsa9 output driver on
the user-mailinglist. 

Here's what i try to do..

I have installed a pcm device called "plugger" in my .asoundrc, which
basically is an alias for the alsa9 pcm driver name "plug:dmix".

Now, when i start mplayer like this:

mplayer -ao alsa9:plugger video.avi

the alsa-init code complains about not being able to set the period size
and/or # of periods (for details look at the thread in mplayer-users
with subject: "mplayer and alsa9/dmix").

I looked at the source code and found these lines (libao2/ao_alsa9.c):

590 ff:

#ifdef SET_CHUNKSIZE
      {
	//set chunksize
	if ((err = snd_pcm_hw_params_set_period_size(alsa_handler,
alsa_hwparams, chunk_size, 0)) < 0)	  {	    
	printf("alsa-init: unable to set periodsize: %s\n", snd_strerror(err));	    
	return(0);
      }

Here, the snd_pcm_hw_params_set_period_size() call fails, if i use the
pcm plugger device.

So, in an uneducated attempt, i changed the call to

snd_pcm_hw_params_set_period_size_near()

This seemingly "fixed" the issue..

I can now watch movies with the plugger device. This makes mplayer work
with software mixing with the alsa dmix plugin.  

This Bugfix is, of course, a shot in the dark. I read some alsa api docs
and just gave it a try. Never expected it to work..

Any thoughts?

Regards,
Florian Schmidt

-- 
mista.tapas at gmx.net
sound clips - http://www.arted.biz/mista.tapas



More information about the MPlayer-dev-eng mailing list