S/PDIF, Pulseaudio and a52 encoder
FedoraForum.org - Fedora Support Forums and Community
Results 1 to 6 of 6
  1. #1
    Join Date
    Jan 2007
    Posts
    94

    S/PDIF, Pulseaudio and a52 encoder

    I recently had to upgrade my home theater audio receiver. I updated from an aging JVC which had a DVD audio input for 6 analog channels. I had my Fedora 26 PC connected via an internal PCI Delta 1010LT card, sending analog FL, FR, LS, RS, C, LFE. My new Onkyo receiver does not have 6 analog inputs, so I have to resort to S/PDIF with the a52 encoder.

    I got this working (with severe issues, more later) but there are so many conflicting ways to do it. Most of the methods I have used in my attempt to make this work mostly came from the world of Debian/Ubuntu, as there is very little information on a Fedora method.

    By default in the Fedora 26 alsa-plugins-freeworld-a52 package, it installs the config for a52 in the /etc/alsa/pcm/ folder. AC3 playout does not even show up as a device option using this a52.conf file (or even if it's being loaded). It does nothing, as far as I can tell.

    Code:
    # a52 plugin configuration
    # $Id$
    
    pcm.myout {
            type a52                # Default :
            card 0                  # 0
            rate 48000              # 48000
            channels 6              # 6
            bitrate 448             # 448
            format S16_BE           # S16 (Native-Endian)
            hint {
                    description "Dolby Digital AC3 5.1 Encoder Plugin"
            }
    }
    So, resorting to the Ubuntu method, I created ~/.asoundrc file containing this:

    Code:
    pcm.a52 {
      @args [CARD]
      @args.CARD {
        type string
      }
      type rate
      slave {
        pcm {
          type a52
          bitrate 448
          channels 6
          card $CARD
        }
      rate 48000 #required somehow, otherwise nothing happens in PulseAudio
      }
    }
    It did nothing.

    Then, I read that I should add the code to /usr/share/alsa/alsa.conf.d/a52.conf instead. I did, and it worked...well sort of., so I continued to try other methods.....So, I finally moved that code to the /etc/asound.conf file. It worked exactly the same way.

    The problem is, it works great for a period of time. That time can vary from a few minutes of viewing to several hours. Then the audio starts breaking up badly, stuttering like, but definitely not acceptable or usable. The ONLY way to fix it is to reboot. Even renaming /etc/asound.conf with .bak and restarting pulseaudio -k, the device does disappear in pulseaudio. I would think anything to do with a52 would be pushed out and not loaded at this point. Then, I rename the /etc/asound.conf back to its recognized name, and do a pulseaudio -k, the device does come back in the device list, but it is still stuttering. Reboot, all is well again.

    I have been a few weeks trying to solve this problem, with no luck.

    I would love to find a way to reset alsa without rebooting. It would certainly make troubleshooting much easier. in Debian, they actually have a /usr/bin/alsa command to do this. We don't.

    What is the best way to troubleshoot this? I cannot even find a process to kill, with the sole exception of pulseaudio.

    Thanks,
    Last edited by LexRidge; 28th January 2018 at 04:46 AM.

  2. #2
    Join Date
    Aug 2011
    Location
    ~
    Posts
    1,940

    Re: S/PDIF, Pulseaudio and a52 encoder

    I know nothing about this yet, but I will make a similar attempt one of these days.
    Does this thread help? https://ubuntuforums.org/showthread.php?t=1608804&
    It is very old but has some info about the pulseaudio Gnome configuration utility being broken (missing some profile).
    Here's another thread that's more recent and clearer: https://forums.opensuse.org/showthre...uration-issues

    Of course I really should get a proper hdmi / uncompressed receiver, but hey the old one still works and we've long ago hit the peak of audio tech in my opinion nor do I really care for it any more so why needlessly throw more money at it?
    Last edited by Dutchy; 28th January 2018 at 01:08 PM.

  3. #3
    Join Date
    Jan 2007
    Posts
    94

    Re: S/PDIF, Pulseaudio and a52 encoder

    Thank you for your reply. I had tried the first post you mentioned, and that is what got it working. And when it does work, it works great! It is just that it does always eventually go bad. The second link looked very interesting. using DCA (DTS) encoding rather than A52. So I set that all up and compiled it according to link. However, it works even worse that the a52 encoder. I cannot get any sound at all from it. The receiver is going crazy with PCM locking and unlocking. I have not given up yet, but will try a few other things before throwing in the towel.

  4. #4
    Join Date
    Jan 2007
    Posts
    94

    Re: S/PDIF, Pulseaudio and a52 encoder

    I did finally get the dca (DTS) encoder working. However it is no more usable than the a52 encoder. I am wondering if there is some sort of adjustment in pulseaudio to change the latency or something. It's a long shot I think, but I would really like to fix this.

  5. #5
    Join Date
    Jan 2007
    Posts
    94

    Re: S/PDIF, Pulseaudio and a52 encoder

    Possibly good news. I think I got it working. I uncommitted these lines in /etc/pulse/daemon.conf

    Code:
     high-priority = yes
     nice-level = -11
    
     realtime-scheduling = yes
     realtime-priority = 5
    Then made myself a member of the pulse and realtime groups (from #man pulseaudio). Rebooted, and viola! It appears to be working with zero dropouts. I have only tried the a52 encoder, which as long as it continues to work, I will use. I want to make sure this is actually working well before experimenting anymore, then I will mark this thread as solved.

    EDIT: Still working, but I did forget to mention I had done an update before I did this, and I didn't test it after the update. I only made the changes above first. There is a slight chance the updated kernel may be the fix. More later.
    Last edited by LexRidge; 16th February 2018 at 08:13 AM.
    --
    Fedora 27 x64 - Asus M5A99FX PRO R2.0 - 16GB RAM
    AMD FX 8350 8 Core @4ghz
    Delta 1010LT Audio & Nvidia Quadro K4000 Gfx

  6. #6
    Join Date
    Jan 2007
    Posts
    94

    Re: S/PDIF, Pulseaudio and a52 encoder

    After 24 hours, it finally broke again. I am thinking that running Firefox may be causing it. In numerous tests, 5.1 audio would work fine until I would launch firefox. Then after some amount of time, my audio goes to hell. It may even be flash related. Still not sure. I know that since firefox v52 they stopped supporting ALSA directly, but I doubt that is the cause, or the reason. I will refrain from running FF for a few days and use Chrome to see if my theory is correct. It is still very unusual that nothing except a reboot restores the audio.
    --
    Fedora 27 x64 - Asus M5A99FX PRO R2.0 - 16GB RAM
    AMD FX 8350 8 Core @4ghz
    Delta 1010LT Audio & Nvidia Quadro K4000 Gfx

Similar Threads

  1. S/PDIF With VLC
    By wmdejen in forum Using Fedora
    Replies: 0
    Last Post: 26th November 2009, 09:44 PM
  2. s/pdif
    By cdt24 in forum Using Fedora
    Replies: 0
    Last Post: 22nd March 2008, 05:44 AM
  3. dvd ripper & encoder
    By peacefulone in forum Using Fedora
    Replies: 6
    Last Post: 22nd January 2007, 04:07 AM
  4. DTS or Dolby 5.1 Encoder?
    By December in forum Using Fedora
    Replies: 1
    Last Post: 13th January 2006, 12:42 AM
  5. WAV encoder
    By karima in forum Using Fedora
    Replies: 2
    Last Post: 19th August 2005, 10:27 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •