No output for AC3
Sorry if this is not the proper place to ask, I'm gratefully taking any other suggestions.
I use a toslink table from my computer to a Logitech z906 system, which can decode AC3 (as proven in Windows which is installed in parallel). If I select "Digital Stereo (IEC958)", I'm getting stereo output. Also, I can play a special AC3 test file (avi) via VLC and get a proper decoding of 5.1 (obviously passed thru).
I assume that if I select "Digital Surround 5.1 (IEC958/AC3)", the A52 plugin is used. However, I get nothing but silence from the 6 speakers when I do the test, and when I try any other application. I am using pulseaudio (probably as in most installations today); I don't know whether this is important.
I thought that the A52 plugin must be configured in .asoundrc before I learned that this is already done in /etc/alsa/conf.d/60-a52-encoder.conf. Moreover, the manuals for A52 and configuration do not reveal a lot, in particular for troubleshooting.
This has been fixed since v1.2.5 was released, but I can't get it working with pipewire. With the latest code in master speaker-test does work directly with ALSA.
I just had a look; I am using the alsa release 1.2.5-1.2 (on openSUSE Tumbleweed).
When I do a "speaker-test -Dplug:a52 -c6" it seems to lock up (checks "0 - Front Left", but no further reaction, no output, ignores CTRL-C).
I don't really understand how to pass args to the plugin; I keep getting parse errors. There are two IEC958 connections:
iec958:CARD=PCH,DEV=0 HDA Intel PCH, ALC1220 Digital IEC958 (S/PDIF) Digital Audio Output
iec958:CARD=Creative,DEV=0 HDA Creative, CA0132 Digital IEC958 (S/PDIF) Digital Audio Output
@mizapf You probably really do need the a52 patches since v1.2.5. The current release version doesn't work with the release version of ffmpeg.
@mizapf Since they are both iec958 devices (not HDMI) you should be able to use the "card" parameter:
pcm.a52creative {
type a52
card "Creative"
hint.description "AC3 over iec958 on Creative sound card"
}
Just put that in your asound.conf and it should work. The autoconfig doesn't work for me.
Test command:
CARD=1 # replace with your IEC958 card
DEVICE=10 # replace with your IEC958 PCM device number
speaker-test -b 2000000 -c 6 -D"plug:{SLAVE=\"a52:${CARD},'hw:${CARD},${DEVICE}'\"}"
OK, aplay -l delivers: $ aplay -l **** List of PLAYBACK Hardware Devices **** [...] card 0: PCH [HDA Intel PCH], device 1: ALC1220 Digital [ALC1220 Digital] Subdevices: 1/1 Subdevice #0: subdevice #0 [...] card 2: Creative [HDA Creative], device 1: CA0132 Digital [CA0132 Digital] Subdevices: 1/1 Subdevice #0: subdevice #0
So I guess CARD=0; DEVICE=1 is the on-board S/PDIF output, and CARD=2; DEVICE=1 is the S/PDIF output of the Creative card. I take your command line as above for speaker-test.
In both cases (plugging the toslink cable appropriately), the Logitech surround decoder indicates that there is an AC3 signal ("DECODE" LED lights up as soon as speaker-test is invoked), but the speakers remain silent. If I do a simple speaker-test on two channels directly (without a52), I can hear the pink noise.
Also, when I watch DVB TV channels which provides an AC3 audio stream, this is properly decoded by the Logitech decoder, including full 5.1 channels. Thus I guess the problem is on the AC3 encoder side.
Add -d argument to the speaker-test command (debug output) and show it.
Using -d causes a write error. The output is silent in both cases.
$ CARD=2; DEVICE=1 $ speaker-test -d -b 2000000 -c 6 -D"plug:{SLAVE="a52:${CARD},'hw:${CARD},${DEVICE}'"}"
speaker-test 1.2.5.1
Playback device is plug:{SLAVE="a52:2,'hw:2,1'"}
Stream parameters are 48000Hz, S16_LE, 6 channels
Using 16 octaves of pink noise
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 3072 to 1047552
Period size range from 1536 to 1536
Using max buffer size 1047552
Periods = 4
was set period_size = 1536
was set buffer_size = 1047552
Plug PCM: Copy conversion PCM
Its setup is:
stream : PLAYBACK
access : RW_INTERLEAVED
format : S16_LE
subformat : STD
channels : 6
rate : 48000
exact rate : 48000 (48000/1)
msbits : 16
buffer_size : 1047552
period_size : 1536
period_time : 32000
tstamp_mode : NONE
tstamp_type : GETTIMEOFDAY
period_step : 1
avail_min : 1536
period_event : 0
start_threshold : 1047552
stop_threshold : 1047552
silence_threshold: 0
silence_size : 0
boundary : 9214364837600034816
Slave: A52 Output Plugin
Its setup is:
stream : PLAYBACK
access : MMAP_NONINTERLEAVED
format : S16_LE
subformat : STD
channels : 6
rate : 48000
exact rate : 48000 (48000/1)
msbits : 16
buffer_size : 1047552
period_size : 1536
period_time : 32000
tstamp_mode : NONE
tstamp_type : GETTIMEOFDAY
period_step : 1
avail_min : 1536
period_event : 0
start_threshold : 1047552
stop_threshold : 1047552
silence_threshold: 0
silence_size : 0
boundary : 9214364837600034816
0 - Front Left
Write error: -5,Input/output error
xrun_recovery failed: -5,Input/output error
Transfer failed: Input/output error
Without -d:
$ speaker-test -b 2000000 -c 6 -D"plug:{SLAVE=\"a52:${CARD},'hw:${CARD},${DEVICE}'\"}"
speaker-test 1.2.5.1
Playback device is plug:{SLAVE="a52:2,'hw:2,1'"}
Stream parameters are 48000Hz, S16_LE, 6 channels
Using 16 octaves of pink noise
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 3072 to 1047552
Period size range from 1536 to 1536
Requested buffer time 1000000 us
Periods = 4
was set period_size = 1536
was set buffer_size = 47616
0 - Front Left
4 - Front Center
1 - Front Right
3 - Rear Right
2 - Rear Left
5 - LFE
Time per period = 16.903296
0 - Front Left
(Stopped by CTRL-C)
It seems that you're using the old version of the a52 plugin (alsa-plugins package).
EDIT: There are many fixes after 1.2.5.1 in the current repository. I hope to release 1.2.6 soon.
rpm -qa | grep a52
a52dec-0.7.5+svn613-3.12.x86_64 alsa-plugins-a52-1.2.5-1.2.x86_64 liba52-0-0.7.5+svn613-3.12.x86_64
OK, let's wait for 1.2.6.
(sorry, the leading hash in the first line (#) somehow created a heading)