Skip to contentSkip to conversation

tinyalsa: new package

PATCH New Maxime Hadjinlian 3 participants 6 messages Oct 5, 2014 – Oct 18, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tinyalsa: new package

---
 package/Config.in            |  1 +
 package/tinyalsa/Config.in   | 14 ++++++++++++++
 package/tinyalsa/tinyalsa.mk | 34 ++++++++++++++++++++++++++++++++++
 3 files changed, 49 insertions(+)
 create mode 100644 package/tinyalsa/Config.in
 create mode 100644 package/tinyalsa/tinyalsa.mk
package/Config.in +1 -0
index c4ea688..e19e6ec 100644
@@ -27,6 +27,7 @@ menu "Audio and video applications"
 	source "package/pulseaudio/Config.in"
 	source "package/sox/Config.in"
 	source "package/tidsp-binaries/Config.in"
+	source "package/tinyalsa/Config.in"
 	source "package/tstools/Config.in"
 	source "package/twolame/Config.in"
 	source "package/upmpdcli/Config.in"
package/tinyalsa/Config.in new file +14 -0
new file mode 100644
index 0000000..0295c51
@@ -0,0 +1,14 @@
+config BR2_PACKAGE_TINYALSA
+	bool "tinyalsa"
+	default n
+	help
+	  a small library to interface with ALSA in the Linux kernel
+
+	  The aims are:
+
+	  - Provide a basic pcm and mixer API
+	  - If it's not absolutely needed, don't add it to the API
+	  - Avoid supporting complex and unnecessary operations that could be dealt
+	    with at a higher level
+
+	  https://github.com/tinyalsa/tinyalsa
package/tinyalsa/tinyalsa.mk new file +34 -0
new file mode 100644
index 0000000..b287e78
@@ -0,0 +1,34 @@
+#############################################################
+#
+# tinyalsa
+#
+#############################################################
+
+TINYALSA_VERSION = f2a7b6d3d81bd337a540d56704b4aaa7bdb046fe
+TINYALSA_SITE = $(call github,tinyalsa,tinyalsa,$(TINYALSA_VERSION))
+TINYALSA_LICENSE = BSD-3c
+TINYALSA_INSTALL_STAGING = YES
+
+define TINYALSA_BUILD_CMDS
+	$(MAKE) CROSS_COMPILE="$(TARGET_CROSS)" -C $(@D)
+endef
+
+define TINYALSA_INSTALL_STAGING_CMDS
+	$(INSTALL) -D -m 0755 $(@D)/libtinyalsa.so \
+			$(STAGING_DIR)/usr/lib/libtinyalsa.so
+	$(INSTALL) -D -m 0644 $(@D)/include/sound/asound.h \
+			$(STAGING_DIR)/usr/include/sound/asound.h
+	$(INSTALL) -D -m 0644 $(@D)/include/tinyalsa/asoundlib.h \
+			$(STAGING_DIR)/usr/include/tinyalsa/asoundlib.h
+endef
+
+define TINYALSA_INSTALL_TARGET_CMDS
+	$(INSTALL) -D -m 0755 $(@D)/libtinyalsa.so \
+			$(TARGET_DIR)/usr/lib/libtinyalsa.so
+	$(INSTALL) -D -m 0755 $(@D)/tinyplay $(TARGET_DIR)/usr/bin/tinyplay
+	$(INSTALL) -D -m 0755 $(@D)/tinycap $(TARGET_DIR)/usr/bin/tinycap
+	$(INSTALL) -D -m 0755 $(@D)/tinymix $(TARGET_DIR)/usr/bin/tinymix
+	$(INSTALL) -D -m 0755 $(@D)/tinypcminfo $(TARGET_DIR)/usr/bin/tinypcminfo
+endef
+
+$(eval $(generic-package))
Signature · 1 line
2.1.1
#1 lore raw

PATCH 1/1 tinyalsa: new package

Dear Maxime Hadjinlian,

Quoted 8 lines · Maxime Hadjinlian
---
 package/Config.in            |  1 +
 package/tinyalsa/Config.in   | 14 ++++++++++++++
 package/tinyalsa/tinyalsa.mk | 34 ++++++++++++++++++++++++++++++++++
 3 files changed, 49 insertions(+)
 create mode 100644 package/tinyalsa/Config.in
 create mode 100644 package/tinyalsa/tinyalsa.mk

