Passthrough troubles with Alsa on Lucid
#1
Hey folks,

sorry for creating another thread about this issue, but I couldn't find a solution yet, reading through the other posted issues.

I got a clean, new Lucid Beta2 installation AMD64bit. I got XBMC Camelot compiled from source, and almost everything is running smoothly. Latest Nvidia driver from launchpad PPA.
I thought this time, I'll try alsa without going through the pain of completely removing pulse.
So I followed some howto of howto simply switching to alsa sound system from pulse.
Meaning pulse IS still present and running as a process, but I used "gstreamer-properties" to switch to alsa as default.
Works basically fine, sound in Lucid is present, both via HDMI to TV and SPDIF on my 5.1 receiver.
Problem now is, that movies with 5.1 digital sound, only AC-3 so far tested, dont play sound but give me "failed to initialize audio device". Other movies without digital sound work fine, navigation sounds also present.
In the log I get these errors related to alsa:

14:05:46 T:140298483095312 M:1467158528 ERROR: Initialize - failed to open custom device default:AES0=0x6,AES1=0x82,AES2=0x0,AES3=0x2
, retry with default default
14:05:46 T:140298483095312 M:1467158528 ERROR: Initialize - pcm_open_lconf, alsa error: -16 - Device or resource busy
14:05:46 T:140298483095312 M:1467158528 ERROR: Creating a Null Audio Renderer, Check your audio settings as this should not happen

Do I have to create a asound.conf or .asoundrc file? Because I don't have either of them with the default alsa installation on Lucid, they are simply not present.
Alsa packages installed:

alsa-base install
alsa-utils install
bluez-alsa install
gstreamer0.10-alsa install

Alright, I figured it out ... got alsa working including 5.1 passthrough in XBMC.

Working now:

- Ubuntu Gnome desktop sounds, both via HDMI and SPDIF, except for system sounds, e.g. startup. Playing back a flash movie in firefox though is perfectly fine with sound. I'll look into getting system sounds back too.
- XBMC Navigation Sounds, both HDMI and SPDIF
- XBMC MP3 Playback, both HDMI and SPDIF
- XBMC regular Movies, without Dolby Digital. Mostly XVID here with MP3 Audio, both HDMI and SPDIF
- XBMC Dolby Digital 5.1 via passthrough, on SPDIF. HDMI makes no sense, since I don't have a HDMI audio receiver, I use SPDIF only to my receiver. But I guess it'll work via HDMI to receivers too.

Here's what I did:

Go to System - Preferences - Sound. There on the Hardware tab. Chose a profile on the bottom, that does NOT contain anything related to digital or IEC. I chose Analog Stereo Duplex. My theory is, that if you go digital there, pulse is blocking the digital output. The sound preferences windows seems to be only related to pulse, not alsa at all.

Now open up a terminal window and start "gstreamer-properties". On the Audio tab, select ALSA - Advanced Linux Sound Architecture, for Default Output. As Device, choose the digital device, in my case: ALC889A (my sound chip) digital.
I selected ALSA also for Default Input, though I don't think Input has any effect, as long as you don't use a mic or something.

In XBMC, I got both devices for audio and passthrough set to IEC958.

And voila :-) I am enjoying happy sound via Alsa in Ubuntu and XBMC, via HDMI and SPDIF, including passthrough in XBMC.

Hope this can help others to avoid audio troubles ...

boba
Reply
#2
I (have) had the same issue.

My workaround:
Open in Ubuntu the 'Sound' Applet, switch to the hardware tab and use as Souncard 'None'. At this moment you don't have any sound in Ubuntu.

Start XBMC go to the Sound settings and set the audio device to IEC958. That will fix it. But you loose menu sounds in XBMC and Ubuntu... It is because PulseAudio doesn't support PassThrough Audio.

I tried to upgrade Alsa from v1.0.21 to v1.0.22.1, but that makes no sense, I also tried to remove PulseAudio, but that makes also no sense. (Want the menu sounds back and the Sound in Ubuntu)

Btw: I changed my asound.conf to have 6channel sound instead of 2ch. sound (/etc/asound.conf)
Reply
#3
CharlesNasi Wrote:I (have) had the same issue.

My workaround:
Open in Ubuntu the 'Sound' Applet, switch to the hardware tab and use as Souncard 'None'. At this moment you don't have any sound in Ubuntu.

Start XBMC go to the Sound settings and set the audio device to IEC958. That will fix it. But you loose menu sounds in XBMC and Ubuntu... It is because PulseAudio doesn't support PassThrough Audio.

I tried to upgrade Alsa from v1.0.21 to v1.0.22.1, but that makes no sense, I also tried to remove PulseAudio, but that makes also no sense. (Want the menu sounds back and the Sound in Ubuntu)

Btw: I changed my asound.conf to have 6channel sound instead of 2ch. sound (/etc/asound.conf)

