Can't manage to get proper digital output, please help!
#1
I've been having issues with xbmclive for a while now. I noticed a new version posted, so I decided to give it a try and hopefully, some (gasp, all?) of the issues would be resolved, but unfortunately, this wasn't the case.

This thread, one of many I've found trying to address this issue seemed to be dancing around a correct resolution, but to no avail. I'll try to describe my setup and my problem.

I've got a standard PC in my livingroom that I've scrounged together. It's a fairly standard machine with a Sound Blaster X-Fi (I believe it's the "xtrememusic" variant) with the front panel live drive that is blessed with optical I/O connectors. The optical output on the live drive is connected to an optical input on my Yamaha 7.1 channel reciever, which is capable of everything from plain jane 2 channel up to the pretty spiffy Dolby Digital Ex II.

Now, in Windows, if I play a video (in any program) having set the sound card output to "digital" I can play a video encoded with AC3 and the front panel of the receiver lights up in big, beautiful golden letters "DOLBY DIGITAL" and all the proper audio goes to all the right speakers.

Here's my problem.

I'd really love to get XBMC live cd running on this machine. It's lightweight, fast, looks great on my screen and has all the features I'd like to have in the living room, but so far, every build I've tried will not let me send any kind of encoded output to the receiver. I'm able to get sound, but it's always either 2 channel, or with the receiver set to surround, fake pro-logic. Despite all my best efforts, I'm unable to get any video to light up the front of the receiver with the coveted "DOLBY DIGITAL".

I've tried the stock XBMC from XBMC.org. I've tried the beta versions. I've tried the XBMC Freak version. I've tried the fixes that involved updating the x-fi driver (a disaster that required reinstalling xbmc) I've tried the fixes that involve wget some_new_alsa_config.conf, to change the channel mapping. I tried some other fix that had me specifying a custom output string in XBMC (this worked, however I could only get the left front speaker to make noise edit: It's a skipping static noise, just like when you feed too high of a bitrate digital signal to an old D/A converter).

I can not get it to work properly. Has anyone out there been able to get a properly functioning SPDIF output to an external decoder?

Is there a different build? Maybe one specifically for X-FI users with external decoders? Is there some kind of dummy output device driver available that will just dump un-decoded sound to the spdif connector and let the receiver do all the work?

Edit 2:
Fired up the old Xbox with it's antique version of XBMC and it works perfectly.
Downloaded XBMC for windows (my other drive in this machine has win7 on it) and it works perfectly.

Can ALSA just not send passthrough audio?
Reply
#2
Bumpy. Does anyone even have a guess? I hope someone can say there's just some boneheaded simple alsa config or something I can use to get it to pass unadulterated spdif signals.
Reply
#3
One more bump.
Reply
#4
1. Do you use Ubuntu? It seems to have issues w/ dig. passtru.
2. Does dig. passtru work in other Linux apps?

Try activating dig. out in gnome-alsamixer.
Reply
#5
xbmcuser01 Wrote:1. Do you use Ubuntu? It seems to have issues w/ dig. passtru.
2. Does dig. passtru work in other Linux apps?

Try activating dig. out in gnome-alsamixer.

Thanks for the reply!

It's the xbmclive that I'm trying to get to work.

I spent a bit more time with it this morning. Tried a few different sound cards that I have laying around, even the one built into the mainboard. They all exhibit the same strange behavior.

2 channel audio plays just fine. My reciever is lit up [PCM] and the 2 speaker icons [L] and [R]. If I start a video, however with an AC-3 soundtrack or one of the Dolby Digital demo videos, all the icons shut off and the output goes dark. When I stop the video, they light back up again.

Now if I boot Windows (using xbmc or vlc or any app, really) when the same video is played, [PCM] stays lit, and in addition, I get

[L] [C] [R]
[SL] [SR]

icons lit, indicating it's receiving a stream with all the channels, just as you'd expect.

To achieve this behavior in windows, I open the Sound Blaster configuration app and choose the option "DTS/DD Bitstream out (note: external decoder required)" and I guess what I'm looking for is the ability to do this in alsa.

I found this page http://www.johannes-bauer.com/linux/dolby/?menuid=3 which indicates that a command line switch can be passed to mplayer to get it to do it.

mplayer -ac hwac3 dolbycanyon.vob

Like so. Scroll down and read "Third Step: The Dolby Digital Experience" and you'll understand what I'm trying to achieve.
Reply
#6
UPDATE:

From a terminal window on another computer, I did sudo apt-get install mplayer and then mplayer -ac hwac3 dolbycanyon.vob and lo-n-behold all my speakers lit up and it played. XBMC's screen was a little garbled, probably because mplayer was playing in the background, but it worked.

So community...how do I tell xbmc that I want "-ac hwac3,hwdts," switch applied to every video?
Reply
#7
Second update:

I did a little more digging around yesterday and it seems there is some kind of way that I can replace the media player in xbmc with mplayer, though I don't know why on the green earth the default player included would be one that has issues sending passthrough multichannel information...I mean...media center pc hooked to home theater system can't be that uncommon of a configuration, can it? Or are people just satisfied with letting it output 2 channels and having their receivers fake matrix everything? Anyway.

I checked the wiki and read several things, but I can't find any clear instructions specific to xbmclive on how to go about taking out whichever player is in there and replacing it with mplayer.

The wiki states two different files and two different methods, and only seems to have windows-specific examples of the xml files that need to be created / modified.

Could someone point me in the right direction? I'm running out of search terms.
Reply
#8
DoctorDyna Wrote:Could someone point me in the right direction? I'm running out of search terms.

Not sure if you tried that already but I got digital passthrough mode working in Dharma Beta2 by just setting the correct audio devices in System->System->Audio Hardware. To make sure XBMC uses the hardware directly you should deinstall pulseaudio and add the xbmc user to the group "audio". This way XBMC has direct access to the audio hardware using ALSA.

In the Audio-Hardware settings of XBMC you have to select the kind of output (HDMI/analog/digital) and in the lower section of the screen the correct device for passthrough data. Also make sure that you ticked the checkboxes for AC3 and DTS. You can use "aplay -l" on the console to find the correct device for digital output.

You can check if passthrough mode is active by playing a video file with DTS/AC3 sound. While playing try to use the volume controls. If passthrough mode is active a message will popup in the upper right corner.
Reply
#9
Temar Wrote:Not sure if you tried that already but I got digital passthrough mode working in Dharma Beta2 by just setting the correct audio devices in System->System->Audio Hardware. To make sure XBMC uses the hardware directly you should deinstall pulseaudio and add the xbmc user to the group "audio". This way XBMC has direct access to the audio hardware using ALSA.

I will give this a shot. I didn't know pulseaudio was installed, this might be the cure.
Reply
#10
Code:
Package pulseaudio is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
xbmc@(none):~$


xbmc@(none):~$ sudo usermod -g audio xbmc

xbmc@(none):~$ grep ^audio /etc/group
audio:x:29:xbmc

Any other suggestions? ><
Reply
#11
DoctorDyna Wrote:xbmc@(none):~$ sudo usermod -g audio xbmc

You changed the initial group of your xbmc user. That is not a good idea. The correct command is:

Code:
sudo usermod -a -G audio xbmc

You should change the initial group back to its previous value which is probably "xbmc".


Quote:Any other suggestions? ><

I remember one other thing. Passthrough didn't work for me at first, too. I had to unmute the digital output device in alsamixer. Use "aplay -l" to check the name of the digital sound device and then press F6 within alsamixer to select that sound device. Unmute all channels.

EDIT:
Does XBMC at least try to passthrough? What happens if you try to increase or decrease the volume while playing a DTS movie? Does XBMC display a message that passthrough mode is active?
Reply
#12
Temar Wrote:You changed the initial group of your xbmc user. That is not a good idea. The correct command is:

Code:
sudo usermod -a -G audio xbmc

You should change the initial group back to its previous value which is probably "xbmc".

Whoa, thanks. Changed it around.

Temar Wrote:I remember one other thing. Passthrough didn't work for me at first, too. I had to unmute the digital output device in alsamixer. Use "aplay -l" to check the name of the digital sound device and then press F6 within alsamixer to select that sound device. Unmute all channels.

EDIT:
Does XBMC at least try to passthrough? What happens if you try to increase or decrease the volume while playing a DTS movie? Does XBMC display a message that passthrough mode is active?

I popped open alsamixer and double checked, I think everything is in order, it's all green icon "OO".

When I play a movie, it does say "passthrough device active" if I mess with the volume. It still has the bizarre thing it does when the movie starts though, the lights on the front of my receiver that indicate [PCM] (and the speaker icons) shut off when I start the movie and then come back on when it's stopped. It does exactly the same thing as if I had physically pulled out the optical cable.

Edit: One more thing, I'm not sure if this is of any consequence, but aplay -l shows only one "IEC958" as device 4, with 1 2 and 3 all the analog outs for various speakers....but when I look in alsamixer, it shows a "digit-IO" which has no volume control (the one I'm assuming is device 4) and then it also has "S/PDIF-IN" and "S/PDIF-OUT" which I'm assuming are the fiber in/out on the live drive (the fiber I use).

Perhaps whatever is making those optical connectors invisible to aplay is making them act goofy in xbmc?
Reply
#13
DoctorDyna Wrote:I popped open alsamixer and double checked, I think everything is in order, it's all green icon "OO".

Did you also press F6 and select each soundcard to unmute all output channels of each device?

Quote:When I play a movie, it does say "passthrough device active" if I mess with the volume. It still has the bizarre thing it does when the movie starts though, the lights on the front of my receiver that indicate [PCM] (and the speaker icons) shut off when I start the movie and then come back on when it's stopped. It does exactly the same thing as if I had physically pulled out the optical cable.

That looks like XBMC is sending its output to a different sound device.

Quote:Edit: One more thing, I'm not sure if this is of any consequence, but aplay -l shows only one "IEC958" as device 4, with 1 2 and 3 all the analog outs for various speakers....

I would guess that IEC958 is the digital output of your MAINBOARD sound card, not the soundblaster. If your mainboard has a digital output you should see it as a seperate device. My output looks like this:

Code:
card 0: SB [HDA ATI SB], device 0: ALC889A Analog [ALC889A Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: SB [HDA ATI SB], device 1: ALC889A Digital [ALC889A Digital]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: HDMI [HDA ATI HDMI], device 3: ATI HDMI [ATI HDMI]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

So if you only see some analog devices and one digital device, it is probably your mainboard soundcard.


Quote:Perhaps whatever is making those optical connectors invisible to aplay is making them act goofy in xbmc?

It really looks like XBMC is sending its output to the wrong device. That would explain why your receiver shuts down. So double check your XBMC audio-hardware settings (System->System->Audio). Also I would start with a simple configuration by using the digital output of your onboard soundcard. Most onboard sound chips are properly supported by ALSA and should work out of the box.

EDIT:
As you are able to control the volume while playing a movie (at least you don't get the "passthrough mode" message), it looks like XBMC is either using an analog output device or it is trying to downmix the audio. Whatever it is, it really looks like your XBMC audio-settings are wrong.
Reply
#14
Thanks for taking the time to help me out here, it's much appreciated!

I do get the "passthrough mode active" complaint when I try to fuss with the volume control while playing dolbycanyon.vob.

You are correct, my mainboard does have onboard audio, and it does have a coaxial digital output, however it's disabled in the bios.

The aplay -L lists
Code:
iec958:CARD=XFi,DEV=0
    Creative X-Fi, IEC958 Non-audio
    IEC958 (S/PDIF) Digital Audio Output
Which is the headphone jack style connector on the back of the sound card.

Now, here is what alsamixer looks like.
http://i52.tinypic.com/px5ao.png

aplay: I see 1 digital connection. No
alsamixer: I see 2 digital outputs and 1 input. Nod

Now, as far as the settings in xbmc go, I've tried every combination of all of them. I've even tried a few "custom" output strings to no avail.

The most interesting thing is, mplayer works fine. I used apt to get and install it and then told it "mplayer -ac hwac3 dolbycanyon.vob" and it played! My receiver lit up like a christmas tree and I had proper sound on all channels.

Code:
=========================================================
Forced audio codec: hwac3
Opening audio decoder: [hwac3] AC3/DTS pass-through S/PDIF
No accelerated IMDCT transform found
hwac3: switched to AC3, 448000 bps, 48000 Hz
AUDIO: 48000 Hz, 2 ch, ac3, 448.0 kbit/29.17% (ratio: 56000->192000)
Selected audio codec: [hwac3] afm: hwac3 (AC3 through S/PDIF)
=========================================================

I guess the bone I have to pick is with the video player that's part of xbmc. Maybe it's been smoking the same thing that aplay is, I have no idea.

Edit: One additional tidbit of information. I downloaded a couple of DTS encoded .wav files to mess with and the odd behavior persists.

Code:
xbmc@(none):~/Music$ aplay -D hw:0,4 mina.wav

Gives me a DTS light on the receiver and lots of audio.

Now, I've set my xbmc outputs both to "custom" and "plughw:0,4" (exactly the same as what was specified for aplay)

Gives me sound at least, but 2 channels.
Reply
#15
DoctorDyna Wrote:You are correct, my mainboard does have onboard audio, and it does have a coaxial digital output, however it's disabled in the bios.

Just out of curiosity: Why do you need to use the SoundBlaster? When using digital output in passthrough mode the sound device should not matter - you should get the same output quality with the onboard soundchip.

Quote:The aplay -L lists

And what does "aplay -l" list? If you use "aplay -L" it lists virtual devices as well. Virtual devices might downmix the audio. To get the real hardware devices, use "aplay -l". Maybe XBMC sends its output to a virtual ALSA device, which would explain why you only get stereo output. If we know the correct hardware device we can create a virtual device manually which will pass its data directly to the hardware.

Quote:Now, here is what alsamixer looks like.

And what happens if you press F6 in this screen? Can you actually select other sound devices?

Quote:The most interesting thing is, mplayer works fine. I used apt to get and install it and then told it "mplayer -ac hwac3 dolbycanyon.vob" and it played! My receiver lit up like a christmas tree and I had proper sound on all channels.

That's good news. At least we know that your driver is capable of digital output.


Quote:Now, I've set my xbmc outputs both to "custom" and "plughw:0,4" (exactly the same as what was specified for aplay)

Gives me sound at least, but 2 channels.

That's odd. If XBMC is in passthrough mode it should not downmix. Otherwise it would not be the passthrough mode. What happens if you try to use the volume controls, does XBMC still confirm the passthrough mode or is it downmixing?

Now that you have at least one working configuration you should enable XBMC's debug mode (System->System->Debugging) and check the logfile. Maybe there is an error message which explains the stereo mode.
Reply

Logout Mark Read Team Forum Stats Members Help
Can't manage to get proper digital output, please help!0