[alsa-devel] a52 plugin + ffmpeg with libswresample

Giovanni Harting 539 at idlegandalf.com
Tue Dec 3 21:12:14 CET 2019


Hello,

I'm working on restoring functionality to the a52 plugin.
ALSA build with ffmpeg without (deprecated) libavresample does not build 
this plugin, since libavresample is missing. Archlinux for example does 
not build with libavresample anymore [1], therefore a52 is missing in 
alsa-plugins builds since that change happened.

I ported rate-lav to libswresample, which seems to work well after a 
month of daily use.

The oddity is that a config file (asoundrc, [2]), that worked fine with 
alsa-lib 1.1.6, does not work with 1.1.7+. I could not find a change 
that causes this.

I traced it down to _snd_pcm_rate_open() in pcm/pcm_rate.c, where 
keywords from within pcm {} are passed into, where it fails with 
"Unknown field card" (for example).

I worked around it by filtering out all keywords [3], but that feels a 
little unclean. Is there a proper way to fix this? I'm not familiar with 
ALSA's config parsing.

I'll submit patches for both once I figured out how to fix this.

[1] https://bugs.archlinux.org/task/60586
[2]
pcm.a52 {
     @args [CARD]
     @args.CARD {
         type string
     }
     type rate
     slave {
         pcm {
             type a52
             bitrate 640
             channels 6
             card $CARD
         }
         rate 48000
         format S16_LE
     }
}

[3]
if (strcmp(id, "bitrate") == 0 || strcmp(id, "rate") == 0 || strcmp(id, 
"card") == 0 || strcmp(id, "channels") == 0 || strcmp(id, "format") == 0) {
     continue;
}


More information about the Alsa-devel mailing list