[MPlayer-users] mplayer and alsa9/dmix

Corey Hickey bugfood-ml at fatooh.org
Sun Apr 20 07:35:11 CEST 2003


Florian Schmidt wrote:
> 
> Here's again the relevant output for each of these commands:
> 
> Selected audio codec: [mp3] afm:mp3lib (mp3lib MPEG layer-2, layer-3)
> =======================================================================
> === Checking audio filter chain for 44100Hz/2ch/16bit ->
> 44100Hz/2ch/16bit... AF_pre: af format: 2 bps, 2 ch, 44100 hz, little
> endian signed int AF_pre: 44100Hz 2ch Signed 16-bit (Little-Endian)
> alsa-init: testing and bugreports are welcome.
> alsa-init: requested format: 44100 Hz, 2 channels, Signed 16-bit
> (Little-Endian) alsa-init: soundcard set to mixed
> alsa-init: unable to set periodsize: Invalid argument  # <---- this line
> Could not open/initialize audio device -> no sound.
> 
> 
> I forgot to mention, that this works with "aplay":
> 
> aplay -Dplugger sound.wav
> 
> creates the desired result (being able to run several instances of
> this commands simultaneously).. So i wonder, if my setup is wrong
> somehow, or if mplayer is broken. Maybe it's a bug in alsa, too. I'd
> like to find out.. Maybe my soundcard driver just hates pcm devices?
> 

I'm by no means an expert on this, I just replied because nobody else
did. :) I just now spent a while doing some research and tests, and
couldn't figure out how to make it work on my system either. I read
this:

http://www.alsa-project.org/alsa-doc/doc-php/asoundrc.php3#softmix

The dmix plugin defaults to 48000Hz, so I made a wave file:
$ mplayer file.mp3 -af resample=48000 -ao pcm

I was able to use aplay just fine:

$ aplay -v audiodump.wav -Ddmix
Playing WAVE 'audiodump.wav' : Signed 16 bit Little Endian, Rate 48000 
Hz, Stereo
Direct Stream Mixing PCM

Its setup is:
stream       : PLAYBACK
access       : RW_INTERLEAVED
format       : S16_LE
subformat    : STD
channels     : 2
rate         : 48000
exact rate   : 48000 (48000/1)
msbits       : 16
buffer_size  : 12000
period_size  : 6000
period_time  : 125000
tick_time    : 0
tstamp_mode  : NONE
period_step  : 1
sleep_min    : 0
avail_min    : 6000
xfer_align   : 6000
start_threshold  : 12000
stop_threshold   : 12000
silence_threshold: 0
silence_size : 0
boundary     : 1572864000
Hardware PCM card 0 'Sound Blaster Live!' device 0 subdevice 0

Its setup is:
stream       : PLAYBACK
access       : MMAP_INTERLEAVED
format       : S16_LE
subformat    : STD
channels     : 2
rate         : 48000
exact rate   : 48000 (48000/1)
msbits       : 16
buffer_size  : 12000
period_size  : 6000
period_time  : 125000
tick_time    : 10000
tstamp_mode  : NONE
period_step  : 1
sleep_min    : 0
avail_min    : 6000
xfer_align   : 6000
start_threshold  : 1
stop_threshold   : 1572864000
silence_threshold: 0
silence_size : 1572864000
boundary     : 1572864000

When I use mplayer, I get the same "unable to set periodsize" error
(I've attached a full log). I thought perhaps I should use plug:dmix
instead of just dmix. This worked with aplay, but mplayer complained
"ALSA lib pcm.c:6350:(snd_pcm_slave_conf) missing field pcm" when I
tried -ao alsa9:plug:dmix

I'm pretty sure that's a syntax error on my part, since the same happens
if I use "-ao alsa9:plug". Plug expects an argument, which should be
dmix, but I don't know how to make mplayer pass that argument. So, I
defined a quick pcm in my asoundrc:

pcm.blah {
         type plug
         slave.pcm dmix
}

Now, when I try mplayer -ao alsa9:blah, I'm back to the same "unable to
set periodsize" error.

So, I guess all this boils down to two questions I have, should anyone
who knows what to do read this mail:
1. If I want to use plug:something, what's the proper syntax?
2. Is the periodsize error a user problem or an mplayer bug?

Again, a full mplayer log is attached.

Thanks,
Corey
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: mplayer-dmix.log
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-users/attachments/20030419/a7f6a62c/attachment.asc>


More information about the MPlayer-users mailing list