SPDIF passthrough 5.1 not working

*nix specific usage questions
MyTh
New Cone
New Cone
Posts: 7
Joined: 12 May 2008 18:09

SPDIF passthrough 5.1 not working

Postby MyTh » 29 Apr 2012 10:16

Hi people!

I have again problems with AC3 sound not working, or better creating strange things!

When I open an AVI or MKV with AC3 (or any other passthrough stream, DTS as well) my audio receiver gets crazy, as shown in this video:

Image

Sometimes I get it to work just by seeking a bit around in the video, which is really strange!

What could this be caused by?

When I open VLC in a terminal I don't really get relevant information:

Code: Select all

VLC media player 2.0.1 Twoflower (revision 2.0.1-0-gf432547) [0x2017108] main libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface. MKV/Ebml Parser: m_el[mi_level] == NULL MKV/Ebml Parser: Up cannot escape itself MKV/Ebml Parser: m_el[mi_level] == NULL MKV/Ebml Parser: Up cannot escape itself
Alsa is 1.0.24.

For sure the settings in Audio section are as they should (Module ALSA, use spdif, device digital IEC958).

MyTh
New Cone
New Cone
Posts: 7
Joined: 12 May 2008 18:09

Re: SPDIF passthrough 5.1 not working

Postby MyTh » 12 May 2012 21:03

No solution?

Same on ARCH linux with alsa 1.0.25! That sucks... :-|

Rémi Denis-Courmont
Developer
Developer
Posts: 15265
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: SPDIF passthrough 5.1 not working

Postby Rémi Denis-Courmont » 16 May 2012 16:57

You should probably try with PulseAudio instead.

Otherwise, it's hard to say what is wrong without the verbose logs. I can only guess it's a timing problem.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

dbengs
New Cone
New Cone
Posts: 1
Joined: 05 Jun 2012 22:32

Re: SPDIF passthrough 5.1 not working

Postby dbengs » 05 Jun 2012 23:41

Hi,

I've got the same problem and I've got the same receiver, Yamaha RX-V350. Coincidence?

I'm using Ubuntu 12.04 and VLC 2.0.1.

For me the problem occurs when I jump, seek or unpause, but not when starting to play a video. There's like (very roughly) a 2/3 chance that these actions will induce this problem. So I have to jump back a few times to get the sound working again. A couple of times this problem occurred while a video was playing.

In VLC 1.1.9 (Ubuntu 11.04) this problem manifested itself in a different way: the sound still worked but wasn't in sync with the video.

Using PulseAudio means no SPDIF, so that's really not a solution, at least not for me. Any other suggestions? What info or which logs can help in fixing this problem?

Snowdog
New Cone
New Cone
Posts: 4
Joined: 06 Jun 2012 03:33

Re: SPDIF passthrough 5.1 not working

Postby Snowdog » 06 Jun 2012 03:45

I also have this problem with Ubuntu 12.04, VLC 2.01.

Though I have Denon Reciever, so the Dolby Digital Just flashes on/off when the sound dies.

Often if I play the movie right from the start, it stays in sync(but sometimes not), but if I pause or skip, the sound dies and something clearly goes wrong with the stream. Skipping around over and over might get it back, but often doesn't, especially if the sound lost integrity on it's own.

Also as above, the point is SPDIF, so switching to Pulse kills that.

Linux and sound, always a pain.

Edit. I tried it again, and turned on messages. File played with sound for about 2 minutes, then I did a big skip later into the movie and it broke as usual. Once broke logs just repeat with same messages as long as you let it run.

From the SeeK:

Code: Select all

mkv debug: seek request to -1 (0.495000%) mkv debug: seek got 3460963000 (51%) main debug: Buffering 0% xcb_xv debug: display is visible main debug: Buffering 0% main debug: End of audio preroll main debug: Buffering 49% main debug: Buffering 98% main debug: Stream buffering done (1021 ms in 264 ms) main debug: End of video preroll main debug: Received first picture main debug: Decoder buffering done in 81 ms main warning: not synchronized (-141205 us), resampling main warning: buffer way too early (-141205), clearing queue main warning: not synchronized (-206054 us), resampling main warning: buffer way too early (-206054), clearing queue main warning: not synchronized (-269921 us), resampling main warning: buffer way too early (-269921), clearing queue main warning: not synchronized (-333802 us), resampling main warning: buffer way too early (-333802), clearing queue main warning: not synchronized (-396784 us), resampling main warning: buffer way too early (-396784), clearing queue main warning: not synchronized (-459648 us), resampling main warning: buffer way too early (-459648), clearing queue main warning: not synchronized (-524530 us), resampling main warning: buffer way too early (-524530), clearing queue main warning: not synchronized (-588405 us), resampling main warning: buffer way too early (-588405), clearing queue main warning: not synchronized (-652278 us), resampling main warning: buffer way too early (-652278), clearing queue main warning: not synchronized (-716158 us), resampling main warning: buffer way too early (-716158), clearing queue main warning: not synchronized (-780028 us), resampling main warning: buffer way too early (-780028), clearing queue main warning: not synchronized (-843906 us), resampling main warning: buffer way too early (-843906), clearing queue main warning: not synchronized (-907781 us), resampling main warning: buffer way too early (-907781), clearing queue main warning: not synchronized (-971659 us), resampling main warning: buffer way too early (-971659), clearing queue main warning: not synchronized (-1035532 us), resampling main warning: buffer way too early (-1035532), clearing queue alsa warning: cannot write samples: Broken pipe main warning: not synchronized (-880686 us), resampling

Rémi Denis-Courmont
Developer
Developer
Posts: 15265
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: SPDIF passthrough 5.1 not working

Postby Rémi Denis-Courmont » 06 Jun 2012 08:35

PulseAudio suports S/PDIF since version 1.0. It works fine according to all those that tested it in VLC.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

Snowdog
New Cone
New Cone
Posts: 4
Joined: 06 Jun 2012 03:33

Re: SPDIF passthrough 5.1 not working

Postby Snowdog » 06 Jun 2012 15:05

It doesn't work that way on my system. AFAIK Pulse is essentially a Server/Mixer that sits on top of Alsa anyway. Once you are doing SPDIF passthrough, Pulse is irrelevant.

How it appears In VLC.

Preferences: Audio Settings.

Output Module:
Select: Alsa audio output
VLC then shows:
[Checkbox] Use S/PDIF when Available
Device [dropdown box] where I can select HDA Intel, ALC888 IEC958 (S/PDIF) Digital audio output.
Audio Passthrough works (when it isn't glitching out)

But if Instead
Select: Pulse audio output.
No Checkbox exists for S/PDIF
No Dropdown box for device
and I only get analog sound output.

Which makes sense because Pulse is a mixer intended to abstract the HW and mix multiple sources and pass them to the real HW module which is Alsa.


So how about those endless warnings in the logs about "Not syncrhonized, Buffer way too early"??? Looks like a bug to me.

Rémi Denis-Courmont
Developer
Developer
Posts: 15265
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: SPDIF passthrough 5.1 not working

Postby Rémi Denis-Courmont » 06 Jun 2012 16:38

You're wrong. I wrote the PulseAudio and ALSA output plugins, so I think I know what I am talking about.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

Snowdog
New Cone
New Cone
Posts: 4
Joined: 06 Jun 2012 03:33

Re: SPDIF passthrough 5.1 not working

Postby Snowdog » 06 Jun 2012 16:50

Where specifically am I wrong?

Are you saying Pulse isn't a Mixer that sits on top of Alsa? AFAIK Pulse is an upper layer abstraction. It could sit on different lower layer subsystems, but on most Linux systems, it sits on top of Alsa, giving mixing/multi source capabilities (irrelevent for passthrough).

Do I need to show screen shots as proof that Pulse in VLC shows NO SPDIF checkbox and no device selection?

Alsa Prefs - SPDIF/Device options.
Pulse Prefs - No SPDIF or Device options.

Selecting Pulse routes DTS/DD to Analog outputs.
Selecting Alsa with SPDIF/ALC888, routes DTS/DD through optical passthrough.

Are you going to address the "Not Syncrhonized" log flood at all?

Rémi Denis-Courmont
Developer
Developer
Posts: 15265
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: SPDIF passthrough 5.1 not working

Postby Rémi Denis-Courmont » 06 Jun 2012 19:23

There are no settings for S/PDIF in the Pulse plugin preferences any more than device selection or channel mapping, since all of that is stored in the PulseAudio configuration.

As for the ALSA bug, it will be addressed when someone figures out what the problem is, and solves it with a patch. I don't have S/PDIF hardware, so someone is definitely not going to be me.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

Snowdog
New Cone
New Cone
Posts: 4
Joined: 06 Jun 2012 03:33

Re: SPDIF passthrough 5.1 not working

Postby Snowdog » 08 Jun 2012 03:04

Ok. Thanks. It does seem like there is a real issue with VLC/Alsa, hopefully fixed someday. Pulse isn't a practical solution for SPDIF on my system.

kmf31
Cone that earned his stripes
Cone that earned his stripes
Posts: 308
Joined: 11 Mar 2007 21:47

Re: SPDIF passthrough 5.1 not working

Postby kmf31 » 04 Jul 2012 01:59

Pulse isn't a practical solution for SPDIF on my system.
It is actually quite easy once you understand how it works. You configure vlc to use pulseaudio (preferences or the option "--aout pulse") and provided that your pulseaudio configuration automatically recognizes your digital audio connection (optical, coax or hdmi) you can use the graphical tool "pavucontrol" (if not installed by default it should be easy to add in any recent distribution) to do several things, especially:

1) associate vlc audio output directly to the appropriate audio card and device

