[LINUX] HOW-TO get Digital Audio Pass-Through Output working on Linux with XBMC

  Thread Rating:
  • 2 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
xbmcuser01 Offline
Senior Member
Posts: 150
Joined: Jun 2009
Reputation: 0
Location: The Netherlands
Thumbs Up  [LINUX] HOW-TO get Digital Audio Pass-Through Output working on Linux with XBMC
Post: #1
[additional tags: IEC9958, DD 5.1, pas through, passtru, Dolby Surround]

I see that a lot of people have trouble getting digital audio pass through to a Doly Digital/DTS capable amplifier/receiver via s/pdif (Sony/Philips digital interface) working in XBMC. I had these troubles too. Mostly because Pulseaudio does not support passtru (what a piece of crap!). I had to give the same advise over and over again so I thought: "I'll write my tips 'n' hints in one post to refer to each time.". Well, this is it. Wink Beware: I'm no developer and no expert what so ever! This post will contain errors and mistakes and it's not guaranteed that it will solve your specific probelem.


1. To get digital audio pass through from a computer running Linux and XBMC
  1. Remove PulseAudio (PA)! Example for Ubuntu 10.04 The Lucid Lynx LTS (use copy/paste):
    Code:
    sudo apt-get purge pulseaudio gstreamer0.10-pulseaudio
    sudo apt-get autoremove
    sudo apt-get install alsa-base alsa-tools alsa-tools-gui alsa-utils alsa-oss linux-sound-base alsamixergui
    sudo apt-get install esound esound-clients esound-common libesd-alsa0 gnome-alsamixer
    Optional additional actions to be taken to really remove PA:
    • run gstreamer-properties in terminal and defaults to alsa
    • remove gstreamer0.10-pulseaudio to get sound in totem
    • (gnome-)alsamixer is for changing the volume
  2. Start gome-alsamixer or simply alsamixer from the command line (optionally: install it first). Make sure 'IEC958 Output' is set.
  3. In XBMC itself "fiddle" a bit with: "Settings --> System --> Audio output". Set 'Audio Device' to: your_soundcard_IEC958 and 'Passthrough Device' to the same. Setting both simply to IEC958 works for me.
  4. Reboot


