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.