2) and check the boxes for ac3 and eac3 passthrough in which case you will directly have ac3 transmission to your amplifier.

At least with ac3 it works well. When using pulse, vlc does not manipulate (decode, downmix etc.) the ac3-sound and transmits it directly (as ac3 and even without the "--spdif" option) to the pulsedriver who takes care to transform it to pcm (if necessary or configured in that way) or to transmit the ac3 stream to the amplifier (if the box "ac3" in pavucontrol is checked).

The real complications arise if you want to transcode other sources (mp3, AAC, ...) to ac3 or if you have an NVIDIA hdmi-video card. In the first case you need a more subtle alsa and pulse configuration:
http://fransdejonge.com/2011/04/dolby-d ... ulseaudio/
and you need to install the a52-pluging for alsa (which is not installed by default on standard Linux distributions due to patent limitations).
In the second case, pulse has some issues to detect automatically the proper Nvidia-hdmi device (there are 4 of them on the card but only is usable and you have to find out which one) but for this there are also solutions (to charge manually the exact hdmi device in pulseaudio).



Concerning, eac3 I still have a problem in my configuration where I have an HDMI cable from the video-card (with a virtual audio-spdif-device) connected to the TV which itself is connected by a coaxial cable to my amplifier. In this configuration the TV takes care of the transmission of ac3 streams to the amplifier without modification.
However, I have the impression that for eac3 the TV decodes the eac3 stream to pcm (as it does with DTS, that I know for sure) and the amplifier only sees pcm due to the TV decoding. So my eac3 problem is not due to vlc (at least I believe).

However, I can use pulse and alsa (as described by the above link) to transcode the 5.1 eac3 to 5.1 ac3 streams which is well transmitted by my TV to the amplifier.

Is there a possibility that vlc itself may transform eac3 to ac3 for the use with pulse (or alsa with spdif-option) in an easy way, by some simple option ? I suppose with the proper streaming-transcoding options this should be possible in a more complicated way.


Concerning the spdif option with the alsa driver of vlc I have observed (for vlc-2.0.1 and vlc-2.0.2) that

1) vlc --spdif file.ac3,
where file.ac3 is a pure file of a 5.1 ac3 stream, works well for the transmission of ac3 to the spdif connection. (With vlc-2.0.0 this does not work, i.e. no audio, neither pcm nor ac3 transmission).

2) however: vlc --spdif file.mpg,
where file.mpg is a combined file with mpeg2 video and ac3-audio in PS format (created by mplex) does NOT work at all for audio: no ac3 transmission neither pcm transcoding ! The same holds for .vob files with ac3-audio taken from a DVD.

So in my opinion there is indeed an issue with the spdif option for certain file formats with ac3 audio tracks, an issue which was partially resolved between vlc-2.0.0 and vlc-2.0.1 for pure ac3 files but not for mpg or vob files.


Return to “VLC media player for Linux and friends Troubleshooting”

Who is online

Users browsing this forum: No registered users and 15 guests