Kodi Community Forum

Full Version: "failed to initialize the audio device"
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Bear with me here folks, as I know this has been mentioned more than once on this forum.

Background: I had originally experienced this only after playing a file with an unsupported codec (see this thread here). I had thought that this borked my XBMC installation, so I did a full uninstall and reinstall (the only difference is that this time it was with Eden Beta 2). This time, I noticed that the same problem affected me even after a vanilla install (I know that a regular uninstall of XBMC will leave behind settings, etc.; I wiped everything).

Current issue: I searched around and found a few threads pointing to this solution on the XBMC wiki. I tried to follow it to the best of my abilities (Oo), but I have a feeling I screwed something up.

Steps taken: Here's what I know I did right: I know I set the Audio Output Device correctly (case sensitive "plug:dmixer"), and the passthrough audio device is set to ice958 (alsa) The rest, is fuzzy..

I have no idea how to "Open ~/.asoundrc" as the instructions say, so I followed a different (unrelated to XBMC) guide and created a new file with nano ~/.asoundrc.

Running aplay -l gave me this output:

Quote:kymus@HTPC:~$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Generic [HD-Audio Generic], device 3: HDMI 0 [HDMI 0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: Generic_1 [HD-Audio Generic], device 0: ALC892 Analog [ALC892 Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: Generic_1 [HD-Audio Generic], device 1: ALC892 Digital [ALC892 Digital]
Subdevices: 1/1
Subdevice #0: subdevice #0

I have (almost) no idea how to read this, but I guessed that hw:0,1 was correct. I was probably wrong.

I exited and saved the file as asoundrc, rebooted, and..... yep, same issue. Most HD files don't play audio.

I assume I'm close to the solution, but I'm doing something stupid wrong.

FWIW, here's what I'm running:
Ubuntu 11.10 (up to date as of today) (unsure of kernel version)
XBMC Eden (beta 2)
ASUS F1A75-I Deluxe FM1 AMD A75
AMD A8-3850 Llano 2.9GHz Socket FM1 Quad-Core (with DirectX 11 Graphic AMD Radeon HD)
G.SKILL Ripjaws X Series 8GB (2 x 4GB)
Quote:I have (almost) no idea how to read this, but I guessed that hw:0,1 was correct. I was probably wrong.

Your aplay -l output does not have any devices matching hw:0,1 (first digit refers to card and second digit refers too device)

How are you connecting your sound output ? HDMI direct to TV or ?

If you are using HDMI then you would need 0,3 in your .asoundrc. You may also need to change plug:dmixer to plughw:0,3 within xbmc but I'm not certain on this.
Thanks for the input! I will give it a shot, and report back.

now that I've already created an asoundrc file, what is the terminal command I would use to edit it?

edit: I'm using HDMI straight to the TV
Quote:now that I've already created an asoundrc file, what is the terminal command I would use to edit it?

That would be nano ~/.asoundrc (the same way you initially created it Smile
Gah, still nothing.

I changed pcm "hw:0,1" to pcm "hw:0,3" and then tried a movie that I knew doesn't get audio (but should) and got nothing.

I then tried to change plug:dmixer to plughw and tried again with no results.
What do you have in your .asoundrc ?
Here it is:

Quote:pcm.dmixer {
type dmix
ipc_key 1024
slave {
pcm "hw:0,3"
period_time 0
period_size 1024
buffer_size 8192
#periods 128
#rate 44100
rate 48000
}
bindings {
0 0
1 1
}
}
Try this:

Quote:pcm.dmixer {
type dmix
ipc_key 1024
ipc_key_add_uid false
ipc_perm 0660
slave {
pcm "hw:0,3"
rate 48000
channels 2
period_time 0
period_size 1024
buffer_time 0
buffer_size 4096
}
}

pcm.!default {
type plug
slave.pcm "dmixer"
}

Also change sound output device within XBMC settings to:

Quote:plughw:0,3

Then restart and see what happens.
Still nothing :-\

I double checked asoundrc as well as XBMC's audio settings after the reboot to ensure they were as they should be. It goes without saying that I also copy and pasted everything exactly as it was written. >_<
Starting to clutch at straws here, your sound channels are not muted in alsamixer by any chance ?

If not then you could also try this setup,

.asoundrc:

Quote:pcm.hdmi_hw {
type hw
card 0 # <----- Put your card number here
device 3 # <----- Put your device number here
}

pcm.hdmi_formatted {
type plug
slave {
pcm hdmi_hw
rate 48000
channels 2
}
}

pcm.hdmi_complete {
type softvol
slave.pcm hdmi_formatted
control.name hdmi_volume
control.card 0
}

pcm.!default hdmi_complete

Sound output in XBMX to:

Quote:hdmi_complete
I am certain that nothing is muted. I have menu sounds and I just watched a movie through Navi-X.

Stupid question, though: how do I determine card and device #'s?
Quote:kymus@HTPC:~$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Generic [HD-Audio Generic], device 3: HDMI 0 [HDMI 0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: Generic_1 [HD-Audio Generic], device 0: ALC892 Analog [ALC892 Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: Generic_1 [HD-Audio Generic], device 1: ALC892 Digital [ALC892 Digital]
Subdevices: 1/1
Subdevice #0: subdevice #0

Those are the cards and devices.

I'm sorry but this is getting beyond my knowledge really so I have a few questions, maybe someone else can pitch in:

1. Are your ATI graphics drivers up to date ?
2. Where is you .asoundrc located ?
3. Do you have an asound.conf anywhere at all ?
4. You stated that most HD movies have no sound, by this I assume that means some do ? This could be interesting and void the above and everything that has been discussed... Can you provide some logs for ones that work and ones that don't work maybe ?


I'm not sure if all of the above apply with running XBMC over a full blown Ubuntu though.
1) Well, I'm not sure! Ha. I've installed the restricted drivers. There is another option for post-release drivers, and that just doesn't install.

2) /Home/kymus

3) I have no idea; once it gets to system stuff in Linux, I get pretty clueless.

4) So far, I know that some HD TV shows and Anime will work (not all though.. I think the majority do.), but every HD (720p +) movie I've tried (chosen at random) has failed.

As far as I can tell, this problem is the same as the old problem I had (here). I thought previously that it was an unsupported codec that broke XBMC, but now that I think about it, it's possible that previously this problem was present and I just managed to choose the things that played right.. Then again, after I got the error before, I got no audio and switching from ALSA to Pulse Audio fixed it for some things (as described).

Also, for whatever it's worth, I have no idea how to fully purge XBMC (since some settings and such are left behind), so after "breaking" XBMC, I actually did a complete format and reinstall of Ubuntu (>_<).

I posted a debug log for the previous problem (here) which I think largely mirrors this issue. But if needed, I can do it again with the experimental audio options enabled.
OK, really stupid question.. try not to strangle me (or shoot yourself)....

am I doing:

card 0
device 3
card 1
device 0
card 1
device 1

I have the feeling that this is wrong, but like I said, I'm a little stupid once it gets to system stuff in Linux.

Care to spell it out for me?
Your using HDMI so on yours that would be card 0 device 3.

Do you have dolby AC3 capable and also DTS capable receive checked in audio settings ?

I also noticed this in your log:

Quote:10:15:57 T:2691091312 DEBUG: Initialize - using alsa device iec958:AES0=0x6,AES1=0x82,AES2=0x0,AES3=0x2
10:15:57 T:2691091312 ERROR: Initialize - failed to open custom device iec958:AES0=0x6,AES1=0x82,AES2=0x0,AES3=0x2 (error:No such file or directory), retry with default iec958
10:15:57 T:2691091312 ERROR: Initialize - pcm_open_lconf, alsa error: -2 - No such file or directory
10:15:57 T:2691091312 DEBUG: SetActiveDevice - SetActiveDevice from 2 to 1
10:15:57 T:2691091312 DEBUG: RemoveActiveDevice - Removing device 2
10:15:57 T:2691091312 DEBUG: CGUIAudioManager::Initialize
10:15:57 T:3044693760 DEBUG: ------ Window Init (VideoFullScreen.xml) ------
10:15:57 T:3044693760 INFO: Loading skin file: VideoFullScreen.xml
10:15:57 T:2691091312 ERROR: Creating a Null Audio Renderer, Check your audio settings as this should not happen

I'm not sure exactly how this works but it may be best if you could find a video that plays sound, play that, stop it, then play a one that doesn't play sound, stop that and exit xbmc. Then post the log to compare. Make sure debug logging is enabled first.
Pages: 1 2