[alsa-devel] a52 plugin + ffmpeg with libswresample
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; }
Dne 03. 12. 19 v 21:12 Giovanni Harting napsal(a):
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.
Show us the code (for example via github or so) to look what you're trying to do. It seems that the configuration parser in the plugin is broken.
Jaroslav
On 03/12/2019 21:38, Jaroslav Kysela wrote:
Show us the code (for example via github or so) to look what you're trying to do. It seems that the configuration parser in the plugin is broken.
Sure thing. The libswresample port of rate-lav is here [1], while the workaround for alsa-lib is here [2].
Essentially, I'm just trying to get the same configuration that worked in 1.1.6 working. This config parsing problem seems unrelated to the libswresample patch to me, correct me if I'm wrong.
[1] https://git.harting.dev/IdleGandalf/alsa-plugins/commit/9cdbbb9874757b6f8fda... [2] https://git.harting.dev/IdleGandalf/alsa-lib/commit/646bc80a63b0220300678a38...
participants (2)
-
Giovanni Harting
-
Jaroslav Kysela