Arch Linux

Please read this before reporting a bug:

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!

FS#60586 - [alsa-plugins] ffmpeg changes mean a52 plugin not built

Attached to Project: Arch Linux
Opened by WorMzy Tykashi (WorMzy) - Thursday, 25 October 2018, 19:00 GMT
Last edited by David Runge (dvzrv) - Saturday, 19 February 2022, 20:03 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Jan Alexander Steffens (heftig)
Anatol Pomozov (anatolik)
David Runge (dvzrv)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 11
Private No


Due to libavresample is no longer packaged. This means that alsa-plugins fails to enable libav support, as pkg-config can't find libavresample.pc:;a=blob;;h=ecc4c7ad8c9f7a57cb2b6282d7c37c9df7257b01;hb=be05d99cf84ef0c7819793a8b49a93d9e9f5ce8b#l96

Looks like libavresample is only needed for the rate-lav plugin ($srcdir/rate-lav/rate_lavrate.c), and simply replacing libavresample with libswresample doesn't work, presumably it isn't a drop-in replacement. It can, however, be disabled with the --disable-lavrate configure flag, and if the libavresample reference is removed from in prepare(), the rest of the ffmpeg plugins build fine.

So I suggest either
1) dropping ffmpeg make/opt deps until upstream migrates to libswresample, or splits up the pkgconfig checks, or
2) Modifying to remove the libavresample check, and using --disable-lavrate to bypass building the plugin that needs it.

No idea which option is preferable, but at least one user has noticed the a52 plugin's absence:

(Sorry for the rambling bug report, I'm fighting a virus, hopefully it still makes sense.)
This task depends upon

Closed by  David Runge (dvzrv)
Saturday, 19 February 2022, 20:03 GMT
Reason for closing:  Fixed
Additional comments about closing:  Fixed with alsa-plugins 1:1.2.6-2
Comment by loqs (loqs) - Thursday, 25 October 2018, 19:35 GMT
Patch does not apply sorry for the noise it was was from the addition of libavresample not switching from it.
Implement WorMzy point 2 change configure detection so the a52 plugin does not need libavresample but the rate plugin does.
Comment by Florian H (Sylence) - Sunday, 28 October 2018, 09:26 GMT
  • Field changed: Percent Complete (100% → 0%)
Digital Surround 5.1 output (IEC958/AC3) via a52 is still missing for me in 1.1.7-2.
Last working version is 1.1.6-2.
Comment by Jan Alexander Steffens (heftig) - Sunday, 28 October 2018, 09:34 GMT
This needs more work; reverted because of
Comment by Que Quotion (quequotion) - Monday, 29 October 2018, 15:55 GMT
I didn't find this report before coming up with my own workaround, by adding libavresample to ffmpeg rather than removing lavrate from alsa-plugins.

I was under the impression that the rate plugin is also required for the a52 plugin to operate.

The plugin, version 1.1.7, does not load, at least not with the most commonly suggested configuration (attached).

Pulseaudio rejects this configuration, stating "(alsa-lib)pcm_rate.c: Unknown field card"; even if the line "card $CARD" is not present.

The only configuration I could find that would activate the a52 plugin, version 1.1.7, is this:

pcm.a52 {
type a52

Unfortunately, this is also unusable. Pulseaudio experiences thousands of underruns per second, then crashes.

It's possible the way to configure this plugin has changed.
Comment by Confounded (Confounded) - Monday, 05 November 2018, 02:00 GMT
Hopefully this will be fixed soon but for now using from alsa-plugins-1.1.6-2 still works with the newer builds.
Comment by David Runge (dvzrv) - Wednesday, 22 January 2020, 22:00 GMT
It seems at the end of last year a little bit of movement has happened in regards to this problem [1].

I've applied the patch for libswresample and pushed a package to [testing].
Please test (also in regards to  FS#60616  [2]) and report any problems you find!

Comment by Giovanni Harting (IdleGandalf) - Thursday, 23 January 2020, 10:20 GMT
Author of this patchset here.

Getting a52 to work again also means to apply the patch for alsa-lib, since for whatever reason, the config parsing of 'rate' got broken somewhere >=1.1.7. Applying only the alsa-plugin patch gave me no usable configuration, no configuration at all leads to underruns in alsa and a guaranteed crash somewhere down the line.

I already tried to find a proper fix for that config parsing, but my time was limited and I was not familiar with alsa's whole codebase, I ended up with the workaround described. It should work for most configs out there.
(Also that was the reason I haven't posted it here, I consider it more a workaround then a proper fix.)
Comment by Darek (blablo) - Friday, 24 January 2020, 22:10 GMT
Please fix alsa-plugins 1.2.1-3/lib32-alsa-plugins 1.2.1-2

output:My ALSA [1393]: segfault at 0 ip 00007f5317c036f5 sp 00007f530918c4a8 error 4 in[7f5317ac7000+14d000]
Comment by Que Quotion (quequotion) - Saturday, 28 March 2020, 16:14 GMT
For the interim, an AUR package with Giovanni's workaround:
Comment by David Runge (dvzrv) - Tuesday, 08 June 2021, 19:32 GMT
@IdleGandalf: I have not followed upstream developments on this topic. Have your patches been included?
Comment by Giovanni Harting (IdleGandalf) - Tuesday, 08 June 2021, 21:06 GMT
@dvzrv Sadly not yet, no. I was hoping to fix the config issue early this year, but since I have no access to a pcm port atm I can't really test it. The libswresample patch, which was tested, was ignored as well, unfortunately.
Comment by David Runge (dvzrv) - Tuesday, 08 June 2021, 21:12 GMT
@IdleGandalf: Ah, too bad! However, as upstream now also supports pull requests on github, maybe that way it will be easier to gain traction for the required change?
Comment by Giovanni Harting (IdleGandalf) - Wednesday, 16 June 2021, 07:32 GMT
We have some movement upstream, partly thanks to @quequotion:

Seems like a52 also getting the fixes it needs after it recently got broken, maybe we get back to upstream support out of the box someday soon.
Comment by Giovanni Harting (IdleGandalf) - Friday, 18 June 2021, 17:03 GMT Comment by Que Quotion (quequotion) - Saturday, 19 June 2021, 11:46 GMT
Indeed, this is fixed upstream.

Regarding that, I have a request for @dvzrv and @anatolik about the next packaging of alsa-plugins:

This package needs to have ffmpeg added to makedepends() to build the a52 plugin.

Now that upstream has adopted IdleGandalf's libswresample patch, and the a52 plugin's compatibility with up-to-date releases of ffmpeg has been resolved, there is no reason not to do this.
Comment by Que Quotion (quequotion) - Saturday, 19 June 2021, 12:37 GMT
*snip, accidental duplication*
Comment by Giovanni Harting (IdleGandalf) - Saturday, 19 June 2021, 15:43 GMT
@quequotion I think they know, it was only removed from makedep as no fully working patch was available. See commit
Comment by Sergei (randomei) - Sunday, 19 December 2021, 18:35 GMT
With alsa-plugins 1.2.6 there should be no problem building it with a52 plugin.
Comment by Anatol Pomozov (anatolik) - Monday, 20 December 2021, 22:58 GMT
I rebuilt alsa-plugins with a52 enabled. Pushed alsa-plugins-1:1.2.6-2 to [testing]. Please try it and let me know if it works as expected.
Comment by Sergei (randomei) - Thursday, 23 December 2021, 07:29 GMT
It's working. Thank you!