Sporadic audio problems - failed to initialize audio device
#1
Hey,

lately I started having audio issues with my xbmc install.
I can't reproduce it, but more and more often, when starting a video, mostly xvid tv rips, I get no sound and the error "failed to initialize audio device".
I get this with Babylon and with later SVN builds as well.
I gotta restart video a few times, or even wait a minute or so, and voila then the audio is fine.
I am running Ubuntu 9.04 with up2date alsa using the alsa update script. Uninstalled pulseaudio completely.
I got my AV Receiver hooked up via spdif and set digital out to iec958 in xbmc.

Anyone else having problems like that?

I didn't append a log since as I said, problem is kinda sporadic, and hardly reproduceable ...

thanks

boba
Reply
#2
Without a log when the error occurred and one when it don't all you'll get is guesses, do you want guesses?
If you have problems please read this before posting

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.

Image

"Well Im gonna download the code and look at it a bit but I'm certainly not a really good C/C++ programer but I'd help as much as I can, I mostly write in C#."
Reply
#3
Do you have a custom .asoundrc file ?
What is your digital out/passthrough device set in xbmc ? There are two places.

What is your soundcard type. HDA Intel ?

What gives for
aplay -l and
aplay -L

Is downmix to two channels option ticked for multichannel tracks ?
Crossfading is set for music playback ?
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
Reply
#4
alanwww1 Wrote:Do you have a custom .asoundrc file ?
What is your digital out/passthrough device set in xbmc ? There are two places.

What is your soundcard type. HDA Intel ?

What gives for
aplay -l and
aplay -L

Is downmix to two channels option ticked for multichannel tracks ?
Crossfading is set for music playback ?

alsa -l -L outputs:

$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: NVidia [HDA NVidia], device 0: ALC889A Analog [ALC889A Analog]
Subdevices: 0/1
Subdevice #0: subdevice #0
card 0: NVidia [HDA NVidia], device 1: ALC889A Digital [ALC889A Digital]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: NVidia [HDA NVidia], device 3: NVIDIA HDMI [NVIDIA HDMI]
Subdevices: 1/1
Subdevice #0: subdevice #0
boba@alderan ~/.xbmc/userdata
$ aplay -L
default:CARD=NVidia
HDA NVidia, ALC889A Analog
Default Audio Device
front:CARD=NVidia,DEV=0
HDA NVidia, ALC889A Analog
Front speakers
surround40:CARD=NVidia,DEV=0
HDA NVidia, ALC889A Analog
4.0 Surround output to Front and Rear speakers
surround41:CARD=NVidia,DEV=0
HDA NVidia, ALC889A Analog
4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=NVidia,DEV=0
HDA NVidia, ALC889A Analog
5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=NVidia,DEV=0
HDA NVidia, ALC889A Analog
5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=NVidia,DEV=0
HDA NVidia, ALC889A Analog
7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=NVidia,DEV=0
HDA NVidia, ALC889A Digital
IEC958 (S/PDIF) Digital Audio Output
hdmi:CARD=NVidia,DEV=0
HDA NVidia, NVIDIA HDMI
HDMI Audio Output
null
Discard all samples (playback) or generate zero samples (capture)

Soundcard is onboard NVidia on the Board mentioned in my sig.
Downmix to two channels is DISABLED.
Audio output device: default
Passthrough device: iec958

Crossfade in music settings is OFF.

Will try to get and paste the log as soon as it happens again.
As I said, the thing I find weird, is that it isn't really reproduceable ...
Happens simply from time to time, but it was e.g. yday as bad, that I had to restart the video like 6 times before sound started working.

boba
Reply
#5
Alright, here's the log:

http://pastebin.com/m5211a69c

