Closed quequotion closed 2 years ago
Volunteer?
I'd love to see some attention paid to documenting the setup process when transmitting an A52 bitstream over HDMI; the default setup (on my distro, at least) only seems to support S/PDIF.
We know HDMI is fully supported at the kernel level, because various media players, such as mplayer, can pass A52 through, but there's something about the plugin stack (either the default config, or the internal implementation) that doesn't handle that use case correctly (for general usage via pulseaudio, etc)
It caused me no end of hair pulling last time I tried to figure it out.
(This arises because some TVs only accept 2-channel PCM but support surround in bitstream compressed formats. I'd send 5.1 channel L-PCM if I could, but that won't work when my TV is directly connected to my HDMI port and attempting to relay to the receiver over ARC.)
I could give a crack at this, but there's a lot I don't understand, and we need someone with the hardware to test a52 over HDMI to demonstrate it working.
First question:
Where are the strings that users can define for "format" in a manual configuration defined? The example is written when only s16 was supported, so mentions "S16_LE" and “S16_BE". Isn't it possible now to define "S32_LE/BE" and "FLOAT" (or "FLTP"?)
No, the format parameter in a52 config is about the output format, and this is only 16bit format per definition of AC3. The input format is fixed, you can't change anything in the configuration. The text about the input format needs correction, though (formerly only native endian S16, but now only native endian S32 with the recent ffmpeg).
There shouldn't be too much difference between HDMI output and SPDIF output, and the likely reason of non-working case is the lack of proper IEC958 status bits (especially the non-audio bit). It's often that an SPDIF receiver accepts raw signals even if you forget to set the non-audio bit in IEC958 status control, while it's mandatory for HDMI.
The input format is fixed, you can't change anything in the configuration. The text about the input format needs correction, though (formerly only native endian S16, but now only native endian S32 with the recent ffmpeg).
The input float stream is also supported now (if you force the ac3
encoder instead ac3_fixed
using new avcodec
field or if the fixed encoder is not enabled in the ffmpeg library).
Clarification, this was changed:
1) input format is fixed according the format used in the ffmpeg library (codec ac3_fixed: s16 for old, s32 for recent, codec ac3: float)
2) a global configuration /usr/share/alsa/alsa.conf.d/60-a52-encoder.conf was introduced which defines the a52
PCM (see source https://github.com/alsa-project/alsa-plugins/blob/4219f4b3fded74d7b07a54c3ba8661d7a18c3b6c/a52/60-a52-encoder.conf for accepted arguments)
It's often that an SPDIF receiver accepts raw signals even if you forget to set the non-audio bit in IEC958 status control, while it's mandatory for HDMI.
Somewhat off-topic for this thread, but do you think then, that a user wishing to pipe the a52 plugin's output over HDMI could use the iecset utility to get the autoconfiguration working for their device by setting that bit?
PR was merged. Thank you.
a52.txt hasn't been changed in fifteen years.
In that time, a preconfiguration has been supplied that ends up getting merged into a dysfunctional mess if users add a manual configuration to their asound.conf without prepending an exclamation point to override it, and more recently more sample formats have been added.
This file needs some attention.