Thanks, applied, after doing a few changes:

[Thomas:
- remove 'default n', since it's the default
- add dependency on !BR2_PREFER_STATIC_LIB since the Makefile always builds a shared library.
- move from Audio/video applications to Libraries -> Audio.]

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#2 lore raw

PATCH 1/1 tinyalsa: new package

Hi Maxime and Thomas,

package/tinyalsa/tinyalsa.mk line 20

Quoted 4 lines

+++ b/package/tinyalsa/tinyalsa.mk
[snip]

package/tinyalsa/tinyalsa.mk new file +2 -0
+       $(INSTALL) -D -m 0644 $(@D)/include/sound/asound.h \
+                       $(STAGING_DIR)/usr/include/sound/asound.h

This will overwrite the pre-existing (from libc or kernel headers) version of <sound/asound.h> with the Android-style stripped version from tinyalsa. I think it would be better to keep the pre-existing version of this header, do you agree?

Bye,
Maarten

#3 lore raw

PATCH 1/1 tinyalsa: new package

Hi Maarten, all

Quoted 11 lines · Maarten ter Huurne

Hi Maxime and Thomas,

package/tinyalsa/tinyalsa.mk line 20

Quoted 4 lines

+++ b/package/tinyalsa/tinyalsa.mk
[snip]

package/tinyalsa/tinyalsa.mk new file +2 -0
+       $(INSTALL) -D -m 0644 $(@D)/include/sound/asound.h \
+                       $(STAGING_DIR)/usr/include/sound/asound.h

This will overwrite the pre-existing (from libc or kernel headers) version of <sound/asound.h> with the Android-style stripped version from tinyalsa. I think it would be better to keep the pre-existing version of this header, do you agree?

IMHO, it's the benefit of using tinyalsa, is not in the tools it provides, but mainly because of these stripped library and headers that you want to use in your applications.
Otherwise, you don't really need the tinyalsa package at all.

Quoted 4 lines

Bye,
Maarten

#4 lore raw

PATCH 1/1 tinyalsa: new package

In reply to Maarten ter Huurne

Dear Maarten ter Huurne,

Quoted 9 lines · Maarten ter Huurne

package/tinyalsa/tinyalsa.mk line 20

Quoted 4 lines

+++ b/package/tinyalsa/tinyalsa.mk
[snip]

package/tinyalsa/tinyalsa.mk new file +2 -0
+       $(INSTALL) -D -m 0644 $(@D)/include/sound/asound.h \
+                       $(STAGING_DIR)/usr/include/sound/asound.h

This will overwrite the pre-existing (from libc or kernel headers) version of <sound/asound.h> with the Android-style stripped version from tinyalsa. I think it would be better to keep the pre-existing version of this header, do you agree?

Yes, overwriting this header file indeed looks brutal. Is the original asound.h a superset of the tinyalsa asound.h ? If that's the case, then we can simply keep the original asound.h and that's it.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#5 lore raw

PATCH 1/1 tinyalsa: new package

Quoted 14 lines · Thomas Petazzoni

Dear Maarten ter Huurne,

Quoted 9 lines · Maarten ter Huurne

package/tinyalsa/tinyalsa.mk line 20

Quoted 4 lines

+++ b/package/tinyalsa/tinyalsa.mk
[snip]

package/tinyalsa/tinyalsa.mk new file +2 -0
+       $(INSTALL) -D -m 0644 $(@D)/include/sound/asound.h \
+                       $(STAGING_DIR)/usr/include/sound/asound.h

This will overwrite the pre-existing (from libc or kernel headers) version of <sound/asound.h> with the Android-style stripped version from tinyalsa. I think it would be better to keep the pre-existing version of this header, do you agree?

Quoted 3 lines

Yes, overwriting this header file indeed looks brutal. Is the original asound.h a superset of the tinyalsa asound.h ? If that's the case, then we can simply keep the original asound.h and that's it.

Indeed, I originally though they were different headers, after doing a diff between the two, the one of tinyalsa is simply a subset. I'll submit a patch to remove the install.

Quoted 6 lines

Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com