2. Remarks
  • Geting dig. au. out via HDMI seems to be difficult too. I do not own hdmi hardware so I heve no personal experience w/ that. But it seems to me that drivers for the hdmi part of video cards are still in active development and that it depends on Alsa supporting it. A separate sticky How To about hdmi and dig. au out may be necessary.
  • Some times stereo passtru seems to work out of the box at first but DD or DTS won't. Then do the remove PA thing.
  • About testing if your cables are connected- and drivers are set up correctly. I usally take a simple AVI movie w/ AC3 sound and determine if my receiver decodes the dig. audio stream. I use the following command:
    Code:
    mplayer -afm hwac3 movie_with_ac3_audio.AVI
  • About 44.1 kHz DTS streams: http://forum.xbmc.org/showthread.php?tid=83929. Audio cards that upsample from 44.1 kHz to 48 kHz:
    • Creative SoundBlaster Live
    • Creative Audigy
    • Creative X-Fi
      P.S. About that X-Fi: I read here that it's supported in Alsa 1.0.21 and up. For instance: Ubuntu 10.04 has an alsa version higher than 1.0.21. See Distrowatch.
    Cards/chips that do not upsample (= good):
    • Trust 511 (chip: C-Media CMI8738)
    • The s/pdif dig. out from some audio chips used on motherboards. Example: Asus P4C800 (Intel 875P chipset for processor; dunno 'bout the audio chip)
  • Summary of 44.1 kHz DTS passtru fix/workaround: create a file called /home/my_name/.xbmc/advancedsettings.xml and put the following text in it:
    Code:
    <advancedsettings>
            <audio>
                    <dvdplayerignoredtsinwav>true</dvdplayerignoredtsinwav>
            </audio>
    </advancedsettings>
    then highligt a 44 kHx DTS file in XBMC and press C (or the Win contextmenu key) and choose to play the file w/ the DVDplayer instead of the (default) PAplayer.

3. For XBMC Live users
(pass tru doesn't seem to work as of yet... ) WIP (work in progress). What I tried so far:
  1. Start Live CD > press 'S' > Exit XBMC > log in into Linux w/ username=xbmc and password=xbmc > type: "startx" to start Fluxbox.
  2. Right mouse button > Terminal > alsamixer.
  3. In alsamixer seek for 'IEC958' and activate it w/ the 'M' key if not already activated.
  4. Start xbmc from vthe terminal by typing in: "xbmc". One may switch to full screen w/ the slash (\) key.
  5. In the audio settings screen one may fiddle around w/ settings. But no matter what I try I always get an alsa lib error on the command line after exiting XBMC.
  6. Maybe xbmc and alsa expect some sort of special lingo to be talked to them in the "custom" device setting? Like: "hw:0,2". [edit] Nope! That last one works in my regular xbmc setup (Ubuntu + xbmc) but not in Live. This is getting "pulling my hair out" cazy! It just won't work in xbmc live. I give up for now (19-11-2010).



Good luck! Laugh

P.S. Maybe a moderator can make this sticky if it proves to be useful.
(This post was last modified: 2010-11-20 16:53 by xbmcuser01.)
find quote
aeiah Offline
Junior Member
Posts: 44
Joined: Jan 2010
Reputation: 0
Post: #2
gnome-alsamixer? you may find people on here who aren't very experienced with linux, and also dont have gnome installed (i assume live doesn't have gnome, and people will follow barebones install tutorials wont either)

probably better just to suggest alsamixer, since its cli but still easy to use. gnome-alsamixer will just pull loads of gtk and gnome dependencies down from the interwebs.
find quote
uomiarz Offline
Fan
Posts: 320
Joined: Jan 2008
Reputation: 5
Location: Detroit,MI
Post: #3
xbmcuse01 - thx and here is some additional info:

First thing everybody should do (if problem with audio comes up) is update ALSA. Topic on ubuntu forum explains in details on how to update and test.

http://ubuntuforums.org/showthread.php?p...ost6589810
find quote
xbmcuser01 Offline
Senior Member
Posts: 150
Joined: Jun 2009
Reputation: 0
Location: The Netherlands
Post: #4
aeiah Wrote:gnome-alsamixer? you may find people on here who aren't very experienced with linux, and also dont have gnome installed (i assume live doesn't have gnome, and people will follow barebones install tutorials wont either)

probably better just to suggest alsamixer, since its cli but still easy to use. gnome-alsamixer will just pull loads of gtk and gnome dependencies down from the interwebs.
Indeed, if you don't have Gnome installed then Gnome's version of Alsamixer is too much trouble. I wrote the How To for myself and Ubuntu: standard Gnome you know... Anyway, edited my How To to read: "(gnome-)alsamixer". And there's Alsamixergui etc. Smile

And @Uomiarz: thanks for the advice and the link about updating Alsa!
(This post was last modified: 2010-10-20 19:05 by xbmcuser01.)
find quote
Angi321 Offline
Member
Posts: 61
Joined: Aug 2010
Reputation: 1
Post: #5
Hi xbmcuser01,

By the procedure above, do you still have XBMC sounds effects that come with the skins? Also, is the sound OK when using for example the VLC, without XBMC?
find quote
titanUK Offline
Junior Member
Posts: 2
Joined: Oct 2010
Reputation: 0
Post: #6
Hmm will try this out, I only get navigation and music sounds on XBMC and everytime I play a movie I get audio device failed. Tried everything! Running Full desktop Lucid and XBMC on top on Acer Revo via HDMI.
find quote
xbmcuser01 Offline
Senior Member
Posts: 150
Joined: Jun 2009
Reputation: 0
Location: The Netherlands
Post: #7
Angi321 Wrote:Hi xbmcuser01,

By the procedure above, do you still have XBMC sounds effects that come with the skins? Also, is the sound OK when using for example the VLC, without XBMC?
I'm afraid sound effects are gone this way... Sorry. However, everything that has to do w/ sound of course still works as one still does have all the audio card drivers (= alsa). [not sure about the following part:] The sound daemon running in the background that enables directing sound to multiple appps at the time (= pulse or gstreamer) is no more. Smile
find quote
xbmcuser01 Offline
Senior Member
Posts: 150
Joined: Jun 2009
Reputation: 0
Location: The Netherlands
Post: #8
titanUK Wrote:Hmm will try this out, I only get navigation and music sounds on XBMC and everytime I play a movie I get audio device failed. Tried everything! Running Full desktop Lucid and XBMC on top on Acer Revo via HDMI.
Then you really should try this. I had the exact same prob. you describe.
find quote
Angi321 Offline
Member
Posts: 61
Joined: Aug 2010
Reputation: 1
Post: #9
xbmcuser01 Wrote:I'm afraid sound effects are gone this way... Sorry. However, everything that has to do w/ sound of course still works as one still does have all the audio card drivers (= alsa). [not sure about the following part:] The sound daemon running in the background that enables directing sound to multiple appps at the time (= pulse or gstreamer) is no more. Smile

