Posts: 26
Joined: Jun 2008
Reputation:
0
2008-07-09, 23:41
I have a feeling this might be due to SDL.
did some experimenting.
Setup
2 eterms with mplayer.
test1
eterm1: mplayer some.mp3
eterm2: mplayer other.mp3
result: I hear bot mp3's
test2
eterm1: mplayer -ao sdl some.mp3
eterm2: mplayer other.mp3
result: I only hear some.mp3 mplayer for other.mp3 says same error as described erlier in this thread
test3
eterm1: mplayer some.mp3
eterm2: mplayer -ao sdl other.mp3
result: I can hear bot mp3's.
test4
eterm1: mplayer -ao sdl:alsa some.mp3
eterm2: mplayer other.mp3
result: I hear both mp3's
conclusion:
Need to invoke sdl and make it use alsa and not oss.
but why this seems to be only for my setup ...I have no idea.
lspci gives:
Multimedia audio controller: Intel Corporation 82801EB/ER (ICH5/ICH5R) AC'97 Audio Controller (rev 02)
and I use snd_intel8x0 as alsa driver.
Posts: 26
Joined: Jun 2008
Reputation:
0
2008-07-10, 11:09
I really think this has to do with my onboard sound chip's lack of hardware mixers.
and it seems that by default SDL is using direct access to my sound device and therefor locking it.
the strange thing is as soon as I play a movie the lock dissapears.
so it could be that when playing movie the correct parameters is passed to SDL to use native ALSA but not when playing music or the menu klick sounds. :confused2:
Maybe ther's a fallback option when SDL cant claim the dvice for it self.
and thats why it works when I have another sound stream running while starting xbmc...
I do think this is something that could be fixed in the code. but us users with really crappy sound cards are not many these days. so the vig lot wont even notice.
Posts: 26
Joined: Jun 2008
Reputation:
0
2008-07-10, 20:54
Now I'm closer to understand the problem.
It seems that if I have enabled ALSA oss emulation sdl defaults to use that device and since my onboard audio lacks hardware mixer it can only handle one stream at once.
so the solution were actually really simple. just turn off ALSA oss emulation.
I read something about SDL_AUDOIDEVICE variable and it might be possible to set it to alsa...
I'll be back when I'v tested.
Posts: 133
Joined: Jul 2008
Reputation:
0
I'm no professional, so I tend to think of really ugly workarounds.. but do you know how to make multiple threads in bash or python?
I think a xbmc-launcher-script that plays mplayer /usr/share/xbmc/sounds/Bursting Bubbles/nav.wav (forcing alsa) simultaneously with xbmc might prevent xbmc from setting the lock.
I don't know how to force alsa either, so I just do killall pulse so mplayer reads:[code]AO: [pulse] Failed to connect to server: Connection refused
AO: [alsa] 48000Hz 2ch s16le (2 bytes per sample)
[code]