Opened 5 years ago

Closed 5 years ago

#363 closed defect (fixed)

libavcodec 0.7.1 breaks libasound_module_pcm_a52.so (from libasound2-plugins)

Reported by: piru Owned by:
Priority: normal Component: avcodec
Version: 0.7.1 Keywords: libavcodec alsa a52 ac3 libasound2-plugins
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

It appears that the libavcodec 0.7.1 broke alsa AC-3 encoding. After the upgrade a setup that was working just fine before became silent. Debugging it I ran into this:

$ aplay /home/user/music/5_DRAX_-_Resolution_R3\&R4AR.wav
Playing WAVE '/home/user/music/5_DRAX_-_Resolution_R3&R4AR.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo
[ac3 @ 0x1a72360] Specified sample_fmt is not supported.
aplay: set_params:1116: Unable to install hw params:
ACCESS:  RW_INTERLEAVED
FORMAT:  S16_LE
SUBFORMAT:  STD
SAMPLE_BITS: 16
FRAME_BITS: 32
CHANNELS: 2
RATE: 48000
PERIOD_TIME: 32000
PERIOD_SIZE: 1536
PERIOD_BYTES: 6144
PERIODS: 10
BUFFER_TIME: 320000
BUFFER_SIZE: 15360
BUFFER_BYTES: 61440
TICK_TIME: 0
$ sudo dpkg -i libavcodec52_0.6.3-0.0_amd64.deb
dpkg: warning: downgrading libavcodec52 from 5:0.7.1-0.0 to 5:0.6.3-0.0.
(Reading database ... 218630 files and directories currently installed.)
Preparing to replace libavcodec52 5:0.7.1-0.0 (using libavcodec52_0.6.3-0.0_amd64.deb) ...
Unpacking replacement libavcodec52 ...
Setting up libavcodec52 (5:0.6.3-0.0) ...
$ aplay /home/user/music/5_DRAX_-_Resolution_R3\&R4AR.wav
Playing WAVE '/home/user/music/5_DRAX_-_Resolution_R3&R4AR.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo

...and the audio plays ok now.

I'm using debian unstable and kernel 2.6.39.3 and packages from debian-multimedia.org. I have audio routed via HDMI, and thus I've set up alsa so that all non-AC-3 audio goes thru the a52 encoding:

pcm.Filter_A52Encode {
    type a52
    bitrate 448
    card 0
}
...etc...

I presume something is wrong with libavcodec52 0.7.1 AC-3 encoding since it fails with "[ac3 @ 0x1a72360] Specified sample_fmt is not supported."

I haven't done any further analysis of the issue and it could well be something unrelated to ffmpeg.

Some related package versions:

alsa-utils                        1.0.23-5+b1
libasound2                        1.0.24.1-2
libasound2-plugins                1.0.24-2

Change History (8)

comment:1 Changed 5 years ago by cehoyos

  • Component changed from avcodec to undetermined
  • Priority changed from important to normal
  • Status changed from new to open

Does it work if the provided wav file was encoded with pcm_f32le?

comment:2 Changed 5 years ago by reimar

This is the wrong bug tracker, Debian now packages releases from libav.org, not FFmpeg.
This issue does _not_ exist in FFmpeg.
The AC3 encoder from libav now only supports encoding from float format (yes, a workaround is possible but requires source changes).

comment:3 Changed 5 years ago by reimar

Hm, my conclusion was based on packages.debian.org
However libav 0.7.1 would be libavcodec53...
There is a possibility that the A52 encode plugin sets the sample format to something invalid like SAMPLE_FMT_NONE which we possibly did not check before.
Adding a workaround for that should be simple, though I'd need to verify that first.

comment:4 Changed 5 years ago by reimar

Seems there is no libavcodec52 0.7.1 in Debian unstable.
But anyway, it seems that the ALSA plugin indeed did not set sample_fmt at all.
The fixed it in the meantime, though for 0.7.1 I'd suggest we check for SAMPLE_FMT_NONE and replace it by SAMPLE_FMT_S16 for the 0.7 branch.

comment:5 follow-up: Changed 5 years ago by reimar

Fix committed to 0.7 branch, maybe you can convince whoever made that libavcodec package to update to the latest version from that (or just apply that patch on top of 0.7.1)?

comment:6 Changed 5 years ago by piru

Yes indeed, I use debian-multimedia.org repos for this stuff, not official debian ones. See http://debian-multimedia.org/dists/unstable/main/binary-amd64/

comment:7 in reply to: ↑ 5 Changed 5 years ago by piru

Replying to reimar:

Fix committed to 0.7 branch, maybe you can convince whoever made that libavcodec package to update to the latest version from that (or just apply that patch on top of 0.7.1)?

The updated package indeed fixes the issue. Thanks to all involved!

comment:8 Changed 5 years ago by cehoyos

  • Component changed from undetermined to avcodec
  • Resolution set to fixed
  • Status changed from open to closed
Note: See TracTickets for help on using tickets.