Then it is a partial fix, XBMC does not work fully and this is not the proper setup. In fact you do not need to purge pulse. If you set it up in sounds to analog output, then XBMC will use Alsa and have the DTS, AC3, etc but not xbmc sounds.

The key here is to use both. I remember that I read a thread where it was a scrip (if I remember correctly) that disabled pulse for a limited time while xbmc was starting and in one point (before reformating the HD) I could make it to work both pulse and also in xbmc. I tried to find this thread and I couldn't find it. What a bugger! Angry
That thread was a good idea to be a sticky.
find quote
xbmcuser01 Offline
Senior Member
Posts: 150
Joined: Jun 2009
Reputation: 0
Location: The Netherlands
Post: #10
Angi321 Wrote:[...] while xbmc was starting and in one point (before reformating the HD) I could make it to work both pulse and also in xbmc.
Confused Xbmc is an application and it does NOT format 'yer hard drive when it starts... I think you mean something else, but what?
find quote
xbmcuser01 Offline
Senior Member
Posts: 150
Joined: Jun 2009
Reputation: 0
Location: The Netherlands
Exclamation   
Post: #11
Added more and more info from several topics. Can a mod change the title that appears in the topic lists (because it contains a typo now)? And, if acceptable, maybe make it sticky?
find quote
ravedog Offline
Junior Member
Posts: 17
Joined: Oct 2010
Reputation: 0
Post: #12
I have this issue ofc and i tried it all here still no sound. I then went for the alsa upgrade script, totaly made the ubuntu hang instead. I think the xbmc live version also uses alsa 1.0.23 and that also hangs my system. so weird.....

After reverting for that script, the usb card isnt found at all anymore. I have a Sweex 7.1 usb card (C-Media CM6206 ). Anyone at all got that chipset to work?

br,

Ravee
find quote
xbmcuser01 Offline
Senior Member
Posts: 150
Joined: Jun 2009
Reputation: 0
Location: The Netherlands
Post: #13
ravedog Wrote:I have a Sweex 7.1 usb card (C-Media CM6206 ). Anyone at all got that chipset to work?
Thats an USB audio card isn't it? Its supposed to work, be it that s/pdif output isn't all that great...
find quote
ravedog Offline
Junior Member
Posts: 17
Joined: Oct 2010
Reputation: 0
Post: #14
Hi mate,

Yeah its an usb card. I only get menu sounds sometimes, and distortion sounds (buzzes).

This is the card: http://www.sweex.com/en/assortiment/soun...ards/SC016

It only shows up in alsamixer when i got the integrated card activated in bios, else it does not show up at all. And when it does it only have a few settings (four sliders).

Thanks in advance,

PS. Thanks for a good guide btw, appreciate it! Ds.

Ravee
(This post was last modified: 2010-10-29 15:02 by ravedog.)
find quote
uomiarz Offline
Fan
Posts: 320
Joined: Jan 2008
Reputation: 5
Location: Detroit,MI
Post: #15
@ravedog

sounds like you have one then more device (ubuntu sees your usb camera as sound device for example) and then every time you reboot ubuntu puts them in a different order so when you issue alsamixer command (which by default pics first device) sometimes it works and sometimes not

Code:
aplay -l

will show you how many devices alsa sees, you should see something like:
card 0 ...
...
card 1 ...
...

so then when you do alsmixer make sure you specify correct sound device

Code:
alsamixer -c 0
for card 0
Code:
alsamixer -c 1
for card 1
etc...

also once you are in alsamixer you can press F6 to see list of cards being recognized

if ubuntu mixes device numbers on bootup every time, then your settings in xbmc will always be wrong (that was my case)
so then you have to force alsa to give same card numbers to given sound devices at bootup
check if this is your case and we can go through forcing how to force alsa correct numbers every bootup
find quote
Post Reply