Linux S/PDIF help - no sound when playing video
#1
I'm a relative linux rookie; any help would be greatly appreciated. I previously had it running fine with Windows 7, but switched to linux to try it out. I would like to only use the the fiber optic audio output (spdif?).

I have a Jetway mini-top, and have been having various problems. At first I had XBMCbuntu installed, but I couldn't get the resolution to fit the screen, so I switched to a Ubuntu 12.10 install. I installed XBMC with the following from the wiki:
Code:
sudo apt-get install python-software-properties pkg-config
sudo add-apt-repository ppa:team-xbmc
sudo apt-get update
sudo apt-get install xbmc xbmc-standalone
sudo apt-get update

The resolution works out of the box with ubuntu which I was quite pleased about. As mentioned, the sound doesn't work and I have search/tried pretty much everything I have found on the forums. Here are some of the details:

sudo aplay -l
Code:
card 0: NVidia [HDA NVidia], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: NVidia [HDA NVidia], device 7: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: NVidia [HDA NVidia], device 8: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: NVidia [HDA NVidia], device 9: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: Device [USB PnP Sound Device], device 0: USB Audio [USB Audio]
  Subdevices: 0/1
  Subdevice #0: subdevice #0

I didn't see anything related to SPDIF using -l, so I tried -L. Here is the only relevant SPDIF from aplay -L:
Code:
iec958:CARD=Device,DEV=0
    USB PnP Sound Device, USB Audio
    IEC958 (S/PDIF) Digital Audio Output

I tried all sorts of combinations in XBMC, including setting the audio and passthrough to:
Code:
audio output device:Custom plughw:1,0
passthrough audio device:  Custom hw:1,0

I also tried adding the following to .asoundrc, but I'm not sure what to put in XBMC settings:
Code:
pcm.dmixer {
    type dmix
    ipc_key 1024
    slave {
        pcm "hw:1,0"
        period_time 0
        period_size 1024
        buffer_size 8192
        #periods 128
        #rate 44100
        rate 48000
     }
     bindings {
        0 0
        1 1
     }
}



The sound actually works in the menu, and it also works when I turn off the dts and dolby digital capable options.

Additionally, I have looked into 'alsamixer'. When I run alsamixer, I get the following:
Image

I played around with the F6, and when I change it to the USB PnP device ( which I don't believe I should be using), I get this:
Image
Image

I believe I have the latest XBMC installed, and I am at the point where I don't know what else I should do to get the audio working like I had it in Windows. Any suggestions?
Reply
#2
bump
Reply
#3
The only help I can give is to test some devices via command line:

Code:
speaker-test -Dplguhw:x,y

"x" stands for the card
"y" stands for the device

If a device works, it will give you a pink noise So you can play around with the devices and figure out which one works without editing any files.

Hope this will help a bit.

Cheers
Reply
#4
Thanks a lot for the reply!

speaker-test -Dplguhw:1,0
Code:
speaker-test 1.0.25

Playback device is plguhw:1,0
Stream parameters are 48000Hz, S16_LE, 1 channels
Using 16 octaves of pink noise
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM plguhw:1,0
Playback open error: -2,No such file or directory

I tried with 0,3 - 0,7 - 0,8 - 0,9 - 1,0, and I get the same result everytime
Reply
#5
I updated my .asoundrc to (per http://forum.xbmc.org/showthread.php?tid...inux+spdif):

Code:
pcm.hdmi03 {
    type hw
    card 0
    device 3
}
pcm.!default hdmi03

pcm.dmixer {
        type dmix
        ipc_key 1024
        ipc_key_add_uid false
        ipc_perm 0660
        slave {
                pcm "hw:1,0"
                rate 48000
                channels 6
                period_time 0
                period_size 1024
                buffer_time 0
                buffer_size 4096
        }
}
pcm.!default {
type plug
slave.pcm "dmixer"
}
pcm:iec958 hdmi:NVidia

When I do speaker-test -c 6 -r 48000, I get the test sound.

In XBMC for the audio setup, I have the following currently set:
- Audio Output: Optical/Coax
- Speaker Configuration: 5.1
- AC3 capable receiver: Check
- DTS capable receiver: Check
- Audio Output device: USB PnP Sound Device - iec958 - 0 (Alsa)
- Passthrough output device: USB PnP Sound Device - iec958 - 0 (Alsa)

The sound works if I have the AC3 and DTS configurations not checked, so basically stereo. When checked, I get the "Failed to initialize audio device".

Any help would be greatly appreciated as I currently do not know where to go from here...
Reply
#6
I'm sorry...but there is a type error....

the correct command have to look like this:

speaker-test -Dplughw:x,y

the "u" and the "g" were switched....sorry


try it again with this Wink

Reply
#7
David,
Thanks. I get sound using that command when I execute the following:
speaker-test -Dplughw:1,0

Or in other words, card 1 device 0. I'm not sure where to go from here though.

I tried the following settings in XBMC, and I get nothing (unless I un-check the DTS/AC3 capable settings in XBMC):
Code:
audio output device:Custom plughw:1,0
passthrough audio device:  Custom hw:1,0
Reply
#8
if you found a device which works you can use/set a custom audio device in xbmc. but I don't know for sure how it has to look like. for this Google or the forum search might help you.

Only one thing....if you're using xbmc frodo there is no option to set a custom audio device. for this the users "universal" and/or "negge" are able to give you more support.
oh...you were faster than me....Wink

cause I'm typing from my smartphone. Big Grin

to what is your xbmc plugged to? To a TV or a dts and dd capable amp?

if it is plugged to a TVs, the ac3 and the dts options hve to be unchecked, if I recall correct.

Reply
#9
(2013-01-01, 23:23)David1977 Wrote: Only one thing....if you're using xbmc frodo there is no option to set a custom audio device

Thank you VERY much. That comment made me wonder why I had the custom audio device, since I assumed I had the latest and greatest. The initial install was done from the ppa:team-xbmc repository.

A quick search lead me to find out that I should instead use 'ppa:team-xbmc/unstable'...

Code:
sudo add-apt-repository ppa:team-xbmc/unstable
sudo apt-get update
sudo apt-get install xbmc

It all works now, now that I am actually using 'Frodo' Smile.
Reply
#10
fine I'm glad that I could help you

and if you want...you can give me a +1 reputation Wink
Reply

Logout Mark Read Team Forum Stats Members Help
S/PDIF help - no sound when playing video0