No audio with passthrough (works in VLC and mplayer) - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33) +--- Forum: General Support (https://forum.kodi.tv/forumdisplay.php?fid=111) +---- Forum: Linux (https://forum.kodi.tv/forumdisplay.php?fid=52) +---- Thread: No audio with passthrough (works in VLC and mplayer) (/showthread.php?tid=91016) |
No audio with passthrough (works in VLC and mplayer) - negge - 2011-01-19 Hi everyone, I've been struggling the whole day with this problem and I just can't figure it out. I also talked to some guys on the IRC channel but no progress was made. The problem is that I can't play movies with AC3/DTS audio, because when XBMC has to use the selected passthrough device it fails with the standard "Failed to initialize audio device" error. This is what shows up in the log: Quote:01:32:31 T:2761333616 M:3895308288 DEBUG: SetActiveDevice - SetActiveDevice from 0 to 2 Googling for that particular error gives no results... My setup is as follows: XBMC version: newest GIT build Soundcard: M-Audio Audiophile 2492, connected to reciever with coaxial cable Everything works out of the box with VLC, I get 6 channel audio to my reciever just fine. Same with mplayer when I try playing an AC3 file with this command: Code: mplayer -ao alsa:device=iec958 -ac hwac3 test.ac3 I've tried tons of different .asoundrc's I've found by googling, but none of them has worked. Worth noting is that I can play movies with MP3 audio when the output device is set to "Default (ALSA)" (although I have to change some settings in Envy24Control to hear anything). Here is some (possibly related) outputs: aplay -l Quote:**** List of PLAYBACK Hardware Devices **** aplay -L Quote:null Output from a successful playback with mplayer (command quoted above) Quote:mplayer: /usr/local/lib/libaa.so.1: no version information available (required by mplayer) Please, if anyone has even the slightest idea about what could be wrong, please reply! My only other option after this would be to go buy a 5 meter Toslink cable and use the integrated audio, but that would be such a waste. - tomsunds - 2011-01-19 I have no idea ...but I start xbmc with this easy little script pulseaudio -k xbmc pulseaudio --start that if ure install runs with pulseaudio as default. - negge - 2011-01-19 I don't use Pulseaudio so that can't be a problem. I tried it though and got everything to work just fine except the passthrough part (as Pulseaudio apparently doesn't support multi-channel passthrough) - Gryph - 2011-01-19 Well, you haven't told us what settings you've used/tried in the audio settings of XBMC; nor a full debug log (which would say that at least) So, have you tried: Device: default Passthrough: iec958 - negge - 2011-01-19 I've tried with basically every combination there is, but currently I have it set like this: Audio output: Optical/Coax Speaker conf: 5.1 DD/DTS capable: both checked Audio output device: "Defaults (ALSA)" <- This works Passthrough output device: "iec958 (ALSA)" Here's a full debug log with the above settings when trying to play a movie with AC3 audio: http://pastebin.com/FMczXenT I also noticed that speaker-test fails to play audio through iec958 when XBMC was running so I disabled navigation sounds and speaker-test worked again, although XBMC still can't seem to open the passthrough device. Edit: I've also tried with a custom device. I've tried "iec958", "plug:iec958" (that works with speaker-test btw), "hw:0,7" (that's my S/PDIF device), but I keep getting the same error or "No such file or directory". - Gryph - 2011-01-19 I fell into this little trap a while ago ... With the speaker config. I had to set this to 2.0 instead of 5.1; Audio Device: Defaults; Passthrough: iec958 Then I had to create: /etc/asound.conf pcm.!default { type plug slave { pcm "iec958" } } - negge - 2011-01-19 Gryph Wrote:I fell into this little trap a while ago ... With the speaker config. I tried that but I'm still getting the same error. - negge - 2011-01-19 I seem to have solved it, albeit the very hard way! I uncommented these lines from xbmc/cores/AudioRenderers/ALSADirectSound.cpp: Code: nErr = snd_pcm_hw_params_get_buffer_size(hw_params, &m_uiBufferSize); Now I can use iec958 as device for both passthrough and default. Still trying to get navigation sounds working, but that's a minor issue. Edit: Can't play music either (it just sits there on 00:00), don't know if this is related to my change The question is, is this a bug in XBMC, and if it is, what part should I file it against? - Artebonz - 2011-02-01 Thank you! I've been messing around with this off and on for some time. Your change worked like a charm. I commented out the lines negge highlighted in the "code" section above, although, one of my lines was slightly different (presumably a different build/version). Then I built the package again using the changes. I'm using the mAudio M2496 card too. Everything in your first post fit my situation exactly, BTW. On a side note, Music and Videos play fine.... - negge - 2011-02-01 Artebonz Wrote:Thank you! I've been messing around with this off and on for some time. Your change worked like a charm. Good to hear I'm not alone with this problem. Is passthrough audio working perfectly fine for you or does it stutter from time to time on certain AC3/DTS sources? I ended up using my internal audio card cause I couldn't get the stuttering away. - Artebonz - 2011-02-01 I've not used it enough after the fix to know, but, I'll post back and say one way or the other it's the least I can do..... Matt - Artebonz - 2011-02-02 I just watched a 2.5 hour long movie w/a 5.1 ac3 soundtrack and had no issues at all. Also, listened to some music tonight w/no problems for about an hour. So, there must be something else going on for you.... Is your onboard audio card digital w/passthrough too? Any clues when you run xbmc from a terminal? Anyway, thanks again for posting a fix. - negge - 2011-02-02 Quote:I just watched a 2.5 hour long movie w/a 5.1 ac3 soundtrack and had no issues at all. Also, listened to some music tonight w/no problems for about an hour. So, there must be something else going on for you... In my experience it didn't happen on all movies. It's really weird I tell you. I posted a bug report here, although if it works perfectly for you the problem might lie somewhere else. Could you be kind enough to test the clip I linked to in the bug report (http://werket.tlk.fi/~negge/xbmc_stutter.avi)? I get massive stuttering on that one. Quote:Is your onboard audio card digital w/passthrough too? Any clues when you run xbmc from a terminal? Yeah, currently I use the internal soundcard for passthrough over an optical cable (other card uses a coaxial of course), no issues at all. I've scanned xbmc.log for anything suspicious when using the M-Audio card but I couldn't find anything. - Artebonz - 2011-02-03 Quote: Could you be kind enough to test the clip I linked to in the bug report (http://werket.tlk.fi/~negge/xbmc_stutter.avi)? I get massive stuttering on that one. The xbmc_stutter.avi clip played fine for me without any issues.... You're symptoms seem to point to the card itself. Some issue w/ALSA perhaps? My other thought would be whether you're using internal or external libraries in your build for ac3 / dts or maybe even ffmpeg. I would say that's a possibility, but, that doesn't explain why one card works and the other doesn't... If I can test anything else out just ask.... - Bosopost - 2011-03-11 thank you negge, commenting out the lines solved my issue too. I have ubuntu minimal 10.04, xbmc 10.0, Asus P5C41C-M mb, Asus ENGT220 video and M-Audio Audiophile 2496 and I had the same error about getting the buffer size. What I am wondering now is if commenting out this line code does not create another issue because when I look in the xbmc.log it displays buffer size 0. However, the card works ok for music and also movies. |