No audio playing 2ch video via optical to decoder
#1
Question 
Evening all..

I'm trying out XBMC on Ubuntu on a little ION box as a bit of an experiment to see if it stacks up better than XBMC did on my unibody Mac Mini (so far, it does; at least for video rendering - less stutters as the Mac was always dropping audio frames to keep the audio in sync).. anyway, so far the only snag I've hit is that certain video files play silently (oh and a global 200ms audio delay, but that's easily worked around).

I know this must be some issue with connectivity or drivers as the same files play fine on my MacBook via it's internal speakers (I haven't tested on the Mini via Optical, yet), but..

The files in question all seem to be ones with 2-channel mp3/ogg audio rather than 2ch AC3 or higher (DTS etc play fine).

My setup is:

ASRock ION3D152B -> Harmon Kardon AVR255 via SP/DIF for audio and
ASRock -> HK -> LG via HDMI for video

The box is running a plain Desktop install of Ubuntu 10.10 amd64 with whatever drivers came as standard.

Here's a debug-enabled pastebin of the xbmc log: http://pastebin.com/7vVNsRWD
And MediaInfo on the file in question: http://pastebin.com/jsecn9zL


Any suggestions gratefully accepted! I've already shuffled through all the audio output options I could find in XBMC to no avail..

Thanks,
Aaron
Reply
#2
The log shows you're using pulseaudio, you probably want to disable that because pulseaudio doesn't support passthrough.
Reply
#3
Thanks I'll give that a try. Pulseaudio is the default on Ubuntu 10.10 I think?

Interestingly, though, DTS and AC3 both seem to be passing through unmolested to the amp (it displays input format & channels appropriate to the source if I'm playing something with a DTS or AC3 track).. I thought I'd be getting down sampled audio if it wasn't passing through?
Reply
#4
We use alsa for passthrough by default, and that seems to be working ok.
Reply
#5
Thanks - I'll check it out over the weekend Smile
Reply
#6
Alright now I'm back I had chance to test stuff.. and .. I'm confused.

I thought I'd removed PulseAudio (I did 'sudo apt-get autoremove pulseaudio' and then rebooted).. but when I play the problematic files, XBMC is still trying to create a PulseAudio audio renderer? When playing files that work it's clearly not using PulseAudio at all though..

Here's a pastebin of a debug enabled log: http://pastebin.com/5x6GuVET

The first file I play has a DD2.0 soundtrack and plays fine - you can see it opens a passthrough renderer:
Code:
22:44:14 T:140288628483840 M:1654501376   DEBUG: FactoryCodec - Audio: PassthroughFFmpeg - Opening
22:44:14 T:140288628483840 M:1654501376    INFO: CDVDAudioCodecPassthroughFFmpeg::SetupMuxer - Trying to setup spdif muxer
22:44:14 T:140288628483840 M:1654501376    INFO: CDVDAudioCodecPassthroughFFmpeg::SetupMuxer - spdif muxer ready
22:44:14 T:140288628483840 M:1654501376   DEBUG: FactoryCodec - Audio: PassthroughFFmpeg - Opened

The second file I play has an old ogg format stereo analog soundtrack and XBMC tries to fire up PulseAudio as a fallback to passthrough?
Code:
22:44:38 T:140288475834112 M:1586970624    INFO: ffmpeg[74C4A700]:     Stream #0.1(eng): Audio: vorbis, 44100 Hz, stereo, s16
22:44:38 T:140288475834112 M:1586970624    INFO: ffmpeg[74C4A700]:     Stream #0.2(jpn): Audio: vorbis, 44100 Hz, stereo, s16
22:44:38 T:140288475834112 M:1589030912  NOTICE: Opening audio stream: 1 source: 256
22:44:38 T:140288475834112 M:1589030912  NOTICE: Finding audio codec for: 86022
22:44:38 T:140288475834112 M:1589030912   DEBUG: FactoryCodec - Audio: PassthroughFFmpeg - Opening
22:44:38 T:140288475834112 M:1589030912    INFO: CDVDAudioCodecPassthrough::Open - disabled passthrough due to sample rate not being 48000
22:44:38 T:140288475834112 M:1589030912   DEBUG: FactoryCodec - Audio: PassthroughFFmpeg - Failed
22:44:38 T:140288475834112 M:1589030912   DEBUG: FactoryCodec - Audio: FFmpeg - Opening
22:44:38 T:140288475834112 M:1588768768   DEBUG: FactoryCodec - Audio: FFmpeg - Opened
22:44:38 T:140288475834112 M:1588768768  NOTICE: Creating audio thread
22:44:38 T:140288450656000 M:1588768768  NOTICE: running thread: CDVDPlayerAudio::Process()
22:44:38 T:140288450656000 M:1588768768   DEBUG: CDVDPlayerAudio - CDVDMsg::GENERAL_RESYNC(18000.000000, 1)
22:44:38 T:140288450656000 M:1588768768  NOTICE: Creating audio device with codec id: 86022, channels: 2, sample rate: 44100, no pass-through
22:44:38 T:140288450656000 M:1588768768   DEBUG: CGUIAudioManager::DeInitialize
22:44:38 T:140288450656000 M:1588768768   DEBUG: PulseAudio: Context failed
22:44:38 T:140288450656000 M:1588768768   ERROR: PulseAudio: Waited for the Context but it failed
22:44:38 T:140288450656000 M:1588768768   ERROR: PulseAudio: Failed to create context
22:44:38 T:140288450656000 M:1588768768   DEBUG: CGUIAudioManager::Initialize
22:44:38 T:140288450656000 M:1588768768   ERROR: Unable to open audio mixer
22:44:38 T:140288450656000 M:1588768768   ERROR: Creating a Null Audio Renderer, Check your audio settings as this should not happen
22:44:38 T:140288450656000 M:1588768768   DEBUG: CGUIAudioManager::DeInitialize

Now PulseAudio naturally fails .. probably because I just uninstalled it .. so XBMC naturally cries foul and creates a null audio renderer.


I'm guessing this is something I'm missing in the Ubuntu config and maybe I should reinstall following the XBMCbuntu guide rather than using a full desktop install of Ubuntu, if that would help?
Reply
#7
No idea how you did that, it should always fall back to alsa if pulseaudio fails.
Reply
#8
I tried something somewhat similar and had similar results. I didn't remove pulseaudio but I tried to hide it from xbmc.

Hardware is an old shuttle Athlon XP 1800+ with C-media chip & s/pdif on the motherboard and a PCI nvidia 8400 card. Talking to denon receiver, video is DVI->hdmi and audio is optical s/pdif. TV is sony HD 34" tube.
  • started with 10.10 desktop install

  • 2ch worked via s/pdif but surround gave "could not open audio device".

  • figured out that it had pulseaudio, and that that was bad.

  • tried this FAQ entry that is supposed to bypass pulseaudio, it didn't work. I think i still got 2ch but not surround.

  • found this thread, figured XBMCbuntu, standalone without gnome, was the right way to go.

  • decided i would try to hack around it without doing a fresh minimal install, figuring that all i really needed to do was start up without GNOME & pulseaudio

  • installed the various packages listed for XBMCbuntu on the wiki

  • found the XBMC-standalone startup script. Noticed that it tried to start pulseaudio, looks for it in /usr/bin/start-pulseaudio-x11 i think. renamed that script so that the xbmc startup script wouldn't find it.

  • start xbmc, no sound at all. log files indicated that it couldn't find pulseaudio but it never tried to do alsa directly; same mention of a null audio renderer as above. Used xinit XBMC-standalone, and also fresh boot & init script.

  • gave up, whacked my install, did an XBMCbuntu install, and surround worked! Went to bed.


Now that I think about it, though, menu click sounds didn't work, and I didn't try anything with only 2 channel audio. Here's hoping it works when I try tonight.

I had similar "can not open audio device" problems with dharma live; didn't try to troubleshoot them too much since my remote didn't work, and it does work with the newer lirc in 10.10. If it is useful I can boot up the livecd and try to debug it further.
Reply
#9
Thanks for the nudge to try a reinstall, Dan Smile

bobo1on1 Wrote:No idea how you did that, it should always fall back to alsa if pulseaudio fails.

Yep, no idea how I did that either Wink

Anyway, I reinstalled tonight following the XBMCbuntu instructions using the 10.10 minimal install image.

Once I was done, surround sound worked as before (bonus!)
2ch sound didn't work and just gave me a "could not open audio device" in the GUI

So .. off I went into Settings->System->Audio Output and noticed the 'Audio output device' was set to something like 'pulse::alsa....' (can't seem to get that back now, so I can't tell you exactly what it was) - flicked through the options until I had 'HDA Intel iec958' selected and tried again, voila - surround DTS/DD5.1 tracks play perfectly and so do 2ch mp3 audio tracks Smile


Hurrah!

The moral of this story .. the Desktop install (at least on the ASRock ION box) does something with pulseaudio that XBMC doesn't seem to enjoy working with.


Thanks for all the help Smile

Now I just have to get lirc working on a friends Asus E1501P where sadly the lirc_it87 module panics under 10.10; looks like I'll be rolling him back to 10.04. (The moral of that story is .. don't offer to set up someone elses system for them Wink)
Reply
#10
mine works with 2ch and 5.1. No clicky sounds in the xbmc UI but i don't care.

