Why Surround FLACS only play properly using VLC (via SPDIF A52)?

Hi,

Could somebody help me sort out audio configuration.

My problem is described at second part of this post.

INTRO (might be useful for somebody trying to set up Dolby Digital via SPDIF):

Yesterday I’ve been battling whole day to set up A52 (Dolby Digital) via SPDIF (TOSSLINK if that matters) to send to my AVR. Finaly I’ve sort of got this working, but I am not sure what did the trick.

Roughly:

  1. added this to my ~/.asoundrc
# Use DCA Plug In
# 
<confdir:pcm/dca.conf>

#####
# Description: This will make it possible to use a52 with PulseAudio out of 
#          the box. It may be useful for other use cases. Just include 
#          this in your ~/.asoundrc .

pcm.a52 {
    @args [ CARD ]
    @args.CARD {
               type string
               default 0
    }
    type rate
    slave {
           pcm {
               type a52
               channels 6
               bitrate 448 # default 448
               card $CARD
           }
    # Convert to S16 bit format, per SPDIF spec
    # format S16_LE # Required for current S/PDIF spec
    rate 48000
    }
}
  1. Installed libdca from AUR
  2. Installed pavucontrol
  3. Set Phonon to use SPDIF Digital Stereo
  4. Via pavucontrol in Configuration chose Profile for my card as Digital Stereo (IEC958)
  5. In Output Devices (pavucontrol) near my cards digital output was able to click Advanced and select A52
  6. In pavucontrol Configuration there appeared an option to select Profile “Digital Surround 5.1 (IEC958/AC3)”, which I Did
  7. Set Phonon to prefer Digital Surround 5.1

Not sure if the order is correct, with loads of reboots/logouts and “killall pulseaudio” in between.
Anyway, sounds started coming from my speakers hooked up to AVR and Dolby Digital sign has lit up on it’s panel.

Now I was trying to play some 5.1 FLACS I have. But:

PROBLEM: 5.1 FLACS (and all stereo recordings, also KDE notification sounds) play simultaneously via all 5 speakers using some kind of up-mix (I’ve tried clementine and JuK for playback), except VLC media player plays 5.1 flacs correctly (Distinct traacks for distinct speakers), while stereo is still upmixed to all 5 channels.

More problems: speaker-test hangs on trying to play, sometimes sound just dissapears until reboot, AC3 files are not played at all even through VLC.

My alsa and pulse fu is not very good, so I’m not sure what I’m doing, it’s living hell all this linux audio stuff. Please if somebody could lend me a hand sorting this out.

My prefered Phonon backend is GStreamer, but I did install VLC backend jut to test, which led to even more audio weirdiness.

Thanks

OK there are a couple of things to do, pavucontrol will not be necessary after the following changes, however, it does’t hurt anything to have it installed:

First, I don’t think you needed to add or edit ~/.asoundrc but i’m not sure on this one, to check just rename it to ~/.asoundrc.backup, if you did need that change after the other changes listed here then just rename it back.

Second, open /etc/pulse/default.pa as root:
sudo kate /etc/pulse/default.pa
and remove the # from this line: load-module module-switch-on-port-available
and save. you’ll need to restart pulse for this to take effect, this will switch the output of pulse automatically when things are plugged in and out.

Third, the speaker test in Phonon requires libcanberra, libcanberra-pulse, libcanberra-gstreamer, lib32-libcanberra & lib32-libcanberra-pulse to be installed to work properly.

Fourth, Gstreamer will need all codecs installed (not installed by default), make sure the bad & ugly packages including extra plugins are installed for both version 0.10.x and 1.x, also libdca is in the extra repository and will be installed by gstreamer0.10-bad-plugins, there was no need to build it from AUR.

Phonon should now be able to control Pulse Audio properly without the need for pavucontrol.
Let me know if these changes help.

Thanks,

I’ve removed comment from module-switch-on-port-available, did not notice any changes yet, still got upmixing done in clementine. But after installing libcanberra-pulse, libcamberra-gstreamer and reboot - speaker test started working properly, I do hear distinct test from proper speakers now, so it’s a step forward.

I just modified my first post.
PS. I have a bad habit of editing, saving, & editing as I go, just how my mind works. :slight_smile:

NP mate,

I did install everything gstreamer related (ugly plugins were not there), including 32 bit gstreamer, did a reboot, not sure what helped but now in Juk and Banshee are playing FLAC’s properly. Still clementine upmixes them, so I guess I can write it down to some clementine issue. I’ll use banshee for time being, anyway most of things are working now.

Thanks again for your help.

There are no ugly-plugins just base & bad have plugins, so your good there. I can’t find any reference to 5.1 audio in clementine anywhere, I’m beginning to think it only supports stereo audio files,