Linux PulseAudio Passthrough Fails on Frodo
#1
Ever since updating to Frodo my setup has failed for DTS and Dolby Digital passthrough streams. Videos play with no audio at double or triple framerate. I've tried a few suggestions on the forums, like making sure the proper flags are set in pavucontrol, making sure digital outputs are not muted, etc. VLC plays the videos just fine. Uninstalling Pulse is not an option for me. Stereo audio works fine.

Disabling Pulse temporarily did result in XBMC starting to work with passthrough (on ALSA outputs).

It seems like lots of users are having passthrough problems with the new AE in Frodo over Pulse, perhaps we can root cause what's going on. Please let me know if any information is missing.

Debug log: http://sprunge.us/EQjh
Screenshot of audio settings: http://i.imgur.com/wHa8UbY.png

Code:
aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: ALC892 Analog [ALC892 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 1: ALC892 Digital [ALC892 Digital]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 7: HDMI 1 [HDMI 1]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

Code:
aplay -L
null
    Discard all samples (playback) or generate zero samples (capture)
pulse
    PulseAudio Sound Server
default:CARD=PCH
    HDA Intel PCH, ALC892 Analog
    Default Audio Device
sysdefault:CARD=PCH
    HDA Intel PCH, ALC892 Analog
    Default Audio Device
front:CARD=PCH,DEV=0
    HDA Intel PCH, ALC892 Analog
    Front speakers
surround40:CARD=PCH,DEV=0
    HDA Intel PCH, ALC892 Analog
    4.0 Surround output to Front and Rear speakers
surround41:CARD=PCH,DEV=0
    HDA Intel PCH, ALC892 Analog
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=PCH,DEV=0
    HDA Intel PCH, ALC892 Analog
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=PCH,DEV=0
    HDA Intel PCH, ALC892 Analog
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=PCH,DEV=0
    HDA Intel PCH, ALC892 Analog
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=PCH,DEV=0
    HDA Intel PCH, ALC892 Digital
    IEC958 (S/PDIF) Digital Audio Output
hdmi:CARD=PCH,DEV=0
    HDA Intel PCH, HDMI 0
    HDMI Audio Output
hdmi:CARD=PCH,DEV=1
    HDA Intel PCH, HDMI 1
    HDMI Audio Output
Reply
#2
http://forum.xbmc.org/showthread.php?tid=154063 a few posts down in this page.

At least make a little effort - look around a bit before posting about same problems, especially when there's already solutions posted.

uNi
Reply
#3
At least make a little effort when replying to people's threads. I specifically called out that post:

Quote:I've tried a few suggestions on the forums, like making sure the proper flags are set in pavucontrol, making sure digital outputs are not muted, etc.

I have read every single thread that matches pulseaudio+frodo/v12+xbmc on this forum. I've tried all the options (and it sounds like from some of the replies there are people like me who the solutions do not apply to).
Reply
#4
haha funny guy! Rofl

The solution is easy, dont use pulseaudio, you yourself said it works without.

I guess that my effort done for a issue which has been covered to death on the intrawebs in general and seems to indicate and expalin how not to use pulseaudio.
And in case you missed it XBMC by default does not have pulse enabled, since if it did it wouldn't work for anyone else.

Good luck though!

uNi
Reply
#5
Unfortunately, to me, that solution seems like the worst one possible (don't use pulseaudio). I hate pulseaudio, but it's the only way I've gotten reliable multi-user audio setups working, which is a big deal to me.

I will just downgrade back to Eden as it did work flawlessly for my use case, and I guess the old adage "don't fix what isn't broken" applies here. If there's anything I can do to help triage the bugs I'm happy to do so.

I know people are against pulseaudio (I am too). If alsa/dev locks weren't stuck in the 1980's we'd likely not be having this conversation, but for now, it is relevant Smile
Reply
#6
Again XBMC by default is not compile with --enable-pulse which idk if it would work if you were to compile it with that support enabled if it would cure your "problems" or not or if you even tried it, you dont commnet on it so guessing, not.

Im not sure what multi-user issues there is, specifically this is a new usage scenario. Out of curiosity how can anyone run multi-users at same time in XBMC in one instance idk.

The pulseaudio aversion is limited to users like myself that dont use pulse and dont need pulse because using pulse only causes problems not solutions, hence why the aversion. I can straight away tell you quite a few ppl use pulse, but these ppl that have set it up, aside from the few threads on Howto fix they jump in to say this or that can be done and when asked to share you never hear from them again. So if anyone knows they saying nothing.

The two solutions so far are pavucontrol and compiling with pulse enabled, http://forum.xbmc.org/showthread.php?tid...pid1296775

All else is unknown!

uNi

Reply
#7
I guess I'm in the unknown part of the planet Smile

XBMC is compiled with --enable-pulse here (always was, sorry I thought you could garner that from the debug logs, which is why I didn't mention it). It doesn't help with passthrough at all.

Multi-user in XBMC for me is easy with a few daemon applications running under their own user (MPD+XBMC is enough, for example). As for how I do it, http://fedoraforum.org/forum/showpost.ph...ostcount=5 works perfectly for me Smile

So I have the fun case of: pavucontrol configured properly, and XBMC compiled with Pulse.

FYI if you'd like to see my XBMC compile flags, they are here: https://projects.archlinux.org/svntogit/...kages/xbmc
Reply
#8
I think that is caused by XBMC not releasing the alsa sink "audio hogging" (known issue idk if it was addressed, I think not) and probably pulse is doing something there idk.

uNi



Reply
#9
Just and update, in case the other forum members are still dealing with this, recompiling XBMC without Pulse (so that it uses ALSA sinks, which then go through Pulse anyways) fails to work as well (same issue). I also researched the audio hogging problem uNi suggested and it was solved a while ago here, so that's not it (thanks for the idea though): http://trac.xbmc.org/ticket/13246
Reply
#10
@vostok4 firstly, have you gone right to the end of the thread to http://forum.xbmc.org/showthread.php?tid...pid1331976 (I don't quite know what it means, but it's an extra tip you might like to try.

Also you could try the latest git versions if you can, there have been improvements in the audio code.

For your situation regard frodo as a release candidate or beta I'm afraid Sad
If I have helped you or increased your knowledge, click the 'thumbs up' button to give thanks :) (People with less than 20 posts won't see the "thumbs up" button.)
Reply
#11
Yup, I keep an eye on that one.

Actually, it's a good point about git. I'm going to try that out right away!
Reply
#12
Actually, git probably will be unlucky (building now) due to there being no relevant changes to PulseAE stuff. --edit-- git fixes nothing Sad

Also, I found some interesting data in the debug log:

Code:
23:19:04 T:140535482971904    INFO: CAEStreamInfo::SyncDTS - dts stream detected (***6 channels***, 48000Hz, 16bit BE, period: 512)
23:19:04 T:140535482971904   DEBUG: CDVDPlayerAudio: Sample rate changed, checking for passthrough
23:19:04 T:140535482971904   DEBUG: FactoryCodec - Audio: passthrough - Opening
23:19:04 T:140535482971904   DEBUG: FactoryCodec - Audio: passthrough - Opened
23:19:04 T:140535482971904  NOTICE: Creating audio stream (codec id: 86020, ***channels: 2***, sample rate: 48000, pass-through)
23:19:04 T:140535482971904   DEBUG: PulseAudio: Stream failed
23:19:04 T:140535482971904   ERROR: PulseAudio: Waited for the stream but it failed

(*** is my emphasis)

The file audio track is 6chan (5.1), yet the audio stream that "FactoryCodec" is trying to create is only 2 channels... I am going to see if I can dig to find out if this is happening for other people.
Reply
#13
For my own tracking (I know I'm posting a bunch), here's where the exact code fails:

Code:
pa_stream_set_state_callback(m_Stream, CPulseAEStream::StreamStateCallback, this);
  pa_stream_set_write_callback(m_Stream, CPulseAEStream::StreamRequestCallback, this);
  pa_stream_set_latency_update_callback(m_Stream, CPulseAEStream::StreamLatencyUpdateCallback, this);
  pa_stream_set_underflow_callback(m_Stream, CPulseAEStream::StreamUnderflowCallback, this);

  int flags = PA_STREAM_INTERPOLATE_TIMING | PA_STREAM_AUTO_TIMING_UPDATE;
  if (options && AESTREAM_FORCE_RESAMPLE)
    flags |= PA_STREAM_VARIABLE_RATE;

  if (pa_stream_connect_playback(m_Stream, NULL, NULL, (pa_stream_flags)flags, &m_ChVolume, NULL) < 0)
  {
    CLog::Log(LOGERROR, "PulseAudio: Failed to connect stream to output");
    pa_threaded_mainloop_unlock(m_MainLoop);
    Destroy();
    return /*false*/;
  }

  /* Wait until the stream is ready */
  do
  {
    pa_threaded_mainloop_wait(m_MainLoop);
    CLog::Log(LOGDEBUG, "PulseAudio: Stream %s", StreamStateToString(pa_stream_get_state(m_Stream)));
  }
  while (pa_stream_get_state(m_Stream) != PA_STREAM_READY && pa_stream_get_state(m_Stream) != PA_STREAM_FAILED);

  if (pa_stream_get_state(m_Stream) == PA_STREAM_FAILED)
  {
    CLog::Log(LOGERROR, "PulseAudio: Waited for the stream but it failed");
    pa_threaded_mainloop_unlock(m_MainLoop);
    Destroy();
    return /*false*/;
  }

I'm not sure why the stream connect is suceeding, while right away when you get the state its of a failed stream. I hope some dev will put eyes on this, I already filed a bug.
Reply
#14
vostok4 did you eventually solve the problem?

I have the exact same problem using xbmc frodo 12.2 (Ie. no passthrough audio and the video plays extremely fast). With Eden the pass through worked fine but not anymore.. I have tried all the configuration options that I can think of for pulseaudio and compiled xbmc with / without of the -enable--pulse, but nothing seems to work

My system;
Opensuse 12.1 (64-bit) system using kernel 3.1.10-1.9, Pulseaudio version 1.1. Dual core AMD x64.

My next step is to try out the current git version of the xbmc.
Reply
#15
You won't have more luck with Git version. Pulseaudio support in xbmc is limited - basically no Sink support.
First decide what functions / features you expect from a system. Then decide for the hardware. Don't waste your money on crap.
Reply

Logout Mark Read Team Forum Stats Members Help
PulseAudio Passthrough Fails on Frodo1