Kodi Community Forum

Full Version: SPDIF not working
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello
I've searched all internet, and XBMC forum and haven't find a solution, and is very annoying after dharma release.

My hardware
* Asus P5B Deluxe with integrated audio AD198x
* Ati radeon 3600HD with hdmi audio output
* Lcd with hdmi input audio/video
* Av receiver 5.1 with coaxial input capable of DTS and AC3 decoding


My software
Now, Dharma beta3 + Ubuntu Lucid fresh install

To put things in order:
1) I have sound in my av receiver from VLC through SPDIF via coaxial (DTS, AC3, AAC MP3 etc).

2) I have sound in my LCD tv through HDMI (from ATI videocard) from VLC.


3) I have sound in my LCD tv through HDMI (from ATI videocard) from XBMC.

4) NO SOUND in my av receiver from XBMC through SPDIF via coaxial (DTS, AC3, AAC MP3 etc). Tried all combinations in audio settings for Optical/coaxial output downmix to 2.0, to 5.1, through iec958, custom iec958, HDA Intel.............. etc etc but always the same message: "Failed to initialize audio device"

Angry Angry Angry

here is my "aplay -l"

Code:
**** List of PLAYBACK Hardware Devices ****
card 0: Intel [HDA Intel], device 0: AD198x Analog [AD198x Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: Intel [HDA Intel], device 1: AD198x Digital [AD198x Digital]
  Subdevices: 0/1
  Subdevice #0: subdevice #0
card 1: HDMI [HDA ATI HDMI], device 3: ATI HDMI [ATI HDMI]
  Subdevices: 1/1
  Subdevice #0: subdevice #0


aplay -L

Code:
pulse
    Playback/recording through the PulseAudio sound server
front:CARD=Intel,DEV=0
    HDA Intel, AD198x Analog
    Front speakers
surround40:CARD=Intel,DEV=0
    HDA Intel, AD198x Analog
    4.0 Surround output to Front and Rear speakers
surround41:CARD=Intel,DEV=0
    HDA Intel, AD198x Analog
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=Intel,DEV=0
    HDA Intel, AD198x Analog
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=Intel,DEV=0
    HDA Intel, AD198x Analog
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=Intel,DEV=0
    HDA Intel, AD198x Analog
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=Intel,DEV=0
    HDA Intel, AD198x Digital
    IEC958 (S/PDIF) Digital Audio Output
hdmi:CARD=HDMI
    HDA ATI HDMI, ATI HDMI
    HDMI Audio Output

I'm not such a good interpreter of debug log but here lays an error:

Code:
15:35:54 T:2849614704 M:2613485568   DEBUG: CDVDPlayer::HandleMessages - player started 2
15:35:54 T:2794912624 M:2613485568  NOTICE: Creating audio device with codec id: 86020, channels: 2, sample rate: 48000, pass-through
15:35:54 T:2794912624 M:2613485568    INFO: AudioRendererFactory:  not a explicit device, trying to autodetect.
15:35:54 T:2794912624 M:2613485568   DEBUG: RemoveActiveDevice - Removing device 1
15:35:56 T:3045324656 M:2612695040   DEBUG: CAnnouncementManager - Announcement: PlaybackStarted from xbmc
15:35:56 T:2794912624 M:2612695040   DEBUG: SetActiveDevice - SetActiveDevice from 0 to 2
15:35:56 T:2794912624 M:2612695040   DEBUG: RemoveActiveDevice - Removing device 0
15:35:56 T:2794912624 M:2612695040 WARNING: PulseAudio: Does not support passthrough
15:35:56 T:2794912624 M:2612695040   DEBUG: SetActiveDevice - SetActiveDevice from 2 to 1
15:35:56 T:2794912624 M:2612543488   DEBUG: RemoveActiveDevice - Removing device 2
15:35:56 T:2794912624 M:2612088832   DEBUG: CGUIAudioManager::Initialize
15:35:56 T:2794912624 M:2610946048   DEBUG: RemoveActiveDevice - Removing device 1
15:35:56 T:2794912624 M:2610946048   DEBUG: CGUIAudioManager::DeInitialize
15:35:56 T:2794912624 M:2610946048   DEBUG: SetActiveDevice - SetActiveDevice from 0 to 2
15:35:56 T:2794912624 M:2610946048   DEBUG: RemoveActiveDevice - Removing device 0
15:35:56 T:2794912624 M:2610946048   DEBUG: Initialize - using alsa device iec958:AES0=0x6,AES1=0x82,AES2=0x0,AES3=0x2
15:35:56 T:2794912624 M:2610946048   ERROR: Initialize - device iec958:AES0=0x6,AES1=0x82,AES2=0x0,AES3=0x2 busy retrying...
15:35:56 T:3045324656 M:2608279552  NOTICE: Using GL_TEXTURE_2D
15:35:56 T:3045324656 M:2608279552   DEBUG: GL: Requested render method: 2
15:35:56 T:3045324656 M:2608279552   DEBUG: GL: BaseYUV2RGBGLSLShader: defines:
                                            #define XBMC_texture_rectangle 0
                                            #define XBMC_texture_rectangle_hack 0
                                            #define XBMC_STRETCH 0
                                            #define XBMC_YV12




/etc/asound.conf
Code:
pcm.!hdmi-remap {

type asym

playback.pcm {

type plug

slave.pcm "remap-surround71"

}

}



pcm.!remap-surround71 {

  type route

  slave.pcm "hw:0,3"

  ttable {

    0.0= 1

    1.1= 1

    2.4= 1

    3.5= 1

    4.2= 1

    5.3= 1

    6.6= 1

    7.7= 1

  }

}

What I have to do to make it work HuhHuh
Code:
sudo apt-get purge pulseaudio

This solved my problem
This are my Audio settings

Image

Unfortunately "navigation sounds" didn't work !

Is there a remedy for that ?

Thank you!
I got the same problem:

Code:
eric@Moon:/etc$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: NVidia [HDA NVidia], device 0: ALC662 rev1 Analog [ALC662 rev1 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: NVidia [HDA NVidia], device 1: ALC662 rev1 Digital [ALC662 rev1 Digital]
  Subdevices: 0/1
  Subdevice #0: subdevice #0
card 0: NVidia [HDA NVidia], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

Code:
00:35:50 T:2943351664 M:2408722432   ERROR: Initialize - failed to open custom device plughw:0,1:AES0=0x6,AES1=0x82,AES2=0x0,AES3=0x2 (error:No such file or directory), retry with default plughw:0,1
00:35:50 T:2943351664 M:2408722432   ERROR: Initialize - pcm_open_lconf, alsa error: -16 - Device or resource busy

I've also tried it with iec958 but nothing is working.

When i do this:
Code:
eric@Moon:~$ sudo /sbin/alsa-utils restart
* Shutting down ALSA...                                                                          [ OK ]
* Setting up ALSA...                                                                            
* warning: 'alsactl restore' failed with error message 'alsactl: set_control:1389: Cannot write control '2:0:0:IEC958 Playback Default:0' : Operation not permitted
alsactl: set_control:1389: Cannot write control '2:0:0:IEC958 Playback Switch:0' : Operation not permitted'...                                                                                          
amixer: Invalid command!
amixer: Invalid command!
   ...done.
Have you tried this:
Code:
sudo apt-get purge pulseaudio

and a reboot?

also do you have this in alsa mixer?

Code:
pricinosus@pricinosus-60:~$alsamixer
Image
Indeed, the only way I could get rid of this problem is to get rid of that dreaded, wretched PulseAudio. In the past I've fixed many a sound problem this way. Dunno why PA still exists. Sad
pricinosus Wrote:This are my Audio settings

Image

Unfortunately "navigation sounds" didn't work !

Is there a remedy for that ?

Thank you!

This is my ~/.asoundrc
Code:
pcm.!default {
type plug
slave {
pcm "iec958"
}
}
Change "Audio output device" to Default.
xbmcuser01 Wrote:Indeed, the only way I could get rid of this problem is to get rid of that dreaded, wretched PulseAudio. In the past I've fixed many a sound problem this way. Dunno why PA still exists. Sad

Big Grin

This is my question, too. Why pulseaudio stil exist? That is dedicated to Linux.

But I have another question, for XBMC developers:

Why VLC can use spdif and XBMC doesn't, even if alsa and pulse are installed? Eek
Why is so complicated for us, linux/xbmc users, to make sound working in XBMC?

This are the big questions Nerd
I have a very similar problem -- Dharma 3 beta installs I get navigation sounds via. TOSLINK (I assume but is it possible this is coming via. my Nvidia HDMI?) but AC3/DTS no sound.

The odd thing is if I install 9.11 and do the apt-get upgrades to the latest SVN sound works perfect. Whatever is going on is specific to this LIVE image as I have had the same issue with all of the Dharma beta's.

Also to note I tried to remove pulse-audio and it says that its not installed.
Thank you BurningSky, I will try that, but after I'll install fresh ubuntu and xbmc.
pfriederichs Wrote:I have a very similar problem -- Dharma 3 beta installs I get navigation sounds via. TOSLINK (I assume but is it possible this is coming via. my Nvidia HDMI?) but AC3/DTS no sound.

The odd thing is if I install 9.11 and do the apt-get upgrades to the latest SVN sound works perfect. Whatever is going on is specific to this LIVE image as I have had the same issue with all of the Dharma beta's.

Also to note I tried to remove pulse-audio and it says that its not installed.
I too got the navigation sounds and sound if the move was in stereo. However, AC3/DTS passthrough didn't work.

1. Open (gnome-)alsamixer to make sure IEC958 (= yet another name for digital passtru) is activated.

2. Since you do not have PA, I don't know what else to set. Maybe fiddle a little bit w/ XBMC's settings as indicated in BurningSky's reply above...

Good luck! Smile

P.S. Is Dharma Beta 3 the same version as SNV? My SVN xbmc says it's version pre-10.5.
I just find it really odd up until these Dharma Beta Live releases I have never had issues with sound on my current setup.

Before I even came here I checked alsamixer and my optical outputs are set to "00" unmuted.

I am by no means a Linux guru but doing a "ls -al" in ~ shows among other things.


drwx------ 2 xbmc xbmc 4096 2010-10-17 14:27 .pulse
-rw------- 1 xbmc xbmc 256 2010-10-17 14:27 .pulse-cookie

Are these references to pulseaudio?

Reason I ask is "sudo apt-get purge pulseaudio" says that the pulseaudio package is not installed.

Also worth noting I am able to re-produce the toslink static out that is posted in another thread here if I switch to an alternate IEC958 output.

I had read some comments earlier that possibly this was kernel related but I dont know if all 3 Dharma betas are using the same Linux kernel or not.

As I said I am by no means a Linux expert I know enough to be dangerous and to sometimes fix problems if I tinker long enough. I love the Linux setup way more then the Windows version -- it is much much more appliance like and I really dont want to have to go down that route in the future. Any input or progress on this would be highly appreciated if posted.
I have no experience w/ Xbmc Live (is it a live CD to run on your PC or Xbox?). Can you run Synaptic in it to check if you have anything pulseaudio and remove it? Maybe mplayer is installed by default on Xbmc Live. Try (in a terminal):
Code:
mplayer -afm hwac3 moviename.avi
Preferably a movie w/ 5.1 sound. That should pass the AC3 stream directly to your receiver. If it don't work, try it w/ a stereo movie. Try to "probe" your receiver.

P.S. Did you know that you can install Linux (and thus XBMC) next to almost any other operating system? And that Linux can read from (and write to-) Windows' NTFS file system? However, don't try to install any operating system (Win or Lin) before making a good backup!
Sorry for reviving this old thread...

But I want all the thanks, in the Universe, goes to XBMC team, for the totally rewritten code in audio section.
The solution to this problem is installing newest shiny piece of XBMC from nightly builds and you will have the sound that you looking for years.
Not only through SPDIF but with all audio devices that you have on your machine. Simple and lightning fast!!!
Thank you XBMC devs!!!!

So this thread can be marked as solved or moved to archive

RESPECT