[MPlayer-users] choosing which sound card with sdl

Vladimir Mosgalin mosgalin at VM10124.spb.edu
Wed Mar 11 20:39:30 CET 2009


Hi chris cringle!

 On 2009.03.11 at 14:40:30 +0000, chris cringle wrote next:

> > Your system-wide SDL preferences may offer more options, but that won't
> > necessarily help your case.
> 
> I'm new to SDL as I usually just use alsa. Where are these settings? I
> can't find any sdl related files in /etc.

SDL can be (somewhat) configured with environment variables.
For example I use
SDL_AUDIODRIVER=pulse

It redirects SDL to pulseaudio, which actually chooses audio card.

Examples of other options are

SDL_AUDIODRIVER=alsa
AUDIODEV=hw
(first alsa "hw" device)
SDL_AUDIODRIVER=dsp
AUDIODEV=/dev/dsp
(first audio card available though oss subsystem)

I'd suggest just installing pulseaudio (recent version) and using it
directly in mplayer, it can solve lot of audio-related problems. But if
you can't do this for some reason, you can use SDL and tell SDL to use
alsa (preferred on linux) or oss (probably though oss emulation in
alsa).  AUDIODEV can be used to specify exact audio device. Read SDL
documentation for other possible options.


Btw a very long time ago when i used alsa driver directly in mplayer
"autosync = 30" helped me to solve some a/v sync problems. Now I just
use "autosync = 5" which is enough for any audio driver on my current
system. Try it, maybe you'll regular alsa driver will do for you with
this option.

> > All I can suggest is, look at the man page; if it doesn't explain how to
> > do it, then there's fairly good odds that it can't be done. (Though in
> > some cases that just means that no one's implemented it yet.)
> >
> 
> There is no mention of it in the mplayer man page. I'm not sure why I
> have to use sdl, if all it does is wrap over the other device types
> why when I use them directly does my video die?

of course, mplayer has nothing to do with your audio card or driver when
it uses it though SDL wrapper. If you don't want this, don't use SDL..

-- 

Vladimir



More information about the MPlayer-users mailing list