From 88117967b078b2f3d67e05cb6ae2a2c7d261e7ad Mon Sep 17 00:00:00 2001 From: Toshaan Bharvani Date: Sun, 25 Sep 2022 16:48:20 +0200 Subject: [PATCH] initial package creation Signed-off-by: Toshaan Bharvani --- SOURCES/alsa-git.patch | 285 +++++++++++++++ SOURCES/alsa-lib-1.0.14-glibc-open.patch | 11 + SOURCES/alsa-lib-1.2.3.1-config.patch | 44 +++ SOURCES/alsa-ucm-conf.patch | 156 +++++++++ SOURCES/asound.conf | 3 + SOURCES/modprobe-dist-alsa.conf | 9 + SOURCES/modprobe-dist-oss.conf | 8 + SPECS/alsa-lib.spec | 427 +++++++++++++++++++++++ 8 files changed, 943 insertions(+) create mode 100644 SOURCES/alsa-git.patch create mode 100644 SOURCES/alsa-lib-1.0.14-glibc-open.patch create mode 100644 SOURCES/alsa-lib-1.2.3.1-config.patch create mode 100644 SOURCES/alsa-ucm-conf.patch create mode 100644 SOURCES/asound.conf create mode 100644 SOURCES/modprobe-dist-alsa.conf create mode 100644 SOURCES/modprobe-dist-oss.conf create mode 100644 SPECS/alsa-lib.spec diff --git a/SOURCES/alsa-git.patch b/SOURCES/alsa-git.patch new file mode 100644 index 0000000..30b075f --- /dev/null +++ b/SOURCES/alsa-git.patch @@ -0,0 +1,285 @@ +From d6adde0e32376554e461098dcd7cfdb824fabd1e Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Mon, 13 Dec 2021 14:40:56 +0100 +Subject: [PATCH 1/4] ucm: top-level path - set directory from symlink + +It is useful to read the top-level symlink and set the configuration +directory according this symlink for the relative paths. + +Signed-off-by: Jaroslav Kysela +--- + src/ucm/parser.c | 55 +++++++++++++++++++++++++++++++++++++++--------- + 1 file changed, 45 insertions(+), 10 deletions(-) + +diff --git a/src/ucm/parser.c b/src/ucm/parser.c +index 48790057..7bdaa8fe 100644 +--- a/src/ucm/parser.c ++++ b/src/ucm/parser.c +@@ -31,6 +31,7 @@ + */ + + #include "ucm_local.h" ++#include + #include + #include + #include +@@ -2186,6 +2187,7 @@ static int parse_toplevel_path(snd_use_case_mgr_t *uc_mgr, + snd_config_t *n, *n2; + const char *id; + char *dir = NULL, *file = NULL, fn[PATH_MAX]; ++ struct stat st; + long version; + int err; + +@@ -2260,23 +2262,51 @@ static int parse_toplevel_path(snd_use_case_mgr_t *uc_mgr, + } + + ucm_filename(fn, sizeof(fn), version, dir, file); +- if (access(fn, R_OK) == 0) { +- if (replace_string(&uc_mgr->conf_dir_name, dir) == NULL) { +- err = -ENOMEM; +- goto __error; +- } +- if (replace_string(&uc_mgr->conf_file_name, file) == NULL) { +- err = -ENOMEM; +- goto __error; ++ if (access(fn, R_OK) == 0 && lstat(fn, &st) == 0) { ++ if (st.st_mode & S_IFLNK) { ++ ssize_t r; ++ char *link, *dir2, *p; ++ ++ link = malloc(PATH_MAX); ++ if (link == NULL) ++ goto __enomem; ++ r = readlink(fn, link, PATH_MAX - 1); ++ if (r <= 0) { ++ free(link); ++ goto __next; ++ } ++ link[r] = '\0'; ++ p = strrchr(link, '/'); ++ if (p) { ++ *p = '\0'; ++ dir2 = malloc(PATH_MAX); ++ if (dir2 == NULL) { ++ free(link); ++ goto __enomem; ++ } ++ strncpy(dir2, dir, PATH_MAX - 1); ++ strncat(dir2, "/", PATH_MAX - 1); ++ strncat(dir2, link, PATH_MAX - 1); ++ fn[PATH_MAX - 1] = '\0'; ++ free(dir); ++ dir = dir2; ++ } ++ free(link); + } ++ if (replace_string(&uc_mgr->conf_dir_name, dir) == NULL) ++ goto __enomem; ++ if (replace_string(&uc_mgr->conf_file_name, file) == NULL) ++ goto __enomem; + strncpy(filename, fn, PATH_MAX); ++ filename[PATH_MAX - 1] = '\0'; + uc_mgr->conf_format = version; + goto __ok; + } + + __next: + free(file); +- free(dir); ++ if (dir != fn) ++ free(dir); + dir = NULL; + file = NULL; + } +@@ -2284,11 +2314,16 @@ __next: + err = -ENOENT; + goto __error; + ++__enomem: ++ err = -ENOMEM; ++ goto __error; ++ + __ok: + err = 0; + __error: + free(file); +- free(dir); ++ if (dir != fn) ++ free(dir); + return err; + } + +-- +2.34.1 + + +From 47252054b4a2d5c8382cb1342f5d4eb89dabf95f Mon Sep 17 00:00:00 2001 +From: Fabrice Fontaine +Date: Sat, 1 Jan 2022 17:20:47 +0100 +Subject: [PATCH 2/4] src/topology/parser.c: drop duplicate safe_strtol_base + +The safe_strtol_base() function is defined twice since + f547b2e3 ("conf: introduce safe_strtol_base()") and + 5fab157a ("topology: do not call strtol directly") +resulting in the following build failure when alsa-utils is built +statically because safe_strtol_base is defined twice. + +Fixes: http://autobuild.buildroot.org/results/08d028004090b2a8292f03910cb9bf80a73ac804 +Fixes: https://github.com/alsa-project/alsa-lib/pull/207 +Signed-off-by: Fabrice Fontaine +Signed-off-by: Jaroslav Kysela +--- + src/topology/parser.c | 19 ------------------- + 1 file changed, 19 deletions(-) + +diff --git a/src/topology/parser.c b/src/topology/parser.c +index 01c95afa..e70173f6 100644 +--- a/src/topology/parser.c ++++ b/src/topology/parser.c +@@ -21,25 +21,6 @@ + #include "list.h" + #include "tplg_local.h" + +-/* +- * Safe strtol call +- */ +-int safe_strtol_base(const char *str, long *val, int base) +-{ +- char *end; +- long v; +- if (!*str) +- return -EINVAL; +- errno = 0; +- v = strtol(str, &end, base); +- if (errno) +- return -errno; +- if (*end) +- return -EINVAL; +- *val = v; +- return 0; +-} +- + /* + * Get integer value + */ +-- +2.34.1 + + +From c687c482107f746332dd18f7407f6c6efbffccb2 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Sat, 1 Jan 2022 19:18:25 +0100 +Subject: [PATCH 3/4] conf: fix the export of safe_strto* functions from + libasound + +Only one library should define the safe_strto function. Export it +correctly and add _snd_ prefix to avoid possible clashes with the other +application code. + +Fixes: 47252054 ("src/topology/parser.c: drop duplicate safe_strtol_base") +Fixes: https://github.com/alsa-project/alsa-lib/pull/208 +Signed-off-by: Jaroslav Kysela +--- + include/local.h | 8 ++++++-- + src/Versions.in | 6 ++++++ + src/conf.c | 6 +++--- + 3 files changed, 15 insertions(+), 5 deletions(-) + +diff --git a/include/local.h b/include/local.h +index ebc9350c..f64fe9d8 100644 +--- a/include/local.h ++++ b/include/local.h +@@ -232,10 +232,14 @@ size_t page_align(size_t size); + size_t page_size(void); + size_t page_ptr(size_t object_offset, size_t object_size, size_t *offset, size_t *mmap_offset); + +-int safe_strtoll_base(const char *str, long long *val, int base); ++#define safe_strtoll_base _snd_safe_strtoll_base ++int _snd_safe_strtoll_base(const char *str, long long *val, int base); + static inline int safe_strtoll(const char *str, long long *val) { return safe_strtoll_base(str, val, 0); } +-int safe_strtol_base(const char *str, long *val, int base); ++#define safe_strtol_base _snd_safe_strtol_base ++int _snd_safe_strtol_base(const char *str, long *val, int base); + static inline int safe_strtol(const char *str, long *val) { return safe_strtol_base(str, val, 0); } ++#define safe_strtod _snd_safe_strtod ++int _snd_safe_strtod(const char *str, double *val); + + int snd_send_fd(int sock, void *data, size_t len, int fd); + int snd_receive_fd(int sock, void *data, size_t len, int *fd); +diff --git a/src/Versions.in b/src/Versions.in +index 5daccbd4..85031b38 100644 +--- a/src/Versions.in ++++ b/src/Versions.in +@@ -134,3 +134,9 @@ ALSA_1.1.6 { + + @SYMBOL_PREFIX@snd_dlopen; + } ALSA_0.9.7; ++ ++ALSA_1.2.6 { ++ global: ++ ++ @SYMBOL_PREFIX@_snd_safe_strto*; ++} ALSA_1.1.6; +diff --git a/src/conf.c b/src/conf.c +index d3597cbc..098ebd63 100644 +--- a/src/conf.c ++++ b/src/conf.c +@@ -663,7 +663,7 @@ static int input_stdio_open(snd_input_t **inputp, const char *file, + return err; + } + +-int safe_strtoll_base(const char *str, long long *val, int base) ++int _snd_safe_strtoll_base(const char *str, long long *val, int base) + { + char *end; + long v; +@@ -679,7 +679,7 @@ int safe_strtoll_base(const char *str, long long *val, int base) + return 0; + } + +-int safe_strtol_base(const char *str, long *val, int base) ++int _snd_safe_strtol_base(const char *str, long *val, int base) + { + char *end; + long v; +@@ -695,7 +695,7 @@ int safe_strtol_base(const char *str, long *val, int base) + return 0; + } + +-static int safe_strtod(const char *str, double *val) ++int _snd_safe_strtod(const char *str, double *val) + { + char *end; + double v; +-- +2.34.1 + + +From 3dbe072d8deba7c11f6e766ef80c0e50a69447d0 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Thu, 27 Jan 2022 18:25:00 +0100 +Subject: [PATCH 4/4] conf: snd_config_merge - fix comment (overwrite / + override) + +Signed-off-by: Jaroslav Kysela +--- + src/conf.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/conf.c b/src/conf.c +index 098ebd63..70f0e773 100644 +--- a/src/conf.c ++++ b/src/conf.c +@@ -2276,7 +2276,7 @@ static int _snd_config_array_merge(snd_config_t *dst, snd_config_t *src, int ind + * + * \par Errors: + *
+- *
-EEXIST
identifier already exists (!overwrite) ++ *
-EEXIST
identifier already exists (!override) + *
-ENOMEM
not enough memory + *
+ */ +-- +2.34.1 + diff --git a/SOURCES/alsa-lib-1.0.14-glibc-open.patch b/SOURCES/alsa-lib-1.0.14-glibc-open.patch new file mode 100644 index 0000000..bc625bd --- /dev/null +++ b/SOURCES/alsa-lib-1.0.14-glibc-open.patch @@ -0,0 +1,11 @@ +--- alsa-lib-1.0.14/aserver/aserver.c 2007-05-31 10:05:13.000000000 +0200 ++++ alsa-lib-1.0.14.lennart/aserver/aserver.c 2007-08-15 15:53:32.000000000 +0200 +@@ -35,6 +35,8 @@ + + #include "aserver.h" + ++#undef open ++ + char *command; + + #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95) diff --git a/SOURCES/alsa-lib-1.2.3.1-config.patch b/SOURCES/alsa-lib-1.2.3.1-config.patch new file mode 100644 index 0000000..95961a5 --- /dev/null +++ b/SOURCES/alsa-lib-1.2.3.1-config.patch @@ -0,0 +1,44 @@ +diff --git a/src/conf/alsa.conf b/src/conf/alsa.conf +index 18427ec6..1915af4e 100644 +--- a/src/conf/alsa.conf ++++ b/src/conf/alsa.conf +@@ -80,8 +80,7 @@ defaults.pcm.nonblock 1 + defaults.pcm.compat 0 + defaults.pcm.minperiodtime 5000 # in us + defaults.pcm.ipc_key 5678293 +-defaults.pcm.ipc_gid audio +-defaults.pcm.ipc_perm 0660 ++defaults.pcm.ipc_perm 0600 + defaults.pcm.tstamp_type default + defaults.pcm.dmix.max_periods 0 + defaults.pcm.dmix.channels 2 +diff --git a/src/conf/pcm/dmix.conf b/src/conf/pcm/dmix.conf +index 50e573da..70523f29 100644 +--- a/src/conf/pcm/dmix.conf ++++ b/src/conf/pcm/dmix.conf +@@ -48,10 +48,6 @@ pcm.!dmix { + @func refer + name defaults.pcm.ipc_key + } +- ipc_gid { +- @func refer +- name defaults.pcm.ipc_gid +- } + ipc_perm { + @func refer + name defaults.pcm.ipc_perm +diff --git a/src/conf/pcm/dsnoop.conf b/src/conf/pcm/dsnoop.conf +index f4336e5f..60b9f212 100644 +--- a/src/conf/pcm/dsnoop.conf ++++ b/src/conf/pcm/dsnoop.conf +@@ -41,10 +41,6 @@ pcm.!dsnoop { + @func refer + name defaults.pcm.ipc_key + } +- ipc_gid { +- @func refer +- name defaults.pcm.ipc_gid +- } + ipc_perm { + @func refer + name defaults.pcm.ipc_perm diff --git a/SOURCES/alsa-ucm-conf.patch b/SOURCES/alsa-ucm-conf.patch new file mode 100644 index 0000000..4e3efda --- /dev/null +++ b/SOURCES/alsa-ucm-conf.patch @@ -0,0 +1,156 @@ +From 0b2aa9d22f8897cbe68f1aa2ffe437ad3194ec4b Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Mon, 27 Dec 2021 22:05:16 +0100 +Subject: [PATCH 1/4] HDA-DualCodecs: fix typo in Speaker condition + +Signed-off-by: Jaroslav Kysela +--- + ucm2/HDA/DualCodecs/HiFi.conf | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/ucm2/HDA/DualCodecs/HiFi.conf b/ucm2/HDA/DualCodecs/HiFi.conf +index 7dcd6b0..1f7e58d 100644 +--- a/ucm2/HDA/DualCodecs/HiFi.conf ++++ b/ucm2/HDA/DualCodecs/HiFi.conf +@@ -19,7 +19,7 @@ SectionVerb { + If.speaker { + Condition { + Type ControlExists +- Control "name='Speaker Volume Switch'" ++ Control "name='Speaker Playback Switch'" + } + True { + SectionVerb { +@@ -100,7 +100,7 @@ SectionDevice."Headphones" { + If.speaker { + Condition { + Type ControlExists +- Control "name='Speaker Volume Switch'" ++ Control "name='Speaker Playback Switch'" + } + True.Value.JackHWMute "Speaker" + } +-- +2.34.1 + + +From 369f8b497e15a993d411df81a39ee5c8c1433363 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Fri, 7 Jan 2022 10:57:48 +0100 +Subject: [PATCH 2/4] HDA-acp: avoid to create 'Mic ACP LED' control for the + HDMI card + +BugLink: https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/1849#note_1210933 +Signed-off-by: Jaroslav Kysela +--- + ucm2/HDA/HDA.conf | 20 ++++++++++++++------ + 1 file changed, 14 insertions(+), 6 deletions(-) + +diff --git a/ucm2/HDA/HDA.conf b/ucm2/HDA/HDA.conf +index 003d941..ab80fa5 100644 +--- a/ucm2/HDA/HDA.conf ++++ b/ucm2/HDA/HDA.conf +@@ -43,13 +43,21 @@ If.use { + Comment "Play HiFi quality Music" + } + +- Include.init.File "/HDA/init.conf" ++ If.analog { ++ Condition { ++ Type ControlExists ++ Control "name='Master Playback Switch'" ++ } ++ True { ++ Include.init.File "/HDA/init.conf" + +- FixedBootSequence [ +- cset-new "name='Mic ACP LED Capture Switch' type=bool,count=1 off" +- exec "-/sbin/modprobe snd_ctl_led" +- sysw "-/class/sound/ctl-led/mic/card${CardNumber}/attach:Mic ACP LED Capture Switch" +- ] ++ FixedBootSequence [ ++ cset-new "name='Mic ACP LED Capture Switch' type=bool,count=1 off" ++ exec "-/sbin/modprobe snd_ctl_led" ++ sysw "-/class/sound/ctl-led/mic/card${CardNumber}/attach:Mic ACP LED Capture Switch" ++ ] ++ } ++ } + } + } + +-- +2.34.1 + + +From 642db9b51ff7f8ad022fee0362871ceaa46599bf Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Thu, 27 Jan 2022 21:50:32 +0100 +Subject: [PATCH 3/4] acp6x: add initial support for AMD Yellow Carp - ACP6x + +Link: https://github.com/alsa-project/alsa-ucm-conf/issues/136 +Signed-off-by: Jaroslav Kysela +--- + ucm2/HDA/HDA.conf | 2 +- + ucm2/conf.d/acp6x/acp6x.conf | 1 + + 2 files changed, 2 insertions(+), 1 deletion(-) + create mode 120000 ucm2/conf.d/acp6x/acp6x.conf + +diff --git a/ucm2/HDA/HDA.conf b/ucm2/HDA/HDA.conf +index ab80fa5..411f2e7 100644 +--- a/ucm2/HDA/HDA.conf ++++ b/ucm2/HDA/HDA.conf +@@ -3,7 +3,7 @@ Syntax 4 + Define.Use "" # a non-empty string to use UCM configuration for HDA devices + Define.Done "" # a non-empty string to skip the end error + +-Define.AcpCardId "$${find-card:field=name,return=id,regex='^acp$'}" ++Define.AcpCardId "$${find-card:field=name,return=id,regex='^(acp|acp6x)$'}" + Define.DeviceMic "Mic" + + If.dualcodec { +diff --git a/ucm2/conf.d/acp6x/acp6x.conf b/ucm2/conf.d/acp6x/acp6x.conf +new file mode 120000 +index 0000000..7298c24 +--- /dev/null ++++ b/ucm2/conf.d/acp6x/acp6x.conf +@@ -0,0 +1 @@ ++../../common/linked-card.conf +\ No newline at end of file +-- +2.34.1 + + +From 8170fffa7bad33c67b7c59ef5d98d92c0c742e91 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Wed, 9 Feb 2022 16:19:31 +0100 +Subject: [PATCH 4/4] sof-hda-dsp: fix multiple If.dmic blocks +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Fix multiple If.dmic blocks - rename the first to devdmic +initialization. + +Fixes: https://github.com/alsa-project/alsa-ucm-conf/pull/132 +Reported-by: Kacper Michajłow +Signed-off-by: Jaroslav Kysela +--- + ucm2/Intel/sof-hda-dsp/sof-hda-dsp.conf | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/ucm2/Intel/sof-hda-dsp/sof-hda-dsp.conf b/ucm2/Intel/sof-hda-dsp/sof-hda-dsp.conf +index b47777b..eb243d1 100644 +--- a/ucm2/Intel/sof-hda-dsp/sof-hda-dsp.conf ++++ b/ucm2/Intel/sof-hda-dsp/sof-hda-dsp.conf +@@ -3,7 +3,7 @@ Syntax 4 + Define.DeviceMic "Mic" + Define.DeviceDmic "" + +-If.dmic { ++If.devdmic { + Condition { + Type String + Haystack "${CardComponents}" +-- +2.34.1 + diff --git a/SOURCES/asound.conf b/SOURCES/asound.conf new file mode 100644 index 0000000..da7ab7c --- /dev/null +++ b/SOURCES/asound.conf @@ -0,0 +1,3 @@ +# +# Place your global alsa-lib configuration here... +# diff --git a/SOURCES/modprobe-dist-alsa.conf b/SOURCES/modprobe-dist-alsa.conf new file mode 100644 index 0000000..cf31fa6 --- /dev/null +++ b/SOURCES/modprobe-dist-alsa.conf @@ -0,0 +1,9 @@ +# ALSA Sound Support +# +# We want to ensure that snd-seq is always loaded for those who want to use +# the sequencer interface, but we can't do this automatically through udev +# at the moment...so we have this rule (just for the moment). +# +# Remove the following line if you don't want the sequencer. + +install snd-pcm /sbin/modprobe --ignore-install snd-pcm && /sbin/modprobe snd-seq diff --git a/SOURCES/modprobe-dist-oss.conf b/SOURCES/modprobe-dist-oss.conf new file mode 100644 index 0000000..21f93cc --- /dev/null +++ b/SOURCES/modprobe-dist-oss.conf @@ -0,0 +1,8 @@ +# OSS Sound Support +# This has been disabled in F11 onwards because it can interfere with the +# PulseAudio sound service (a legacy OSS application can prevent PulseAudio +# applications from playing sound by preventing PulseAudio from (re-)opening +# the sound device). To re-enable support, copy this file to +# the /etc/modprobe.d directory. +# +install snd-pcm /sbin/modprobe --ignore-install snd-pcm && /sbin/modprobe snd-pcm-oss && /sbin/modprobe snd-seq-device && /sbin/modprobe snd-seq-oss diff --git a/SPECS/alsa-lib.spec b/SPECS/alsa-lib.spec new file mode 100644 index 0000000..0b970cc --- /dev/null +++ b/SPECS/alsa-lib.spec @@ -0,0 +1,427 @@ +#define prever rc3 +#define prever_dot .rc3 +#define postver a + +%define version_alsa_lib 1.2.6.1 +%define version_alsa_ucm 1.2.6.3 +%define version_alsa_tplg 1.2.5 + +Summary: The Advanced Linux Sound Architecture (ALSA) library +Name: alsa-lib +Version: %{version_alsa_lib} +Release: 3%{?prever_dot}%{?dist} +License: LGPLv2+ +URL: http://www.alsa-project.org/ + +Source: ftp://ftp.alsa-project.org/pub/lib/%{name}-%{version}%{?prever}%{?postver}.tar.bz2 +Source1: ftp://ftp.alsa-project.org/pub/lib/alsa-ucm-conf-%{version_alsa_ucm}.tar.bz2 +Source2: ftp://ftp.alsa-project.org/pub/lib/alsa-topology-conf-%{version_alsa_tplg}.tar.bz2 +Source10: asound.conf +Source11: modprobe-dist-alsa.conf +Source12: modprobe-dist-oss.conf +Source40: alsa-ucm-conf.patch +Patch0: alsa-git.patch +Patch1: alsa-lib-1.2.3.1-config.patch +Patch2: alsa-lib-1.0.14-glibc-open.patch + +BuildRequires: doxygen +BuildRequires: autoconf automake libtool +BuildRequires: make + +%description +The Advanced Linux Sound Architecture (ALSA) provides audio and MIDI +functionality to the Linux operating system. + +This package includes the ALSA runtime libraries to simplify application +programming and provide higher level functionality as well as support for +the older OSS API, providing binary compatibility for most OSS programs. + +%package devel +Summary: Development files from the ALSA library +Requires: %{name} = %{version}-%{release} +Requires: pkgconfig + +%description devel +The Advanced Linux Sound Architecture (ALSA) provides audio and MIDI +functionality to the Linux operating system. + +This package includes the ALSA development libraries for developing +against the ALSA libraries and interfaces. + +%package -n alsa-ucm +Summary: ALSA Use Case Manager configuration +BuildArch: noarch +License: BSD +Requires: %{name} >= %{version_alsa_lib} + +%description -n alsa-ucm +The Advanced Linux Sound Architecture (ALSA) Use Case Manager configuration +contains alsa-lib configuration of Audio input/output names and routing + +%package -n alsa-topology +Summary: ALSA Topology configuration +BuildArch: noarch +License: BSD +Requires: %{name} >= %{version_alsa_lib} + +%description -n alsa-topology +The Advanced Linux Sound Architecture (ALSA) topology configuration +contains alsa-lib configuration of SoC topology + +%prep +%setup -q -n %{name}-%{version}%{?prever}%{?postver} +%patch0 -p1 -b .alsa-git +%patch1 -p1 -b .config +%patch2 -p1 -b .glibc-open + +%build +# This package uses top level ASM constructs which are incompatible with LTO. +# Top level ASMs are often used to implement symbol versioning. gcc-10 +# introduces a new mechanism for symbol versioning which works with LTO. +# Converting packages to use that mechanism instead of toplevel ASMs is +# recommended. +# Note: The v1.2.4 contains changes wich are compatible with gcc-10 LTO +# although using the old ASM constructs. +# Enable custom LTO flags +%define _lto_cflags -flto -ffat-lto-objects -flto-partition=none + +autoreconf -vif +%configure --disable-aload --with-plugindir=%{_libdir}/alsa-lib --disable-alisp + +# Remove useless /usr/lib64 rpath on 64bit archs +sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool +sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool + +make %{?_smp_mflags} V=1 +make doc + +%install +%global sysmodprobedir %{_prefix}/lib/modprobe.d + +make DESTDIR=%{buildroot} install + +# Install global configuration files +mkdir -p -m 755 %{buildroot}/etc +install -p -m 644 %{SOURCE10} %{buildroot}/etc + +# Install the modprobe files for ALSA +mkdir -p -m 755 %{buildroot}%{sysmodprobedir} +install -p -m 644 %{SOURCE11} %{buildroot}%{sysmodprobedir}/dist-alsa.conf +# bug#926973, place this file to the doc directory +install -p -m 644 %{SOURCE12} . + +# Create UCM directories +mkdir -p %{buildroot}/%{_datadir}/alsa/ucm +mkdir -p %{buildroot}/%{_datadir}/alsa/ucm2 + +# Unpack UCMs +tar xvjf %{SOURCE1} -C %{buildroot}/%{_datadir}/alsa --strip-components=1 "*/ucm" "*/ucm2" +patch -d %{buildroot}/%{_datadir}/alsa -p1 < %{SOURCE40} + +# Create topology directory +mkdir -p %{buildroot}/%{_datadir}/alsa/topology + +# Unpack topologies +tar xvjf %{SOURCE2} -C %{buildroot}/%{_datadir}/alsa --strip-components=1 "*/topology" + +# Remove libtool archives. +find %{buildroot} -name '*.la' -delete + +# Remove /usr/include/asoundlib.h +rm %{buildroot}/%{_includedir}/asoundlib.h + +%ldconfig_scriptlets + +%files +%{!?_licensedir:%global license %%doc} +%license COPYING +%doc doc/asoundrc.txt modprobe-dist-oss.conf +%config %{_sysconfdir}/asound.conf +/%{_libdir}/libasound.so.* +/%{_libdir}/libatopology.so.* +%{_bindir}/aserver +#{_libdir}/alsa-lib/ +%{_datadir}/alsa/ +%exclude %{_datadir}/alsa/ucm +%exclude %{_datadir}/alsa/ucm2 +%exclude %{_datadir}/alsa/topology +%{sysmodprobedir}/dist-* + +%files devel +%doc TODO doc/doxygen/ +%{_includedir}/alsa/ +%{_includedir}/sys/asoundlib.h +%{_libdir}/libasound.so +%{_libdir}/libatopology.so +%{_libdir}/pkgconfig/alsa.pc +%{_libdir}/pkgconfig/alsa-topology.pc +%{_datadir}/aclocal/alsa.m4 + +%files -n alsa-ucm +# BSD +%{_datadir}/alsa/ucm +%{_datadir}/alsa/ucm2 + +%files -n alsa-topology +# BSD +%{_datadir}/alsa/topology + +%changelog +* Wed Feb 9 2022 Jaroslav Kysela - 1.2.6.1-3 +- import fixes from upstream (UCM: AMD ACP6x, HDA, sof-hda-dsp) + +* Mon Dec 20 2021 Jaroslav Kysela - 1.2.6.1-1 +- update to alsa-lib 1.2.6.1 and alsa-ucm-conf 1.2.6.3 + +* Mon Aug 09 2021 Mohan Boddu - 1.2.5.1-2 +- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags + Related: rhbz#1991688 + +* Thu Jul 29 2021 Jaroslav Kysela - 1.2.5.1-1 +- update to 1.2.5.1 + +* Thu Apr 15 2021 Mohan Boddu - 1.2.4-6 +- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937 + +* Tue Jan 26 2021 Fedora Release Engineering - 1.2.4-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Mon Oct 19 2020 Jaroslav Kysela - 1.2.4-4 +- update to 1.2.4 +- enable LTO + +* Fri Jul 31 2020 Fedora Release Engineering - 1.2.3.2-5 +- Second attempt - Rebuilt for + https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Mon Jul 27 2020 Fedora Release Engineering - 1.2.3.2-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Wed Jul 1 2020 Jeff Law - 1.2.3.2-3 +- Disable LTO + +* Mon Jun 29 2020 Jaroslav Kysela - 1.2.3.2-2 +- update to 1.2.3.2 + +* Thu Jun 18 2020 Jaroslav Kysela - 1.2.3.1-1 +- update to 1.2.3.1 + +* Sun Jun 7 2020 Jaroslav Kysela - 1.2.3-8 +- update to 1.2.3 + +* Mon Apr 6 2020 Jaroslav Kysela - 1.2.2-2 +- UCM2 fixes (RemoveDevice), bug#1786723 + +* Wed Feb 19 2020 Jaroslav Kysela - 1.2.2-1 +- Updated to 1.2.2 + +* Sun Feb 9 2020 Jaroslav Kysela - 1.2.1.2-6 +- More UCM2 related fixes + +* Tue Jan 28 2020 Fedora Release Engineering - 1.2.1.2-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Mon Dec 9 2019 Jaroslav Kysela - 1.2.1.2-4 +- Fixes for sof-hda-dsp UCM2 configuration + +* Tue Dec 3 2019 Jaroslav Kysela - 1.2.1.2-3 +- Fixed more UCM2 related issues + +* Fri Nov 29 2019 Jaroslav Kysela - 1.2.1.2-1 +- Updated to 1.2.1.2 + +* Tue Nov 19 2019 Jaroslav Kysela - 1.2.1.1-1 +- Updated to 1.2.1.1 + +* Wed Nov 13 2019 Jaroslav Kysela - 1.2.1-3 +- Updated to 1.2.1 + +* Wed Jul 24 2019 Fedora Release Engineering - 1.1.9-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Fri May 10 2019 Jaroslav Kysela - 1.1.9-1 +- Updated to 1.1.9 + +* Thu Jan 31 2019 Fedora Release Engineering - 1.1.8-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Mon Jan 7 2019 Jaroslav Kysela - 1.1.8-1 +- Updated to 1.1.8 + +* Tue Dec 25 2018 Hans de Goede - 1.1.7-3 +- Fix broken chtrt5645 UCM profile, fixing mic input on chtrt5645 devices + +* Wed Oct 24 2018 Jaroslav Kysela - 1.1.7-2 +- Moved topology files to alsa-topology +- Updated to 1.1.7 + +* Thu Jul 12 2018 Fedora Release Engineering - 1.1.6-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Wed Apr 04 2018 Jaroslav Kysela - 1.1.6-2 +- Changed add-on directory to /etc/alsa/conf.d + +* Tue Apr 03 2018 Jaroslav Kysela - 1.1.6-1 +- Updated to 1.1.6 + +* Wed Feb 07 2018 Fedora Release Engineering - 1.1.5-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Tue Nov 14 2017 Jaroslav Kysela - 1.1.5-1 +- Updated to 1.1.5 + +* Wed Aug 02 2017 Fedora Release Engineering - 1.1.4.1-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild + +* Wed Jul 26 2017 Fedora Release Engineering - 1.1.4.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Tue Jun 13 2017 Jaroslav Kysela - 1.1.4.1-1 +- Updated to 1.1.4.1 + +* Fri May 12 2017 Jaroslav Kysela - 1.1.4-1 +- Updated to 1.1.4 + +* Mon Mar 20 2017 Peter Robinson 1.1.3-3 +- Add upstream patch for Raspberry Pi HDMI audio + +* Fri Feb 10 2017 Fedora Release Engineering - 1.1.3-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Tue Dec 20 2016 Jaroslav Kysela - 1.1.3-1 +- Updated to 1.1.3 + +* Tue Aug 2 2016 Jaroslav Kysela - 1.1.2-1 +- Updated to 1.1.2 + +* Tue Jul 19 2016 Bastien Nocera - 1.1.1-2 +- Add Surface 3 configuration file + +* Thu Mar 31 2016 Jaroslav Kysela - 1.1.1-1 +- Updated to 1.1.1 + +* Wed Feb 03 2016 Fedora Release Engineering - 1.1.0-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Mon Nov 9 2015 Jaroslav Kysela - 1.1.0-3 +- Replaced source files with the alsa-lib v1.1.0 final + +* Thu Nov 5 2015 Jaroslav Kysela - 1.1.0-2 +- Replaced source files with the alsa-lib v1.1.0 test2 + +* Tue Oct 27 2015 Jaroslav Kysela - 1.1.0-1 +- Updated to 1.1.0 test1 + +* Tue Jun 16 2015 Fedora Release Engineering - 1.0.29-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Thu Feb 26 2015 Jaroslav Kysela - 1.0.29-1 +- Updated to 1.0.29 + +* Sat Feb 21 2015 Till Maas - 1.0.28-4 +- Rebuilt for Fedora 23 Change + https://fedoraproject.org/wiki/Changes/Harden_all_packages_with_position-independent_code + +* Tue Feb 3 2015 Peter Robinson 1.0.28-3 +- Add UCM sub package +- Use %%license + +* Fri Aug 15 2014 Fedora Release Engineering - 1.0.28-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild + +* Thu Jul 24 2014 Peter Robinson 1.0.28-1 +- Update to 1.0.28 + +* Sat Jun 07 2014 Fedora Release Engineering - 1.0.27.2-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Thu Aug 1 2013 Ville Skyttä - 1.0.27.2-2 +- Fix build with unversioned %%{_docdir_fmt}. + +* Mon Jul 08 2013 Jaroslav Kysela - 1.0.27.2-1 +- Updated to 1.0.27.2 + +* Thu May 30 2013 Jaroslav Kysela - 1.0.27.1-2 +- Fixed bug#953352 + +* Tue May 21 2013 Jaroslav Kysela - 1.0.27.1-1 +- Updated to 1.0.27.1 + +* Tue May 07 2013 Rex Dieter 1.0.27-3 +- pull in upstream fix for building in C90 mode + +* Thu Apr 11 2013 Jaroslav Kysela - 1.0.27-2 +- move dist-oss.conf to doc as modprobe-dist-oss.conf + +* Thu Apr 11 2013 Jaroslav Kysela - 1.0.27-1 +- Updated to 1.0.27 + +* Wed Apr 03 2013 Stephen Gallagher - 1.0.26-4 +- Add upstream patch to explicitly include sys/types.h + +* Wed Feb 13 2013 Fedora Release Engineering - 1.0.26-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Mon Dec 3 2012 Peter Robinson 1.0.26-2 +- Create and own ucm directory so alsaucm doesn't crash. +- Cleanup and modernise spec + +* Thu Sep 6 2012 Jaroslav Kysela - 1.0.26-1 +- Updated to 1.0.26 + +* Thu Jul 26 2012 Michael Schwendt - 1.0.25-6 +- Don't package ancient ChangeLog that ends at alsa-lib 0.2.0 (#510212). + +* Wed Jul 18 2012 Fedora Release Engineering - 1.0.25-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Wed May 2 2012 Josh Boyer - 1.0.25-4 +- Install ALSA related module conf files + +* Wed Feb 1 2012 Jaroslav Kysela - 1.0.25-3 +- Remove the pulse audio configuration from /etc/asound.conf + +* Sat Jan 28 2012 Jaroslav Kysela - 1.0.25-1 +- Updated to 1.0.25 final + +* Thu Jan 12 2012 Fedora Release Engineering - 1.0.24-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Mon Feb 07 2011 Fedora Release Engineering - 1.0.24-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Fri Jan 28 2011 Jaroslav Kysela - 1.0.24-1 +- Updated to 1.0.24 final + +* Tue Nov 9 2010 Jochen Schmitt 1.0.23-2 +- Set plugindir to %%{_libdir}/alsa-lib (bz#651507) + +* Fri Apr 16 2010 Jaroslav Kysela - 1.0.23-1 +- Updated to 1.0.23 final + +* Mon Dec 28 2009 Jaroslav Kysela - 1.0.22-1 +- Updated to 1.0.22 final +- Fix file descriptor leak in pcm_hw plugin +- Fix sound distortions for S24_LE - softvol plugin + +* Wed Sep 9 2009 Jaroslav Kysela - 1.0.21-3 +- Add Speaker and Beep control names to mixer weight list +- Fix redhat bug #521988 + +* Wed Sep 2 2009 Jaroslav Kysela - 1.0.21-1 +- Updated to 1.0.21 final + +* Fri Jul 24 2009 Fedora Release Engineering - 1.0.20-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild + +* Wed May 6 2009 Jaroslav Kysela - 1.0.20-1 +- Updated to 1.0.20 final + +* Mon Feb 23 2009 Fedora Release Engineering - 1.0.19-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild + +* Wed Feb 4 2009 Jaroslav Kysela - 1.0.19-2 +- Make doxygen documentation same for all architectures (bz#465205) + +* Tue Jan 20 2009 Jaroslav Kysela - 1.0.19-1 +- Updated to 1.0.19 final