yay!

thanks dev team for some great software.
Reply
#11
Good job, Dan Smile

I actually turn the UI sounds off - for two reasons, 1) the clicky clicky bugs the ever living wotsit out of me (just like key sounds on mobile phones!) and 2) when my amp switches from PCM for the UI to <whatever> for the media I get a fairly loud 'clicksh' which can't be healthy. Turning off UI sounds solved that one for me.

'course then I got fed up of how loud the fan in the ASRock was, so I went and bought an ASUS EB1501P which is much quieter, but you have to run Ubuntu 10.04 as the required lirc module barfs on 10.10 Smile
Reply
#12
aaronjb Wrote:'course then I got fed up of how loud the fan in the ASRock was, so I went and bought an ASUS EB1501P which is much quieter, but you have to run Ubuntu 10.04 as the required lirc module barfs on 10.10 Smile

I've got a loud fan on the video card. Been thinking about modifying that with a
bigger passive heatsink. Otherwise i'm quite happy with the little rig so far.

Too bad lirc had a regression like that. I had the opposite problem, needed the newer version.
Reply
#13
Yeah the lirc thing drove me up the wall the first time - I was 'round a friends house trying to persuade him that Linux was much better than Windows and .. that whole task somewhat blew up in my face when we couldn't get the remote working Wink

Speaking of fans - I did start looking at the big (full size) multimedia cases complete with VFDs and so on.. but I have this feeling I'd never get it as quiet as the ION2 based Asus, which would just bug me if I'd spent a ton of money (the cases are almost £100 on their own).
Reply

Logout Mark Read Team Forum Stats Members Help
No audio playing 2ch video via optical to decoder0