You are not logged in.

#1 2019-12-17 22:06:34

Moonbane
Member
From: Köln, Germany
Registered: 2014-07-21
Posts: 13

A52 plugin with alsa-plugins >1.1.6

I'm unable to get the a52 plugin (optical passtrough for 5.1) to work with the alsa-plugins newer than 1.1.6. I currently keep it downgraded to 1.1.6-2. Works fine. Current version is 1.2.1, I'm not sure, how long I can keep using the old plugins.

The last bug report was https://bugs.archlinux.org/task/60586?p … sa-plugins

I tried to build ffmpeg myself and enabled swresample but I never seem to get the digital surround sinks.

So what am I missing? Thanks for your thoughts!

my .asoundrc

pcm.a52 {
  @args [CARD]
  @args.CARD {
    type string
  }
  type rate
  slave {
    pcm {
      type a52
      bitrate 448
      channels 6
      card $CARD
    }
  rate 48000 #required somehow, otherwise nothing happens in PulseAudio
  }
}
# Use PulseAudio by default
pcm.!default {
  type pulse
  fallback "sysdefault"
  hint {
    show on
    description "Default ALSA Output (currently PulseAudio Sound Server)"
  }
}

ctl.!default {
  type pulse
  fallback "sysdefault"
}

Offline

#2 2019-12-18 00:42:54

latalante1
Member
Registered: 2018-08-30
Posts: 72

Re: A52 plugin with alsa-plugins >1.1.6

Moonbane wrote:

I tried to build ffmpeg myself and enabled swresample but...

Archlinux ffmpeg contains swresample.

Completely dirty, but without problems builds with the plugin you are interested in (a52).

git clone git://git.alsa-project.org/alsa-plugins.git
cd alsa-plugins
sed -i 's|libavresample|libswresample|g; s|-lavresample|-lswresample|g' configure.ac
sed -i 's|^./configure |./configure --sysconfdir=/etc --prefix=/usr --disable-lavrate|' ./gitcompile
./gitcompile
sudo make DESTDIR=/tmp/alsa-plugins-inst install

Last edited by latalante1 (2019-12-18 14:33:11)

Offline

#3 2019-12-18 12:21:11

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 8,276

Re: A52 plugin with alsa-plugins >1.1.6

Bugreport and other thread suggests nobody has verified whether the problem is in alsa-plugins or in pulseaudio .

Moonbane, are you willing to remove pulseaudio* for testing purposes and run  a pure alsa system  ?

* libpulse needs to stay to keep programs that expect pulse to be present happy.


Multi-init booting with apg Openrc and systemd coexisting
Automounting : not needed, i prefer pmount
Aur helpers : makepkg + my own local repo === rarely need them

Offline

#4 2019-12-18 14:32:34

latalante1
Member
Registered: 2018-08-30
Posts: 72

Re: A52 plugin with alsa-plugins >1.1.6

https://git.archlinux.org/svntogit/pack … d288b68c8c

I don't know what this plugin is used for?
I think every more advanced player mpv, vlc, mplayer will do it just as well.

Last edited by latalante1 (2019-12-18 14:37:52)

Offline

#5 2019-12-18 15:27:22

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 8,276

Re: A52 plugin with alsa-plugins >1.1.6

Check the dependencies of the players, they all use ffmpeg for the heavy lifting.


Multi-init booting with apg Openrc and systemd coexisting
Automounting : not needed, i prefer pmount
Aur helpers : makepkg + my own local repo === rarely need them

Offline

#6 2019-12-18 17:59:19

Moonbane
Member
From: Köln, Germany
Registered: 2014-07-21
Posts: 13

Re: A52 plugin with alsa-plugins >1.1.6

Tried a little around today. First, all versions of ffmpeg seem to work with the alsa-plugins <=1.1.6. Tried building alsa-plugins from abs - no joy. But - after latalante1 explanation it seems to be a configuration issue. the PKGBUILD contains:

optdepends=('libpulse: PulseAudio plugin'
            'jack: Jack plugin'
            #'ffmpeg: libavcodec resampling plugin, a52 plugin'
            'libsamplerate: libsamplerate resampling plugin'
            'speex: libspeexdsp resampling plugin')

so there is no libswresample. but libavcodec should be dropped? Why then does it work with 1.1.6?

Offline

