Initial Commit
- initial default booting image
This commit is contained in:
@@ -0,0 +1,110 @@
|
||||
From 4bfd1f15114550e1be7e43ae37a61906e1bff809 Mon Sep 17 00:00:00 2001
|
||||
From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
|
||||
Date: Sun, 17 Jul 2022 18:59:48 +0200
|
||||
Subject: [PATCH] alsactl/info.c: fix conditionals on __ALSA_PCM_H and
|
||||
__ALSA_RAWMIDI_H
|
||||
|
||||
Commit bbc74a61ac7c35e506c3d7f76ecf943cb55736a6 ("alsactl: implement
|
||||
'info' command") implemented an alsactl info command. In this
|
||||
implementation, there was an attempt to properly address optional
|
||||
features from alsa-lib by using conditions on __ALSA_PCM_H,
|
||||
__ALSA_RAWMIDI_H.
|
||||
|
||||
Unfortunately, this attempt does not work entirely: only the code
|
||||
inside pcm_device_list(), rawmidi_device_list() was conditionally
|
||||
compiled, but their very prototype also use type definitions provided
|
||||
in pcm.h and rawmidi.h. So really, it's the entire function that needs
|
||||
to be conditionally implemented.
|
||||
|
||||
Also, snd_rawmidi_stream_name() was not handled properly, for the same
|
||||
reason.
|
||||
|
||||
This commit implements pcm_device_list() only if __ALSA_PCM_H is
|
||||
defined, and implements snd_rawmidi_stream_name() and
|
||||
rawmidi_device_list() only if __ALSA_RAWMIDI_H is defined.
|
||||
|
||||
general_card_info() is modified to not call the PCM or raw MIDI
|
||||
functions when support is not available.
|
||||
|
||||
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
|
||||
Upstream: https://mailman.alsa-project.org/pipermail/alsa-devel/2022-July/203846.html
|
||||
[Bernd: update patch for 1.2.10]
|
||||
Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
|
||||
---
|
||||
alsactl/info.c | 14 ++++++++++----
|
||||
1 file changed, 10 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/alsactl/info.c b/alsactl/info.c
|
||||
index 253539d..9bd72af 100644
|
||||
--- a/alsactl/info.c
|
||||
+++ b/alsactl/info.c
|
||||
@@ -22,9 +22,9 @@
|
||||
#include "aconfig.h"
|
||||
#include "alsactl.h"
|
||||
|
||||
+#ifdef __ALSA_PCM_H
|
||||
static int pcm_device_list(snd_ctl_t *ctl, snd_pcm_stream_t stream, bool *first)
|
||||
{
|
||||
-#ifdef __ALSA_PCM_H
|
||||
int err, dev, idx;
|
||||
unsigned int count;
|
||||
snd_pcm_info_t *pcminfo;
|
||||
@@ -76,10 +76,12 @@ static int pcm_device_list(snd_ctl_t *ctl, snd_pcm_stream_t stream, bool *first)
|
||||
idx, snd_pcm_info_get_subdevice_name(pcminfo));
|
||||
}
|
||||
}
|
||||
-#endif
|
||||
+
|
||||
return 0;
|
||||
}
|
||||
+#endif
|
||||
|
||||
+#ifdef __ALSA_RAWMIDI_H
|
||||
static const char *snd_rawmidi_stream_name(snd_rawmidi_stream_t stream)
|
||||
{
|
||||
if (stream == SND_RAWMIDI_STREAM_INPUT)
|
||||
@@ -91,7 +93,6 @@ static const char *snd_rawmidi_stream_name(snd_rawmidi_stream_t stream)
|
||||
|
||||
static int rawmidi_device_list(snd_ctl_t *ctl, snd_rawmidi_stream_t stream, bool *first)
|
||||
{
|
||||
-#ifdef __ALSA_RAWMIDI_H
|
||||
int err, dev, idx;
|
||||
unsigned int count;
|
||||
snd_rawmidi_info_t *info;
|
||||
@@ -143,9 +144,10 @@ static int rawmidi_device_list(snd_ctl_t *ctl, snd_rawmidi_stream_t stream, bool
|
||||
idx, snd_rawmidi_info_get_subdevice_name(info));
|
||||
}
|
||||
}
|
||||
-#endif
|
||||
+
|
||||
return 0;
|
||||
}
|
||||
+#endif
|
||||
|
||||
static int hwdep_device_list(snd_ctl_t *ctl)
|
||||
{
|
||||
@@ -227,17 +229,21 @@ int general_card_info(int cardno)
|
||||
}
|
||||
err = card_info(ctl);
|
||||
|
||||
+#ifdef __ALSA_PCM_H
|
||||
first = true;
|
||||
if (err >= 0)
|
||||
err = pcm_device_list(ctl, SND_PCM_STREAM_PLAYBACK, &first);
|
||||
if (err >= 0)
|
||||
err = pcm_device_list(ctl, SND_PCM_STREAM_CAPTURE, &first);
|
||||
+#endif
|
||||
|
||||
+#ifdef __ALSA_RAWMIDI_H
|
||||
first = true;
|
||||
if (err >= 0)
|
||||
err = rawmidi_device_list(ctl, SND_RAWMIDI_STREAM_INPUT, &first);
|
||||
if (err >= 0)
|
||||
err = rawmidi_device_list(ctl, SND_RAWMIDI_STREAM_OUTPUT, &first);
|
||||
+#endif
|
||||
|
||||
if (err >= 0)
|
||||
err = hwdep_device_list(ctl);
|
||||
--
|
||||
2.36.1
|
||||
|
||||
100
package/alsa-utils/Config.in
Normal file
100
package/alsa-utils/Config.in
Normal file
@@ -0,0 +1,100 @@
|
||||
comment "alsa-utils needs a toolchain w/ threads"
|
||||
depends on BR2_USE_MMU # fork
|
||||
depends on !BR2_TOOLCHAIN_HAS_THREADS
|
||||
|
||||
menuconfig BR2_PACKAGE_ALSA_UTILS
|
||||
bool "alsa-utils"
|
||||
depends on BR2_USE_MMU # fork
|
||||
depends on BR2_TOOLCHAIN_HAS_THREADS # alsa-lib
|
||||
select BR2_PACKAGE_ALSA_LIB
|
||||
help
|
||||
This package contains the command line utilities for the ALSA
|
||||
project.
|
||||
|
||||
http://www.alsa-project.org/
|
||||
|
||||
if BR2_PACKAGE_ALSA_UTILS
|
||||
|
||||
config BR2_PACKAGE_ALSA_UTILS_ALSACONF
|
||||
bool "alsaconf"
|
||||
|
||||
config BR2_PACKAGE_ALSA_UTILS_ACONNECT
|
||||
bool "aconnect"
|
||||
select BR2_PACKAGE_ALSA_LIB_SEQ
|
||||
|
||||
config BR2_PACKAGE_ALSA_UTILS_ALSACTL
|
||||
bool "alsactl"
|
||||
default y
|
||||
|
||||
config BR2_PACKAGE_ALSA_UTILS_ALSALOOP
|
||||
bool "alsaloop"
|
||||
|
||||
config BR2_PACKAGE_ALSA_UTILS_ALSAMIXER
|
||||
bool "alsamixer"
|
||||
default y
|
||||
depends on BR2_USE_WCHAR
|
||||
select BR2_PACKAGE_NCURSES
|
||||
select BR2_PACKAGE_ALSA_LIB_MIXER
|
||||
|
||||
comment "alsamixer needs a toolchain w/ wchar"
|
||||
depends on !BR2_USE_WCHAR
|
||||
|
||||
config BR2_PACKAGE_ALSA_UTILS_ALSAUCM
|
||||
bool "alsaucm"
|
||||
select BR2_PACKAGE_ALSA_LIB_UCM
|
||||
|
||||
config BR2_PACKAGE_ALSA_UTILS_ALSATPLG
|
||||
bool "alsatplg"
|
||||
depends on !BR2_STATIC_LIBS # dlfcn.h
|
||||
select BR2_PACKAGE_ALSA_LIB_TOPOLOGY
|
||||
|
||||
comment "alsatplg needs a toolchain w/ dynamic library"
|
||||
depends on BR2_STATIC_LIBS
|
||||
|
||||
config BR2_PACKAGE_ALSA_UTILS_AMIDI
|
||||
bool "amidi"
|
||||
select BR2_PACKAGE_ALSA_LIB_RAWMIDI
|
||||
|
||||
config BR2_PACKAGE_ALSA_UTILS_AMIXER
|
||||
bool "amixer"
|
||||
select BR2_PACKAGE_ALSA_LIB_MIXER
|
||||
|
||||
config BR2_PACKAGE_ALSA_UTILS_APLAY
|
||||
bool "aplay/arecord"
|
||||
select BR2_PACKAGE_ALSA_LIB_PCM
|
||||
|
||||
config BR2_PACKAGE_ALSA_UTILS_APLAYMIDI
|
||||
bool "aplaymidi"
|
||||
select BR2_PACKAGE_ALSA_LIB_SEQ
|
||||
|
||||
config BR2_PACKAGE_ALSA_UTILS_ARECORDMIDI
|
||||
bool "arecordmidi"
|
||||
select BR2_PACKAGE_ALSA_LIB_SEQ
|
||||
|
||||
config BR2_PACKAGE_ALSA_UTILS_ASEQDUMP
|
||||
bool "aseqdump"
|
||||
select BR2_PACKAGE_ALSA_LIB_SEQ
|
||||
|
||||
config BR2_PACKAGE_ALSA_UTILS_ASEQNET
|
||||
bool "aseqnet"
|
||||
select BR2_PACKAGE_ALSA_LIB_SEQ
|
||||
|
||||
config BR2_PACKAGE_ALSA_UTILS_BAT
|
||||
bool "bat"
|
||||
help
|
||||
ALSABAT (ALSA Basic Audio Tester) is a simple command-line
|
||||
utility intended to help automate audio driver and sound
|
||||
server testing with little human interaction.
|
||||
|
||||
Note that analysis support in alsabat requires fftw single
|
||||
precision.
|
||||
|
||||
config BR2_PACKAGE_ALSA_UTILS_IECSET
|
||||
bool "iecset"
|
||||
select BR2_PACKAGE_ALSA_LIB_PCM
|
||||
|
||||
config BR2_PACKAGE_ALSA_UTILS_SPEAKER_TEST
|
||||
bool "speaker-test"
|
||||
select BR2_PACKAGE_ALSA_LIB_PCM
|
||||
|
||||
endif
|
||||
3
package/alsa-utils/alsa-utils.hash
Normal file
3
package/alsa-utils/alsa-utils.hash
Normal file
@@ -0,0 +1,3 @@
|
||||
# Locally calculated
|
||||
sha256 092399d5e8749a1d5e188e393157521cec4b75693b60ebb79bbce728cff2232c alsa-utils-1.2.16.tar.bz2
|
||||
sha256 231f7edcc7352d7734a96eef0b8030f77982678c516876fcb81e25b32d68564c COPYING
|
||||
101
package/alsa-utils/alsa-utils.mk
Normal file
101
package/alsa-utils/alsa-utils.mk
Normal file
@@ -0,0 +1,101 @@
|
||||
################################################################################
|
||||
#
|
||||
# alsa-utils
|
||||
#
|
||||
################################################################################
|
||||
|
||||
ALSA_UTILS_VERSION = 1.2.16
|
||||
ALSA_UTILS_SOURCE = alsa-utils-$(ALSA_UTILS_VERSION).tar.bz2
|
||||
ALSA_UTILS_SITE = https://www.alsa-project.org/files/pub/utils
|
||||
ALSA_UTILS_LICENSE = GPL-2.0
|
||||
ALSA_UTILS_LICENSE_FILES = COPYING
|
||||
ALSA_UTILS_INSTALL_STAGING = YES
|
||||
ALSA_UTILS_DEPENDENCIES = host-pkgconf alsa-lib \
|
||||
$(if $(BR2_PACKAGE_NCURSES),ncurses) \
|
||||
$(if $(BR2_PACKAGE_LIBSAMPLERATE),libsamplerate) \
|
||||
$(TARGET_NLS_DEPENDENCIES)
|
||||
|
||||
ifeq ($(BR2_PACKAGE_ALSA_UTILS_ALSACTL),y)
|
||||
ALSA_UTILS_SELINUX_MODULES += alsa
|
||||
endif
|
||||
|
||||
ALSA_UTILS_CONF_ENV = \
|
||||
ac_cv_prog_ncurses5_config=$(STAGING_DIR)/usr/bin/$(NCURSES_CONFIG_SCRIPTS) \
|
||||
LIBS=$(TARGET_NLS_LIBS)
|
||||
|
||||
ALSA_UTILS_CONF_OPTS = \
|
||||
--disable-xmlto \
|
||||
--disable-rst2man \
|
||||
--with-curses=$(if $(BR2_PACKAGE_NCURSES_WCHAR),ncursesw,ncurses)
|
||||
|
||||
ifeq ($(BR2_PACKAGE_ALSA_UTILS_ALSALOOP),y)
|
||||
ALSA_UTILS_CONF_OPTS += --enable-alsaloop
|
||||
else
|
||||
ALSA_UTILS_CONF_OPTS += --disable-alsaloop
|
||||
endif
|
||||
|
||||
ifneq ($(BR2_PACKAGE_ALSA_UTILS_ALSAMIXER),y)
|
||||
ALSA_UTILS_CONF_OPTS += --disable-alsamixer
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_ALSA_UTILS_BAT),y)
|
||||
ALSA_UTILS_CONF_OPTS += --enable-bat
|
||||
# Analysis support requires fftw single precision
|
||||
ALSA_UTILS_DEPENDENCIES += $(if $(BR2_PACKAGE_FFTW_SINGLE),fftw-single)
|
||||
else
|
||||
ALSA_UTILS_CONF_OPTS += --disable-bat
|
||||
endif
|
||||
|
||||
ALSA_UTILS_TARGETS_$(BR2_PACKAGE_ALSA_UTILS_ALSACONF) += usr/sbin/alsaconf
|
||||
ALSA_UTILS_TARGETS_$(BR2_PACKAGE_ALSA_UTILS_ALSACTL) += usr/sbin/alsactl
|
||||
ALSA_UTILS_TARGETS_$(BR2_PACKAGE_ALSA_UTILS_ALSALOOP) += usr/bin/alsaloop
|
||||
ALSA_UTILS_TARGETS_$(BR2_PACKAGE_ALSA_UTILS_ALSAMIXER) += usr/bin/alsamixer
|
||||
ALSA_UTILS_TARGETS_$(BR2_PACKAGE_ALSA_UTILS_ALSATPLG) += usr/bin/alsatplg
|
||||
ALSA_UTILS_TARGETS_$(BR2_PACKAGE_ALSA_UTILS_AMIDI) += usr/bin/amidi
|
||||
ALSA_UTILS_TARGETS_$(BR2_PACKAGE_ALSA_UTILS_AMIXER) += usr/bin/amixer
|
||||
ALSA_UTILS_TARGETS_$(BR2_PACKAGE_ALSA_UTILS_APLAY) += usr/bin/aplay usr/bin/arecord
|
||||
ALSA_UTILS_TARGETS_$(BR2_PACKAGE_ALSA_UTILS_BAT) += usr/bin/alsabat
|
||||
ALSA_UTILS_TARGETS_$(BR2_PACKAGE_ALSA_UTILS_IECSET) += usr/bin/iecset
|
||||
ALSA_UTILS_TARGETS_$(BR2_PACKAGE_ALSA_UTILS_ACONNECT) += usr/bin/aconnect
|
||||
ALSA_UTILS_TARGETS_$(BR2_PACKAGE_ALSA_UTILS_ALSAUCM) += usr/bin/alsaucm
|
||||
ALSA_UTILS_TARGETS_$(BR2_PACKAGE_ALSA_UTILS_APLAYMIDI) += usr/bin/aplaymidi
|
||||
ALSA_UTILS_TARGETS_$(BR2_PACKAGE_ALSA_UTILS_ARECORDMIDI) += usr/bin/arecordmidi
|
||||
ALSA_UTILS_TARGETS_$(BR2_PACKAGE_ALSA_UTILS_ASEQDUMP) += usr/bin/aseqdump
|
||||
ALSA_UTILS_TARGETS_$(BR2_PACKAGE_ALSA_UTILS_ASEQNET) += usr/bin/aseqnet
|
||||
ALSA_UTILS_TARGETS_$(BR2_PACKAGE_ALSA_UTILS_SPEAKER_TEST) += usr/bin/speaker-test
|
||||
|
||||
define ALSA_UTILS_INSTALL_TARGET_CMDS
|
||||
mkdir -p $(TARGET_DIR)/var/lib/alsa
|
||||
for i in $(ALSA_UTILS_TARGETS_y); do \
|
||||
$(INSTALL) -D -m 755 $(STAGING_DIR)/$$i $(TARGET_DIR)/$$i || exit 1; \
|
||||
done
|
||||
if [ -x "$(TARGET_DIR)/usr/bin/speaker-test" ]; then \
|
||||
mkdir -p $(TARGET_DIR)/usr/share/alsa/speaker-test; \
|
||||
mkdir -p $(TARGET_DIR)/usr/share/sounds/alsa; \
|
||||
cp -rdpf $(STAGING_DIR)/usr/share/alsa/speaker-test/* $(TARGET_DIR)/usr/share/alsa/speaker-test/; \
|
||||
cp -rdpf $(STAGING_DIR)/usr/share/sounds/alsa/* $(TARGET_DIR)/usr/share/sounds/alsa/; \
|
||||
fi
|
||||
if [ -x "$(TARGET_DIR)/usr/sbin/alsactl" ]; then \
|
||||
mkdir -p $(TARGET_DIR)/usr/share/; \
|
||||
cp -rdpf $(STAGING_DIR)/usr/share/alsa/* $(TARGET_DIR)/usr/share/alsa/; \
|
||||
fi
|
||||
endef
|
||||
|
||||
ifeq ($(BR2_PACKAGE_ALSA_UTILS_ALSACTL)$(BR2_INIT_SYSTEMD),yy)
|
||||
ALSA_UTILS_DEPENDENCIES += systemd
|
||||
ALSA_UTILS_CONF_OPTS += --with-systemdsystemunitdir=/usr/lib/systemd/system
|
||||
define ALSA_UTILS_INSTALL_INIT_SYSTEMD
|
||||
$(INSTALL) -D -m 0644 $(@D)/alsactl/conf/alsa-restore.service \
|
||||
$(TARGET_DIR)/usr/lib/systemd/system/alsa-restore.service
|
||||
$(INSTALL) -D -m 0644 $(@D)/alsactl/conf/alsa-state.service \
|
||||
$(TARGET_DIR)/usr/lib/systemd/system/alsa-state.service
|
||||
$(INSTALL) -d -m 0755 $(TARGET_DIR)/usr/lib/systemd/system/alsa-restore.service.d
|
||||
printf '[Install]\nWantedBy=multi-user.target\n' \
|
||||
>$(TARGET_DIR)/usr/lib/systemd/system/alsa-restore.service.d/buildroot-enable.conf
|
||||
$(INSTALL) -d -m 0755 $(TARGET_DIR)/usr/lib/systemd/system/alsa-state.service.d
|
||||
printf '[Install]\nWantedBy=multi-user.target\n' \
|
||||
>$(TARGET_DIR)/usr/lib/systemd/system/alsa-state.service.d/buildroot-enable.conf;
|
||||
endef
|
||||
endif
|
||||
|
||||
$(eval $(autotools-package))
|
||||
Reference in New Issue
Block a user