Skip to contentSkip to conversation

package/alsa-plugins: fix dependencies for the alsa plugin package

PATCH Applied Charles Hardin 3 participants 7 messages Jun 20, 2023 – Jul 16, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 package/alsa-plugins: fix dependencies for the alsa plugin package

The alsa-utils will remove and create the /usr/share/alsa dir as a whole and since the alsa plugins needs to add config into this same directory it should come after those install steps.

Also, the bluez alsa needs the plugins installed to find them during the configuration phases - so, interlock the plugins when configured.

---
 package/alsa-plugins/alsa-plugins.mk | 4 ++++
 package/bluez-alsa/bluez-alsa.mk     | 4 ++++
 2 files changed, 8 insertions(+)
package/alsa-plugins/alsa-plugins.mk +4 -0
index 5728ebfe37..d23a81c5ee 100644
@@ -20,6 +20,10 @@ ALSA_PLUGINS_CONF_OPTS = \
 	--disable-maemo-resource-manager \
 	--with-speex=no
 
+ifeq ($(BR2_PACKAGE_ALSA_UTILS),y)
+ALSA_PLUGINS_DEPENDENCIES += alsa-utils
+endif
+
 ifeq ($(BR2_PACKAGE_LIBSAMPLERATE),y)
 ALSA_PLUGINS_CONF_OPTS += --enable-samplerate
 ALSA_PLUGINS_DEPENDENCIES += libsamplerate
package/bluez-alsa/bluez-alsa.mk +4 -0
index 83dfce6177..649810b0ad 100644
@@ -20,6 +20,10 @@ BLUEZ_ALSA_CONF_OPTS = \
 	--with-alsaplugindir=/usr/lib/alsa-lib \
 	--with-alsaconfdir=/etc/alsa/conf.d
 
+ifeq ($(BR2_PACKAGE_ALSA_PLUGINS),y)
+BLUEZ_ALSA_DEPENDENCIES += alsa-plugins
+endif
+
 ifeq ($(BR2_PACKAGE_FDK_AAC),y)
 BLUEZ_ALSA_DEPENDENCIES += fdk-aac
 BLUEZ_ALSA_CONF_OPTS += --enable-aac
Signature · 6 lines
2.39.2 (Apple Git-143)

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw

PATCH 2/2 package/alsa-plugins: require libsamplerate for the plugins

During the execution of the alsa plugins on a test application, the library would not function without samplerate being enabled and present. So, this is a patch to just include the samplerate since the latest versions seem to require it for the plugins to work.

There might be another fix instead of this patch, but this got the sound to play for the bluez alsa stack as expected.

---
 package/alsa-plugins/Config.in       |  1 +
 package/alsa-plugins/alsa-plugins.mk | 22 ++++++----------------
 2 files changed, 7 insertions(+), 16 deletions(-)
package/alsa-plugins/Config.in +1 -0
index ee0fb4c1d5..e85ff218dd 100644
@@ -2,6 +2,7 @@ config BR2_PACKAGE_ALSA_PLUGINS
 	bool "alsa-plugins"
 	depends on BR2_PACKAGE_ALSA_LIB
 	select BR2_PACKAGE_ALSA_LIB_HWDEP
+	select BR2_PACKAGE_LIBSAMPLERATE
 	help
 	  Advanced Linux Sound Architecture Plugins
 
package/alsa-plugins/alsa-plugins.mk +6 -16
index d23a81c5ee..8046720297 100644
@@ -7,30 +7,20 @@
 ALSA_PLUGINS_VERSION = 1.2.7.1
 ALSA_PLUGINS_SOURCE = alsa-plugins-$(ALSA_PLUGINS_VERSION).tar.bz2
 ALSA_PLUGINS_SITE = https://www.alsa-project.org/files/pub/plugins
-ALSA_PLUGINS_LICENSE = LGPL-2.1+
-ALSA_PLUGINS_LICENSE_FILES = COPYING
-ALSA_PLUGINS_DEPENDENCIES = host-pkgconf alsa-lib
+ALSA_PLUGINS_LICENSE = LGPL-2.1+ (library), GPL-2.0+ (samplerate)
+ALSA_PLUGINS_LICENSE_FILES = COPYING COPYING.GPL
+ALSA_PLUGINS_DEPENDENCIES = host-pkgconf alsa-lib libsamplerate
 
 ALSA_PLUGINS_CONF_OPTS = \
+	--enable-samplerate \
 	--disable-jack \
 	--disable-usbstream \
 	--disable-pulseaudio \
-	--disable-libav \
-	--disable-maemo-plugin \
-	--disable-maemo-resource-manager \
-	--with-speex=no
+	--disable-avcodec \
+	--with-speex=builtin
 
 ifeq ($(BR2_PACKAGE_ALSA_UTILS),y)
 ALSA_PLUGINS_DEPENDENCIES += alsa-utils
 endif
 
