Segmentation fault when playing music mp3
#16
well... yet another day has gone... almost Eek
but still no play.

swiched from in kernel alsa drivers to build them as modules.
I have found out this tough. when xbmc is running no other app can use my sound device. when I close xbmc thers no problem, not even to play multiple sounds at the same time.

so it would seem that xbmc is somehow hogging my sound device.
Stare
//Alphacube
Reply
#17
Big Grin 
WOHOO finally some progress Laugh

if I have another app thats using the sound device running prior to starting xbmc It works like a charm Big Grin

but if no other app is running when I start xbmc ther'll be no sound when trying to play mp3 or flac. just the good error message:
ALSA lib pcm_dmix.c:996Sadsnd_pcm_dmix_open) unable to open slave

I still don't know whats causin this behavior.

Maby some dev could make some sens of it
//Alphacube
Reply
#18
Question 
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.
//Alphacube
Reply
#19
Lightbulb 
Humpf...I finaly have a conclusion.

use another Soundcard Stare

I had an old Sb Audigy lying around. I put it in. used make conf to select the right driver. ran alsaconfig and cashing...problem solved..

no more issues with
ALSA lib pcm_dmix.c:996: (snd_pcm_dmix_open) unable to open slave
//Alphacube
Reply
#20
Smile 
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.
//Alphacube
Reply
#21
Lightbulb 
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.
//Alphacube
Reply
#22
Hey I have the exact same problem!

None of the apps I start with a XBMC script have audio.. yet when I play a movie in VLC prior to starting XBMC, then suddenly script-started apps DO have audio.

alphacube Wrote: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.

I don't know about others, but I use xbmc on old equipment purposely. Better make a media center out of an old 800 MHz than to be out on the streets spitting on the ground. In fact, I've been trying to resolve this bug by trying it on my other computers, and 3 out of my 4 computers don't have this hardware support. If I make statistics out of me, then 75% of targetted computers have this problem. And with the upcoming popularity of eee PC's, I don't think a line of code to make this work is redundant..

So are you ready to report back? Because I didn't really understand your last post and I am eager to fix this.
Reply
#23
I have xbmc run a script that runs zsnes and after that run xbmc again.

Code:
$ [b]SDL_AUDIODEVICE=alsa[/b]
$ [b]xbmc[/b]
The XBMC_HOME environment variable is not set.
The XBMC_HOME environment variable is not set.
ZSNES v1.51, (c) 1997-2007, ZSNES Team
[i](...)[/i]
File opened successfully !
ALSA lib pcm_dmix.c:874:(snd_pcm_dmix_open) unable to open slave
The XBMC_HOME environment variable is not set.
The XBMC_HOME environment variable is not set.
ALSA lib pcm_dmix.c:874:(snd_pcm_dmix_open) unable to open slave

Code:
$ [b]env SDL_AUDIODEVICE=alsa xbmc[/b]
The XBMC_HOME environment variable is not set.
The XBMC_HOME environment variable is not set.
ZSNES v1.51, (c) 1997-2007, ZSNES Team
[i](...)[/i]
File opened successfully !
ALSA lib pcm_dmix.c:874:(snd_pcm_dmix_open) unable to open slave
The XBMC_HOME environment variable is not set.
The XBMC_HOME environment variable is not set.
ALSA lib pcm_dmix.c:874:(snd_pcm_dmix_open) unable to open slave

So I guess it didn't work. Did you figure anything else out?
Reply
#24
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]
Reply
#25
I've created a small script to facillitate the ugly workaround, and it works like a charm. Here it is:
http://forum.xbmc.org/showthread.php?p=2...post204279
Smile
Reply

Logout Mark Read Team Forum Stats Members Help
Segmentation fault when playing music mp30