#7 2019-12-18 19:14:30

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 10,145

Re: A52 plugin with alsa-plugins >1.1.6

Because that still built the a52 plugin, there seems to have been some bug that lead to the removal of the a52 plugin, check the package history and the two commits mentioning flysprays: https://git.archlinux.org/svntogit/pack … sa-plugins

Online

#8 2019-12-21 00:00:04

quequotion
Member
From: Oita, Japan
Registered: 2013-07-29
Posts: 754
Website

Re: A52 plugin with alsa-plugins >1.1.6

latalante1 wrote:

I don't know what this plugin is used for?

The plugin can be used to create a persistent (virtual) 5.1 output device; avoiding the need to configure individual clients for ac3 passthrough.

In the past I have managed this by downgrading to a custom-built alsa-plugins and adding it to IgnorePkg in pacman.conf, but I haven't been able to clean-chroot build 1.1.6 lately:

/bin/sh ../libtool  --tag=CC   --mode=link gcc -Wall -g -DAVCODEC_HEADER="<libavcodec/avcodec.h>" -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -module -avoid-version -export-dynamic -no-undefined -Wl,--no-undefined -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -o libasound_module_rate_lavcrate.la -rpath /usr/lib/alsa-lib rate_lavcrate.lo -lasound  -lavcodec -lavutil  -lasound 
libtool: link: gcc -shared  -fPIC -DPIC  .libs/rate_lavcrate.o   -lavcodec -lavutil -lasound  -g -march=x86-64 -mtune=generic -O2 -Wl,--no-undefined -Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,-z -Wl,relro -Wl,-z -Wl,now   -Wl,-soname -Wl,libasound_module_rate_lavcrate.so -o .libs/libasound_module_rate_lavcrate.so
/usr/bin/ld: .libs/rate_lavcrate.o: in function `pcm_src_free':
/build/alsa-plugins/src/alsa-plugins-1.1.6/rate-lavc/rate_lavcrate.c:70: undefined reference to `av_resample_close'
/usr/bin/ld: .libs/rate_lavcrate.o: in function `pcm_src_init':
/build/alsa-plugins/src/alsa-plugins-1.1.6/rate-lavc/rate_lavcrate.c:96: undefined reference to `av_resample_init'
/usr/bin/ld: .libs/rate_lavcrate.o: in function `pcm_src_convert_s16':
/build/alsa-plugins/src/alsa-plugins-1.1.6/rate-lavc/rate_lavcrate.c:186: undefined reference to `av_resample'
/usr/bin/ld: /build/alsa-plugins/src/alsa-plugins-1.1.6/rate-lavc/rate_lavcrate.c:194: undefined reference to `av_resample_compensate'
/usr/bin/ld: /build/alsa-plugins/src/alsa-plugins-1.1.6/rate-lavc/rate_lavcrate.c:194: undefined reference to `av_resample_compensate'

It should be possible to build ffmpeg with libavresample (there's an AUR package for the lib as well), and build asla-plugins against it to get the a52 plugin, however...?

EDIT: seems like ffmpeg builds libavresample, but not libavrate. Something's missing?

Last edited by quequotion (2019-12-21 00:18:17)

Offline

#9 2019-12-21 09:54:26

latalante1
Member
Registered: 2018-08-30
Posts: 72

Re: A52 plugin with alsa-plugins >1.1.6

The only correct solution is to interest ALSA developers in this problem. I see that someone is already trying for it. There is even a patch already porting this additional plugin (rate) for libswresample.
https://mailman.alsa-project.org/piperm … 59428.html

Another solution is to build static, very tightly stripped (of unnecessary things) ffmpeg (--enable-avresample) and use it to compile alsa-plugins (--with-libav-includedir, --with-libav-libdir). Never, never replace the system ffmpeg with other "vulnerable" versions. For such unusual needs, temporary ffmpeg should be built with a different prefiix than the system one.

Last edited by latalante1 (2019-12-21 10:27:22)

Offline

#10 2019-12-21 16:05:38

quequotion
Member
From: Oita, Japan
Registered: 2013-07-29
Posts: 754
Website

Re: A52 plugin with alsa-plugins >1.1.6

I was able to get back to 5.1 surround by clean-chroot building alsa-plugins (1.2.1-1) against libavresample from AUR and ffmpeg from [extra]:

$ git clone https://aur.archlinux.org/libavresample
$ cd libavresample/
$ makechrootpkg -c -r $CHROOT
# pacman -U --asdeps libavresample-4.1.3-1-x86_64.pkg.tar.xz
$ cd ../
$ git clone git://git.archlinux.org/svntogit/packages.git --{single-,}branch {packages/,}alsa-plugins
$ cd alsa-plugins/trunk/
$ makechrootpkg -c -r $CHROOT -I ../../libavresample/libavresample-4.1.3-1-x86_64.pkg.tar.xz
# pacman -U alsa-plugins-1.2.1-1-x86_64.pkg.tar.xz

Then building and installing IdleGandalf's alsa-lib:

--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,15 +1,21 @@
 # Contributor: judd <jvinet@zeroflux.org>
 
 pkgname=alsa-lib
-pkgver=1.2.1.2
+pkgver=1.2.1.9
 pkgrel=2
 pkgdesc="An alternative implementation of Linux sound support"
 arch=('x86_64')
 url="https://www.alsa-project.org"
 depends=('glibc' 'alsa-topology-conf' 'alsa-ucm-conf')
+makedepends=('git')
 license=('LGPL')
-source=(ftp://ftp.alsa-project.org/pub/lib/$pkgname-$pkgver.tar.bz2)
-sha512sums=('e8286fd55f63ee0d95513279d0885c287533de89b7af6c338413dec5d38ba4f5a15da1a4a4ce36e052614e4b730e3778782dab9979d82958283be17b48604913')
+source=("$pkgname-$pkgver"::git+https://git.harting.dev/IdleGandalf/alsa-lib.git)
+sha512sums=('SKIP')
+
+prepare() {
+  cd $pkgname-$pkgver
+  autoreconf -fvi
+}
 
 build() {
   cd "$srcdir/$pkgname-$pkgver"

This works with the classic configuration.

Last edited by quequotion (2019-12-28 14:49:23)

Offline

#11 2019-12-21 16:13:19

Scimmia
Bug Wrangler
Registered: 2012-09-01
Posts: 7,790

Re: A52 plugin with alsa-plugins >1.1.6

That's a terrible PKGBUILD patch. Please don't use it.

Offline

#12 2019-12-21 16:36:40

quequotion
Member
From: Oita, Japan
Registered: 2013-07-29
Posts: 754
Website

Re: A52 plugin with alsa-plugins >1.1.6

Scimmia wrote:

That's a terrible PKGBUILD patch.

Sloppy copy and paste missed a few lines (fixed); but also $pkgver is spoofed as a quick dirty workaround.
A proper package would need a pkgver(); and probably a different $pkgname (suggestions welcome).

Last edited by quequotion (2019-12-28 14:51:51)

Offline

#13 2019-12-27 20:55:56

Moonbane
Member
From: Köln, Germany
Registered: 2014-07-21
Posts: 13

Re: A52 plugin with alsa-plugins >1.1.6

Can't check it - currently away over the holidays and on my laptop. But this looks promising smile

Offline

#14 2020-03-29 03:19:30

quequotion
Member
From: Oita, Japan
Registered: 2013-07-29
Posts: 754
Website

Re: A52 plugin with alsa-plugins >1.1.6

Sorry if this is considered a necro-bump.

I fixed up that PKGBUILD and uploaded it to AUR: alsa-lib-a52pcm.

Offline

#15 2020-07-31 12:14:28

AntiK
Member
Registered: 2016-03-07
Posts: 6

Re: A52 plugin with alsa-plugins >1.1.6

Hi,

first of all thank you very much, quequotion for the patched alsa-lib!
I spent the whole night trying to get this running.

I just want to inform you, that there is a little problem with the a52 alsa plugin in my setup.
While the plugin loads fine and I'm able to use it with alsa, pulseaudio refuses to list the sink.
I found out, that pulseaudio recognizes the sink, if I disable my HDMI audio with:

options snd-hda-intel enable=0,1

Maybe this is because it wouldn't make sense to use the plugin with HDMI anyway, but I have a second device where it totally makes sense.
Disabling HDMI is fine for me, since I don't need the HDMI output anyway.

Do you think this will be fixed in the alsa-lib of the official repo soon, or will the plugin be abandoned forever?

Offline

Board footer

Powered by FluxBB