-ifeq ($(BR2_PACKAGE_LIBSAMPLERATE),y)
-ALSA_PLUGINS_CONF_OPTS += --enable-samplerate
-ALSA_PLUGINS_DEPENDENCIES += libsamplerate
-ALSA_PLUGINS_LICENSE += , GPL-2.0+ (samplerate plugin)
-ALSA_PLUGINS_LICENSE_FILES += COPYING.GPL
-else
-ALSA_PLUGINS_CONF_OPTS += --disable-samplerate
-endif
-
 $(eval $(autotools-package))
Signature · 6 lines
2.39.2 (Apple Git-143)

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#2 lore raw

Re: [Buildroot] [PATCH 2/2] package/alsa-plugins: require libsamplerate for the plugins

Quoted 5 lines · Charles Hardin

During the execution of the alsa plugins on a test application, the library would not function without samplerate being enabled and present. So, this is a patch to just include the samplerate since the latest versions seem to require it for the plugins to work.

It doesn't sound unreasonable that some plugins require samplerate, but it
seems unlikely that none of them work without libsamplerate...

Quoted 2 lines

There might be another fix instead of this patch, but this got the sound to play for the bluez alsa stack as expected.

If it's just for bluez, then it sounds more logical to do it in bluez-alsa?

Regards,
Arnout

Quoted 50 lines
---
  package/alsa-plugins/Config.in       |  1 +
  package/alsa-plugins/alsa-plugins.mk | 22 ++++++----------------
  2 files changed, 7 insertions(+), 16 deletions(-)
package/alsa-plugins/Config.in +1 -0
index ee0fb4c1d5..e85ff218dd 100644
@@ -2,6 +2,7 @@ config BR2_PACKAGE_ALSA_PLUGINS
  	bool "alsa-plugins"
  	depends on BR2_PACKAGE_ALSA_LIB
  	select BR2_PACKAGE_ALSA_LIB_HWDEP
+	select BR2_PACKAGE_LIBSAMPLERATE
  	help
  	  Advanced Linux Sound Architecture Plugins
 
package/alsa-plugins/alsa-plugins.mk +6 -7
index d23a81c5ee..8046720297 100644
@@ -7,30 +7,20 @@
  ALSA_PLUGINS_VERSION = 1.2.7.1
  ALSA_PLUGINS_SOURCE = alsa-plugins-$(ALSA_PLUGINS_VERSION).tar.bz2
  ALSA_PLUGINS_SITE = https://www.alsa-project.org/files/pub/plugins
-ALSA_PLUGINS_LICENSE = LGPL-2.1+
-ALSA_PLUGINS_LICENSE_FILES = COPYING
-ALSA_PLUGINS_DEPENDENCIES = host-pkgconf alsa-lib
+ALSA_PLUGINS_LICENSE = LGPL-2.1+ (library), GPL-2.0+ (samplerate)
+ALSA_PLUGINS_LICENSE_FILES = COPYING COPYING.GPL
+ALSA_PLUGINS_DEPENDENCIES = host-pkgconf alsa-lib libsamplerate
 
  ALSA_PLUGINS_CONF_OPTS = \
+	--enable-samplerate \
  	--disable-jack \
  	--disable-usbstream \
  	--disable-pulseaudio \
-	--disable-libav \
-	--disable-maemo-plugin \
-	--disable-maemo-resource-manager \
-	--with-speex=no
+	--disable-avcodec \
+	--with-speex=builtin
 
  ifeq ($(BR2_PACKAGE_ALSA_UTILS),y)
  ALSA_PLUGINS_DEPENDENCIES += alsa-utils
  endif
 

package/alsa-plugins/alsa-plugins.mk line 26

Quoted 10 lines
package/alsa-plugins/alsa-plugins.mk +0 -9
-ifeq ($(BR2_PACKAGE_LIBSAMPLERATE),y)
-ALSA_PLUGINS_CONF_OPTS += --enable-samplerate
-ALSA_PLUGINS_DEPENDENCIES += libsamplerate
-ALSA_PLUGINS_LICENSE += , GPL-2.0+ (samplerate plugin)
-ALSA_PLUGINS_LICENSE_FILES += COPYING.GPL
-else
-ALSA_PLUGINS_CONF_OPTS += --disable-samplerate
-endif
-
  $(eval $(autotools-package))

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#3 lore raw

PATCH v2 1/1 package/bluez-alsa: allow a samplerate conversion for audio playback

In reply to Charles Hardin

In the case of the bluetooth audio then incoming stream will be coming from bluetooth devices at varying sample rates like (44.1, 48, 96, 192 kHz) and the odds of a sound device matching that samplerate exactly is a bit slim. So in the case of a bluez audio playback the system will need to do a samplerate conversion.