Just started XBMC, went to a episode of 24 on a samba share. Started it and bang: failed to initialize audio device :-(

Thanks for any help

ah and i got no .asoundrc file, no custom one.

boba
Reply
#6
boba23 Wrote:Alright, here's the log:

http://pastebin.com/m5211a69c

Just started XBMC, went to a episode of 24 on a samba share. Started it and bang: failed to initialize audio device :-(

Thanks for any help

ah and i got no .asoundrc file, no custom one.

boba

Thx, could you please turn on debuglogging and paste a new one when it happens again Smile

(you can turn it on somewere in settings, can't recall were now)
If you have problems please read this before posting

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.

Image

"Well Im gonna download the code and look at it a bit but I'm certainly not a really good C/C++ programer but I'd help as much as I can, I mostly write in C#."
Reply
#7
topfs2 Wrote:Thx, could you please turn on debuglogging and paste a new one when it happens again Smile

(you can turn it on somewere in settings, can't recall were now)

Alright, will try asap. Can't make anything of that alsa error -22- in the log yet?

boba
Reply
#8
boba23 Wrote:Downmix to two channels is DISABLED.
Audio output device: default
Passthrough device: iec958
boba

Why is downmix disabled ? iec958 output with spdif connection only supports 2 channel audio. So in case you try to play multichannel file which is not ac3 or dts Alsa returns with an error as your crad does not support multichannel lpcm.

You SHOULD set the downmix to yes. And i suggest setting iec958 for BOTH devices. As i know default alsa device has some kind of software mixing which not always work. Al least for me. And you should delete any custom .asoundrc file.

I have the same audio codec so this could help you.
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
Reply
#9
alanwww1 Wrote:Why is downmix disabled ? iec958 output with spdif connection only supports 2 channel audio. So in case you try to play multichannel file which is not ac3 or dts Alsa returns with an error as your crad does not support multichannel lpcm.

You SHOULD set the downmix to yes. And i suggest setting iec958 for BOTH devices. As i know default alsa device has some kind of software mixing which not always work. Al least for me. And you should delete any custom .asoundrc file.

I have the same audio codec so this could help you.

thx for the hints man. will try that. i thought enabling "downmix to 2 channel" would totally disable ac3 and dts etc.? Sounded to me like an option for people without ac3/dts receiver that are trying to play 5.1 content on 2 channel speakers ... so that's not the case? my 5.1 digital content will still play fine?

boba
Reply
#10
boba23 Wrote:thx for the hints man. will try that. i thought enabling "downmix to 2 channel" would totally disable ac3 and dts etc.? Sounded to me like an option for people without ac3/dts receiver that are trying to play 5.1 content on 2 channel speakers ... so that's not the case? my 5.1 digital content will still play fine?
boba

Yes of course ac3 and dts will play with passthrough. You can enable/disable them separately. The downmix option really is a little bit misleading but it is only for non-passthru material which are decoded to multichannel lpcm signal (like aac, multichannel flac etc) . That can not be played with spdif connection. So whoever has spdif connection he must turn the downmix on, unless gets error from alsa.

I suggest renaming this option in xbmc because i see a lot of people runnig into this problem.
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
Reply
#11
I've created a ticket as I didn't want this situation to get lost on the forums:

http://trac.xbmc.org/ticket/7404

Hopefully it includes enough information for the devs to get the idea. Please feel free to add if I left anything out.
Reply
#12
I have this same problem, gui sounds work but nothin else. i'm using alsa and analog audio output.

My configuration is
Linux debian lenny 2.6.26-2-686
aplay: version 1.0.16 by Jaroslav Kysela <[email protected]>
card 0: CK8 [NVidia CK8], device 0: Intel ICH [NVidia CK8]


xbmc is configured with --disable-pulse.
I figured that xbmc keeps starting dbus-daemon processes and it takes over the soundcard, when i kill dbus-daemons i get my sound back. I asked #debian.fi for help and they sad it's xbmc's problem. My workaround is to uninstall dbus and dbus-x11.

dbus processes like that: /usr/bin/dbus-daemon --fork --print-pid 11 --print-address 25 --session

weird is when i have dbus installed and i have mplayer playing music background, xbmc works without problems.

xbmc.log http://pastebin.com/m23a9e438


Now that i read this thread again, it's not the same problem :|
Reply
#13
I thought I had it, but, at the lest step...

xbmc@XBMCLive:~$ /usr/bin/amixer -q -c 0 sset 'IEC958',0 unmute && /usr/bin/amixer -q -c 0 sset 'IEC958',1 unmute
amixer: Unable to find simple control 'IEC958',1

xbmc@XBMCLive:~$ /usr/bin/amixer -q -c 0 sset 'IEC958 Default PCM',0 unmute
amixer: Unable to find simple control 'IEC958 Default PCM',0

I'm 99% sure i had the IEC958 device showing in my mixer before I did the steps.

I fail the speaker test at this time. The simple L and R test works, but, the 6 channel does not output anything.

Any thoughts? This is an Acer Aspire 1600.

Thanks!

--Rod
Reply
#14
I know this is an old thread so it may have been solved. I found it because I'm having the same problem. I just changed Audio output to Analog in settings and DVD audio now works ok.
Reply
#15
The analogue audio wasn't working for me. I am only using the optical out to a receiver. I removed the pulseaudio package and in the xbmc configuration menu, I set both audio and passthrough output to iec958. Navigation sound doesn't work but working for all videos.
Reply

Logout Mark Read Team Forum Stats Members Help
Sporadic audio problems - failed to initialize audio device0