Well I am pretty sure, removing pulse one or the other way would fix it, too. Plus keeping sound in gnome and xbmc navigation working. I have that setup on my other partition with ubuntu jaunty. Problem is I don't remember exactly what I did back then when I also fought with pulse/alsa ... :-(

boba
Reply
#4
When I remove Pulse, sound is not working anymore in Lucid (Sound Applet won't lauch anymore) On Karmic > no issues, only on lucid.
HTPC Specs: GA-MA78GM-S2h 1.0, 2GB Ram, Samsung S203B DVDrw, AMD Phenom X3 8650, Antec Fusion V2 Black, 1.5TB HDD, GeForce 9500GT running Ubuntu 10.04 and XBMC from SVN
Reply
#5
CharlesNasi Wrote:When I remove Pulse, sound is not working anymore in Lucid (Sound Applet won't lauch anymore) On Karmic > no issues, only on lucid.

Alright, I "think" I figured it out ... without removing pulse. Will update the thread and post #1 ... hold on.
Reply
#6
@boba23, I have the same soundchip (Realtek ALC889A)
I followed your guide, but no luck. I'll keep experimenting and when I have progress, I'll let it know

Thanks for the workaround!
HTPC Specs: GA-MA78GM-S2h 1.0, 2GB Ram, Samsung S203B DVDrw, AMD Phenom X3 8650, Antec Fusion V2 Black, 1.5TB HDD, GeForce 9500GT running Ubuntu 10.04 and XBMC from SVN
Reply
#7
Damn it ... I swear it was working for me the way I described yesterday night. After a bit more of experimenting, I am back at the beginning. Now when I switch to alsa in gstreamer-properties, I got no sound at all within Ubuntu :-(
This pulseaudio crap is killing me, I swear.

boba
Reply
#8
Try to kill PulseAudio (pulseaudio -k) & echo autospawn = no|tee ~/.pulse/client.conf
Because i get stutters at the playback of sounds / music / video when Pulse is running, everytime when the process PulseAudio become active
HTPC Specs: GA-MA78GM-S2h 1.0, 2GB Ram, Samsung S203B DVDrw, AMD Phenom X3 8650, Antec Fusion V2 Black, 1.5TB HDD, GeForce 9500GT running Ubuntu 10.04 and XBMC from SVN
Reply
#9
Yep, I just tried that ... basically I get Alsa + Passthrough working that way, but I lose other stuff:

- no system sounds in ubuntu (e.g. startup sound)
- no navigation sounds in xbmc

I "could" live with that. but I want my system to work just fine with alsa. Without drawbacks :-(

What we basically need in my eyes .... is a way to let pulse handle everything but passthrough. Thus, letting pulse run as it should be in lucid, but just make passthrough go directly to alsa, without pulse blocking the digital output.

boba
Reply
#10
So, again ... I got it running now :-) Don't ask me why it stopped working in between. But I am doing the same stuff again, described in post #1.
I have pulse running, nothing disabled, nothing removed. Just set the profile in sound preferences to "Analog Stereo Duplex".
In gstreamer-properties I have Alsa as default, and chose my "digital" soundchip there.
Ubuntu sounds working, XBMC nav sounds working, Passthrough working, basically everything working :-)
I did like 5 reboots now, and it still works. Hope it stays this way.
Maybe try this way again charles. It definately works for me right now.
I don't have any stuttering either, that you mentioned above.
Though I am using the official 9.11 Camelot release now. Which svn version are you running? Is the latest svn stable again? Merge done?

boba
Reply
#11
Hi!

First of all, thanks for your experiences, i made working DTS sound in XBMC.
But can you describe, how solved the sound in ubuntu.

I miss it very much, and without switching back to digital sound in pulseaudio, i can't listen to music with banshee.

Thank You

Kovat
Reply
#12
similar problem here, different workaround. Upgrade to lucid from karmic. Almost everything works except 5.1 passthrough. I was able to get it working without changing the pulse setting to analog using the mixer applet. What I have to do is toggle "output stereo to all speakers" in xbmc. No idea why, not an elegant solution, but it works.

Joe
Reply
#13
XBMC seems to play 3 types of sounds
  • Navigation sounds (menu clicks etc.)
  • Main audio output (music/video)
  • Passthrough (DD/dts movies)


It's possible to get in the state with seemingly random sound 'types' just stop working. I've had digital passthrough working but no menu clicks and vice versa with seemingly no logic as to why.

XBMC settings;

Audio output: Digital
Audio output device: default
Passthrough output device: iec958



Ubuntu (Lucid) sound applet;

Hardware profile: Digital Output (Duplex IEC958)


I have menu clicks and general audio output (music). When playing a move with dolby bitstream, looking in the log file it seems XBMC tries to open the Alsa iec958 device directly which fails as the device is in use (by Pulseaudio)

Ok so I go into the Ubuntu sound applet and change the hardware profile to 'Analog Stereo', the movie now plays with digital passthrough in XBMC but menu noises have gone yet music still plays via the digital connection, Ubuntu sounds have stopped aswell obviously (no anolog speakers connected). It seems menu clicks adhere to the Sound Applets setting but general non-passthrough audio like music doesn't (instead using the XBMC's Audio output device setting)

EDIT: Quit XBMC back to the Ubuntu desktop, start clicking around and the Ubuntu sounds come back (even though it's still set to anolog and I only have a digital connection) and now XBMC navigation sounds are back!??
Reply
#14
I'm close to bangning my head on the wall with trying to setup digital sound in XBMC (svn version) on Ubuntu Lucid. I must say that digital sound works in Totem, the basic movie player in Ubuntu. So my digital connection is working.

I have tried every solution proposed here with mixed results: I have surround sound with most movie with mp3 audio, partial or no sound with AAC or AC3 audio. MP3 music is choppy most of the times.

My present setup:

Sound setting in Ubuntu: Analog (Digital does'nt work)
In XBMC:
Audio output: Analog
Audio device output: custom
Custom output device: plug:dmixer

If I try Digital output in XBMC, I get an error message...no passthrough

/etc/asound.conf:
Code:
pcm.!default {

   type plug
   slave {
       pcm "iec958"
   }

}

.asoundrc
Code:
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
     }
}


aplay -l
Code:
pierre@pierre-desktop:~$ aplay -l
**** Liste des PLAYBACK périphériques ****
carte  0: Audigy2 [SB Audigy 2 ZS [SB0350]], périphérique 0 : emu10k1 [ADC Capture/Standard PCM Playback]
  Sous-périphériques: 32/32
  Sous-périphérique: #0: subdevice #0
  Sous-périphérique: #1: subdevice #1
  Sous-périphérique: #2: subdevice #2
  Sous-périphérique: #3: subdevice #3
  Sous-périphérique: #4: subdevice #4
  Sous-périphérique: #5: subdevice #5
  Sous-périphérique: #6: subdevice #6
  Sous-périphérique: #7: subdevice #7
  Sous-périphérique: #8: subdevice #8
  Sous-périphérique: #9: subdevice #9
  Sous-périphérique: #10: subdevice #10
  Sous-périphérique: #11: subdevice #11
  Sous-périphérique: #12: subdevice #12
  Sous-périphérique: #13: subdevice #13
  Sous-périphérique: #14: subdevice #14
  Sous-périphérique: #15: subdevice #15
  Sous-périphérique: #16: subdevice #16
  Sous-périphérique: #17: subdevice #17
  Sous-périphérique: #18: subdevice #18
  Sous-périphérique: #19: subdevice #19
  Sous-périphérique: #20: subdevice #20
  Sous-périphérique: #21: subdevice #21
  Sous-périphérique: #22: subdevice #22
  Sous-périphérique: #23: subdevice #23
  Sous-périphérique: #24: subdevice #24
  Sous-périphérique: #25: subdevice #25
  Sous-périphérique: #26: subdevice #26
  Sous-périphérique: #27: subdevice #27
  Sous-périphérique: #28: subdevice #28
  Sous-périphérique: #29: subdevice #29
  Sous-périphérique: #30: subdevice #30
  Sous-périphérique: #31: subdevice #31
carte  0: Audigy2 [SB Audigy 2 ZS [SB0350]], périphérique 2 : emu10k1 efx [Multichannel Capture/PT Playback]
  Sous-périphériques: 8/8
  Sous-périphérique: #0: subdevice #0
  Sous-périphérique: #1: subdevice #1
  Sous-périphérique: #2: subdevice #2
  Sous-périphérique: #3: subdevice #3
  Sous-périphérique: #4: subdevice #4
  Sous-périphérique: #5: subdevice #5
  Sous-périphérique: #6: subdevice #6
  Sous-périphérique: #7: subdevice #7
carte  0: Audigy2 [SB Audigy 2 ZS [SB0350]], périphérique 3 : emu10k1 [Multichannel Playback]
  Sous-périphériques: 1/1
  Sous-périphérique: #0: subdevice #0
carte  0: Audigy2 [SB Audigy 2 ZS [SB0350]], périphérique 4 : p16v [p16v]
  Sous-périphériques: 1/1
  Sous-périphérique: #0: subdevice #0
pierre@pierre-desktop:~$

Help would be very much appreciated. Thank you in advance.
Reply
#15
Try adding yourself to the group "audio". I had digital audio through hdmi working everywhere but xbmc, would just get an error there. After adding myself to audio and restarting xbmc everything works fine.
Reply

Logout Mark Read Team Forum Stats Members Help
Passthrough troubles with Alsa on Lucid0