Thus when enabling bluez-alsa and the alsa plugins select libsamplerate to support the shift from the incoming samplerates to an often fix-rated audio device.

---
Changes v1 -> v2:
- moved the samplerate selection to bluez-alsa

 package/bluez-alsa/Config.in | 1 +
 1 file changed, 1 insertion(+)
package/bluez-alsa/Config.in +1 -0
index 73ae3d5333..748c4b8820 100644
@@ -13,6 +13,7 @@ config BR2_PACKAGE_BLUEZ_ALSA
 	select BR2_PACKAGE_BLUEZ5_UTILS_PLUGINS_AUDIO
 	select BR2_PACKAGE_LIBGLIB2
 	select BR2_PACKAGE_SBC
+	select BR2_PACKAGE_LIBSAMPLERATE if BR2_PACKAGE_ALSA_PLUGINS
 	help
 	  Bluetooth Audio ALSA Backend.
 
Signature · 6 lines
2.39.2 (Apple Git-143)

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#4 lore raw

Re: [Buildroot] [PATCH v2 1/1] package/bluez-alsa: allow a samplerate conversion for audio playback

Quoted 6 lines · On Sun, 2 Jul 2023 13:17:36 -0700 Charles Hardin <[email protected]> wrote:

In the case of the bluetooth audio then incoming stream will be coming from bluetooth devices at varying sample rates like (44.1, 48, 96, 192 kHz) and the odds of a sound device matching that samplerate exactly is a bit slim. So in the case of a bluez audio playback the system will need to do a samplerate conversion.

Quoted 8 lines

Thus when enabling bluez-alsa and the alsa plugins select libsamplerate to support the shift from the incoming samplerates to an often fix-rated audio device.

---
Changes v1 -> v2:
- moved the samplerate selection to bluez-alsa

I've added a small comment in the Config.in file to explain this select, and applied. Thanks!

Thomas

Signature · 7 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#5 lore raw
In reply to Charles Hardin
Quoted 9 lines · Charles Hardin

The alsa-utils will remove and create the /usr/share/alsa dir as a whole and since the alsa plugins needs to add config into this same directory it should come after those install steps.

Also, the bluez alsa needs the plugins installed to find them during the configuration phases - so, interlock the plugins when configured.

Applied to master, thanks.

Regards,
Arnout

Quoted 25 lines
---
  package/alsa-plugins/alsa-plugins.mk | 4 ++++
  package/bluez-alsa/bluez-alsa.mk     | 4 ++++
  2 files changed, 8 insertions(+)
package/alsa-plugins/alsa-plugins.mk +4 -0
index 5728ebfe37..d23a81c5ee 100644
@@ -20,6 +20,10 @@ ALSA_PLUGINS_CONF_OPTS = \
  	--disable-maemo-resource-manager \
  	--with-speex=no
 
+ifeq ($(BR2_PACKAGE_ALSA_UTILS),y)
+ALSA_PLUGINS_DEPENDENCIES += alsa-utils
+endif
+
  ifeq ($(BR2_PACKAGE_LIBSAMPLERATE),y)
  ALSA_PLUGINS_CONF_OPTS += --enable-samplerate
  ALSA_PLUGINS_DEPENDENCIES += libsamplerate
package/bluez-alsa/bluez-alsa.mk +0 -0
index 83dfce6177..649810b0ad 100644

package/bluez-alsa/bluez-alsa.mk BLUEZ_ALSA_CONF_OPTS = \ · line 29

Quoted 10 lines
package/bluez-alsa/bluez-alsa.mk +4 -0
@@ -20,6 +20,10 @@ BLUEZ_ALSA_CONF_OPTS = \
  	--with-alsaplugindir=/usr/lib/alsa-lib \
  	--with-alsaconfdir=/etc/alsa/conf.d
 
+ifeq ($(BR2_PACKAGE_ALSA_PLUGINS),y)
+BLUEZ_ALSA_DEPENDENCIES += alsa-plugins
+endif
+
  ifeq ($(BR2_PACKAGE_FDK_AAC),y)
  BLUEZ_ALSA_DEPENDENCIES += fdk-aac
  BLUEZ_ALSA_CONF_OPTS += --enable-aac

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#6 lore raw
In reply to Charles Hardin
Quoted 11 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Charles" == Charles Hardin <[email protected]> writes:

The alsa-utils will remove and create the /usr/share/alsa dir as a whole and since the alsa plugins needs to add config into this same directory it should come after those install steps.

Also, the bluez alsa needs the plugins installed to find them during the configuration phases - so, interlock the plugins when configured.

Committed to 2023.02.x and 2023.05.x, thanks.

Signature · 5 lines
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot