Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Config file for a52 plugin (60-a52-encoder.conf) produces no/garbled sound via optical digital out (S/PDIF) #38

Open
iils-jschmidt opened this issue Nov 2, 2021 · 4 comments

Comments

@iils-jschmidt
Copy link

iils-jschmidt commented Nov 2, 2021

Dear Maintainer,

this bug was originally reported on the debian tracker. They advised me to post it here.
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=998125

  • What led up to the situation?
    Fresh Debian 11 install. I want to output 5.1 sound via toslink.
    Used KDE settings to switch from analog output to digital out 5.1.
    This produced no or garbled sound and Youtube videos would play back way to fast without sound.
    Then I switched to digital out stereo, this worked as expected but only stereo.

I could trace back the error to the shipped config file for alsa's a52 plugin: 60-a52-encoder.conf.

When I replaced that file with a much simpler one (see below) 5.1 digital out worked as expected.

I tried with onboard sound (PCH9) and dedicated card (Audigy Z) with the same result, the inlcuded a52 config file does not work.

== Start working a52.conf

pcm.a52 {
  @args [CARD]
  @args.CARD {
    type string
  }
  type rate
  slave {
    pcm {
      type a52
      bitrate 448
      channels 6
      card $CARD
    }
  rate 48000
  }
}

== End working a52.conf

Therefore I assume the shipped config file with debian has an error somewhere. Please fix this.

Best reagards
Jens

-- System Information:
Debian Release: 11.1
Architecture: amd64 (x86_64)

Kernel: Linux 5.14.0-0.bpo.2-amd64 (SMP w/4 CPU threads)
Kernel taint flags: TAINT_UNSIGNED_MODULE
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8), LANGUAGE=en_US:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages libasound2-plugins depends on:
ii libasound2 1.2.4-1.1
ii libavcodec-extra58 [libavcodec58] 7:4.3.2-0+deb11u2
ii libavresample4 7:4.3.2-0+deb11u2
ii libavutil56 7:4.3.2-0+deb11u2
ii libc6 2.31-13+deb11u2
ii libjack0 [libjack-0.125] 1:0.125.0-3+b1
ii libpulse0 14.2-2
ii libsamplerate0 0.2.1+ds0-1

@perexg
Copy link
Member

perexg commented Nov 2, 2021

Your config is using extra rate plugin. The default config is not using any rate conversion.

Could you test with the command line ALSA tools like speaker-test or aplay with the debug output?

Do you use pulseaudio? If so, show pactl list sinks (filter only a52) output for the working / non-working case.

@perexg
Copy link
Member

perexg commented Nov 2, 2021

Test command:

CARD=1         # replace with your IEC958 card
DEVICE=10      # replace with your IEC958 PCM device number
speaker-test -d -b 2000000 -c 6 -D"plug:{SLAVE=\"a52:${CARD},'hw:${CARD},${DEVICE}'\"}"

@iils-jschmidt
Copy link
Author

Ok took some time here are the outputs. aplay -l reports the iec device as:
card 3: Creative [HDA Creative], device 1: CA0132 Digital [CA0132 Digital] Subdevices: 1/1 Subdevice #0: subdevice #0

speaker-test produced some text output with the original config (not working) but no sound.
With the config shown above (working) speaker test could not "use" the device.

Yes debian uses pulseaudio, I attached all files.
pulseaudio_sinks_NOT_working.txt
pulseaudio_sinks_working.txt

speakertest_notworking_config.txt

speakertest_working_config.txt

@quequotion
Copy link
Contributor

quequotion commented Dec 27, 2021

I am curious if @JensGW isn't doing the same thing I, and many others, used to do, since no one got the memo about how the new configuration file was meant to (not) work with manual configuration files.

For some time, it was normal to have an asound.conf with a pcm.a52 node using the rate plugin to establish the 5.1 AC3 sink. Later, when these existing configurations were applied over the newly installed default configuration (60-a52-encoder.conf), some random things occurred: for quite a while it worked as if nothing had changed, then it would break after an upgrade of one of the dependents like ffmpeg or alsa, then it just stopped making sound completely. It was only after it became totally irrevocable that I finally looked up what was going on upstream. @JensGW indicates libasound2 1.2.4 is installed; does that mean also alsa-plugins (not sure what Debian calls it) 1.2.4?

Anyway, what I learned was that if you want to use a manual configuration in your asound.conf, you must override the default configuration by prepending it with an exclamation point pcm.!a52, but odds are you don't need any manual configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants