temp/alsa-*: fork from aports and downgrade to 1.2.5 (MR 2734)

alsa-* 1.2.6 breaks audio switching and microphones on several devices,
with some outstanding issues still open upstream.

This 'fork' is meant to be very short-lived, to restore audio on devices
while we figure out how to fix it on 1.2.6.

see: https://gitlab.com/postmarketOS/pmaports/-/issues/1334
This commit is contained in:
Clayton Craft 2021-12-09 23:32:51 -08:00 committed by Bart Ribbers
parent a5b5f5735d
commit 8fd23ece4e
No known key found for this signature in database
GPG key ID: 0BF4C1B5988C50D8
9 changed files with 449 additions and 0 deletions

46
temp/alsa-lib/APKBUILD Normal file
View file

@ -0,0 +1,46 @@
# Forked from Alpine aports, latest alsa-* breaks audio on devices
pkgname=alsa-lib
pkgver=9999
_pkgver=1.2.5.1
pkgrel=0
pkgdesc="Advanced Linux Sound Architecture (ALSA) library"
url="https://alsa-project.org/"
arch="all"
license="LGPL-2.1-or-later"
subpackages="$pkgname-dbg $pkgname-dev"
makedepends="linux-headers"
source="https://alsa-project.org/files/pub/lib/alsa-lib-$_pkgver.tar.bz2
remove-test.patch
fix-PATH_MAX-on-ppc64le.patch
"
builddir="$srcdir/$pkgname-$_pkgver"
build() {
./configure \
--build=$CBUILD \
--host=$CHOST \
--prefix=/usr \
--disable-python \
--disable-static \
--disable-resmgr \
--enable-rawmidi \
--enable-seq \
--enable-aload \
--disable-dependency-tracking \
--without-versioned
make
}
check() {
make check
}
package() {
make -j1 DESTDIR="$pkgdir" install
}
sha512sums="
01998ffa449e925ff552c13aea47f9540903afdc533086067c78dcaba4d239c347180d3d28bb0000e6d19b7779c7249fcc77a30057930ca22d18ba55e163fa1c alsa-lib-1.2.5.1.tar.bz2
e15318431fe2d5bd1e42ef793f223e3e5995890d7befe6daa3d7456ccf5cb2f51eb79171539cecae13032a9b8a798ea35e04c89b27c7ef9567e2c03fb8db4512 remove-test.patch
f980d153c2f179e2f8fd90180d19250e5a5e12388f31d86a233d89be72ae7e96b944a8f435f0a11c6140378ac38eaa937175e1c100395ec4f635a9a6a4b1ae25 fix-PATH_MAX-on-ppc64le.patch
"

View file

@ -0,0 +1,15 @@
Author: Milan P. Stanić <mps@arvanta.net>
Date: Thu Jun 3 09:08:05 2021 +0000
Fix missing PATH_MAX on ppc64le
--- a/src/ucm/ucm_exec.c 2021-05-27 21:30:16.000000000 +0000
+++ b/src/ucm/ucm_exec.c 2021-06-03 11:37:52.626982547 +0000
@@ -31,6 +31,7 @@
#include <sys/stat.h>
#include <sys/wait.h>
#include <dirent.h>
+#include <limits.h>
static pthread_mutex_t fork_lock = PTHREAD_MUTEX_INITIALIZER;

View file

@ -0,0 +1,85 @@
diff --git a/test/Makefile.am b/test/Makefile.am
index 99c2c4f..ac7bae1 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -2,7 +2,7 @@ SUBDIRS=. lsb
check_PROGRAMS=control pcm pcm_min latency seq \
playmidi1 timer rawmidi midiloop \
- oldapi queue_timer namehint client_event_filter \
+ queue_timer namehint client_event_filter \
chmap audio_time user-ctl-element-set pcm-multi-thread
control_LDADD=../src/libasound.la
@@ -16,7 +16,6 @@ playmidi1_LDADD=../src/libasound.la
timer_LDADD=../src/libasound.la
rawmidi_LDADD=../src/libasound.la
midiloop_LDADD=../src/libasound.la
-oldapi_LDADD=../src/libasound.la
queue_timer_LDADD=../src/libasound.la
namehint_LDADD=../src/libasound.la
client_event_filter_LDADD=../src/libasound.la
diff --git a/test/Makefile.in b/test/Makefile.in
index d096226..699ae45 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -90,7 +90,7 @@ host_triplet = @host@
check_PROGRAMS = control$(EXEEXT) pcm$(EXEEXT) pcm_min$(EXEEXT) \
latency$(EXEEXT) seq$(EXEEXT) playmidi1$(EXEEXT) \
timer$(EXEEXT) rawmidi$(EXEEXT) midiloop$(EXEEXT) \
- oldapi$(EXEEXT) queue_timer$(EXEEXT) namehint$(EXEEXT) \
+ queue_timer$(EXEEXT) namehint$(EXEEXT) \
client_event_filter$(EXEEXT) chmap$(EXEEXT) \
audio_time$(EXEEXT) user-ctl-element-set$(EXEEXT) \
pcm-multi-thread$(EXEEXT)
@@ -136,9 +136,6 @@ midiloop_DEPENDENCIES = ../src/libasound.la
namehint_SOURCES = namehint.c
namehint_OBJECTS = namehint.$(OBJEXT)
namehint_DEPENDENCIES = ../src/libasound.la
-oldapi_SOURCES = oldapi.c
-oldapi_OBJECTS = oldapi.$(OBJEXT)
-oldapi_DEPENDENCIES = ../src/libasound.la
pcm_SOURCES = pcm.c
pcm_OBJECTS = pcm.$(OBJEXT)
pcm_DEPENDENCIES = ../src/libasound.la
@@ -222,11 +219,11 @@ am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
am__v_CCLD_0 = @echo " CCLD " $@;
am__v_CCLD_1 =
SOURCES = audio_time.c chmap.c client_event_filter.c control.c \
- latency.c midiloop.c namehint.c oldapi.c pcm.c \
+ latency.c midiloop.c namehint.c pcm.c \
pcm-multi-thread.c pcm_min.c playmidi1.c queue_timer.c \
rawmidi.c seq.c timer.c user-ctl-element-set.c
DIST_SOURCES = audio_time.c chmap.c client_event_filter.c control.c \
- latency.c midiloop.c namehint.c oldapi.c pcm.c \
+ latency.c midiloop.c namehint.c pcm.c \
pcm-multi-thread.c pcm_min.c playmidi1.c queue_timer.c \
rawmidi.c seq.c timer.c user-ctl-element-set.c
RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
@@ -439,7 +436,6 @@ playmidi1_LDADD = ../src/libasound.la
timer_LDADD = ../src/libasound.la
rawmidi_LDADD = ../src/libasound.la
midiloop_LDADD = ../src/libasound.la
-oldapi_LDADD = ../src/libasound.la
queue_timer_LDADD = ../src/libasound.la
namehint_LDADD = ../src/libasound.la
client_event_filter_LDADD = ../src/libasound.la
@@ -524,10 +520,6 @@ namehint$(EXEEXT): $(namehint_OBJECTS) $(namehint_DEPENDENCIES) $(EXTRA_namehint
@rm -f namehint$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(namehint_OBJECTS) $(namehint_LDADD) $(LIBS)
-oldapi$(EXEEXT): $(oldapi_OBJECTS) $(oldapi_DEPENDENCIES) $(EXTRA_oldapi_DEPENDENCIES)
- @rm -f oldapi$(EXEEXT)
- $(AM_V_CCLD)$(LINK) $(oldapi_OBJECTS) $(oldapi_LDADD) $(LIBS)
-
pcm$(EXEEXT): $(pcm_OBJECTS) $(pcm_DEPENDENCIES) $(EXTRA_pcm_DEPENDENCIES)
@rm -f pcm$(EXEEXT)
$(AM_V_CCLD)$(pcm_LINK) $(pcm_OBJECTS) $(pcm_LDADD) $(LIBS)
@@ -577,7 +569,6 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/latency.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/midiloop.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/namehint.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oldapi.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pcm-multi-thread.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pcm.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pcm_min.Po@am__quote@ # am--include-marker

111
temp/alsa-plugins/APKBUILD Normal file
View file

@ -0,0 +1,111 @@
# Forked from Alpine aports, latest alsa-* breaks audio on devices
pkgname=alsa-plugins
pkgver=9999
_pkgver=1.2.5
pkgrel=0
pkgdesc="Advanced Linux Sound Architecture (ALSA) plugins"
url="https://alsa-project.org/"
arch="all"
license="GPL-2.0-or-later LGPL-2.1-or-later"
makedepends="
alsa-lib-dev
ffmpeg-dev
jack-dev
libsamplerate-dev
linux-headers
pulseaudio-dev
speex-dev
"
subpackages="
$pkgname-doc
$pkgname-pulse
$pkgname-lavrate
$pkgname-a52
$pkgname-jack
"
source="https://alsa-project.org/files/pub/plugins/alsa-plugins-$_pkgver.tar.bz2"
builddir="$srcdir/$pkgname-$_pkgver"
build() {
./configure \
--build=$CBUILD \
--host=$CHOST \
--prefix=/usr \
--sysconfdir=/etc \
--mandir=/usr/share/man \
--localstatedir=/var
make
}
check() {
make check
}
doc() {
default_doc
mkdir -p "$subpkgdir"/usr/share/doc/$pkgname
cat > "$subpkgdir"/usr/share/doc/$pkgname/README.alpine <<EOF
==> please note that alsa-plugins-lavcrate has been renamed to lavrate.
==> So you need to run: apk add alsa-plugins-lavrate
EOF
}
lavrate() {
pkgdesc="FFmpeg samplerate conversion plugins for alsa"
_mv_lib ./*lavrate*
_mv_conf 10-rate-lav.conf
}
pulse() {
pkgdesc="Pulseaudio support plugins for alsa-only applications"
# pipewire provides pulseaudio-alsa; when pipewire is used,
# alsa-plugins-pulse is not needed.
install_if="alsa-lib pulseaudio-alsa !pipewire"
_mv_lib ./*pulse.so
_mv_conf ./*pulseaudio*
mv "$subpkgdir"/etc/alsa/conf.d/99-pulseaudio-default.conf.example \
"$subpkgdir"/etc/alsa/conf.d/99-pulseaudio-default.conf
}
a52() {
pkgdesc="Converts S16 linear sound format to A52 compressed format and sends it to an SPDIF output"
_mv_lib ./*a52.so
_mv_conf 60-a52-encoder.conf
}
jack() {
pkgdesc="Allows native ALSA applications to work with jackd"
_mv_lib ./*jack.so
_mv_conf 50-jack.conf
}
package() {
make DESTDIR="$pkgdir" install
find $pkgdir -name "*.la" -type f -exec rm -f {} \;
}
_mv_lib() {
mkdir -p "$subpkgdir"/usr/lib/alsa-lib/
for i in "$@"; do
mv "$pkgdir"/usr/lib/alsa-lib/$i \
"$subpkgdir"/usr/lib/alsa-lib/
done
}
_mv_conf() {
mkdir -p "$subpkgdir"/etc/alsa/conf.d/ \
"$subpkgdir"/usr/share/alsa/alsa.conf.d
for i in "$@"; do
mv "$pkgdir"/usr/share/alsa/alsa.conf.d/$i \
"$subpkgdir"/usr/share/alsa/alsa.conf.d/
mv "$pkgdir"/etc/alsa/conf.d/$i \
"$subpkgdir"/etc/alsa/conf.d/
done
}
sha512sums="
32aa475ec4af040861c2bfb01eac71042242d2109d3c5102d0111f3327e3f6c9031c32cbb50eb4b6568a6bd9408691a047a39972f09d6087e31ec11f19ddc9cf alsa-plugins-1.2.5.tar.bz2
"

View file

@ -0,0 +1,21 @@
# Forked from Alpine aports, latest alsa-* breaks audio on devices
pkgname=alsa-ucm-conf
pkgver=9999
_pkgver=1.2.5.1
pkgrel=0
pkgdesc="ALSA Use Case Manager configuration"
url="https://alsa-project.org"
arch="noarch"
license="BSD-3-Clause"
source="https://alsa-project.org/files/pub/lib/alsa-ucm-conf-$_pkgver.tar.bz2"
options="!check" # no tests
builddir="$srcdir/$pkgname-$_pkgver"
package() {
mkdir -p "$pkgdir"/usr/share/alsa
cp -r ucm2 "$pkgdir"/usr/share/alsa
}
sha512sums="
774d6da1a0ee6fb1fcd764c1d4b3eb5812a35508cf27db71f6c82784f125eca207992da9081d25783fecb31e548d8b34124d4b3b3d506e33215b76ea48f71012 alsa-ucm-conf-1.2.5.1.tar.bz2
"

49
temp/alsa-utils/APKBUILD Normal file
View file

@ -0,0 +1,49 @@
# Forked from Alpine aports, latest alsa-* breaks audio on devices
pkgname=alsa-utils
pkgver=9999
_pkgver=1.2.5
pkgrel=0
pkgdesc="Advanced Linux Sound Architecture (ALSA) utilities"
url="https://alsa-project.org/"
arch="all"
options="!check" # No test suite, applets use ncurses / don't have --version
license="GPL-2.0-or-later"
makedepends="alsa-lib-dev fftw-dev ncurses-dev pciutils-dev xmlto"
depends="dialog"
subpackages="$pkgname-dbg alsaconf::noarch $pkgname-doc $pkgname-openrc"
source="https://alsa-project.org/files/pub/utils/alsa-utils-$_pkgver.tar.bz2
alsaconf.patch
alsa.initd
alsa.confd
"
builddir="$srcdir/$pkgname-$_pkgver"
build() {
./configure \
--build=$CBUILD \
--host=$CHOST \
--prefix=/usr \
--disable-nls
make
}
package() {
make DESTDIR="$pkgdir" install
install -D -m755 ../alsa.initd "$pkgdir"/etc/init.d/alsa
install -D -m644 ../alsa.confd "$pkgdir"/etc/conf.d/alsa
}
alsaconf() {
depends="alsa-utils bash"
cd "$builddir"
mkdir -p "$subpkgdir"/usr/sbin
mv "$pkgdir"/usr/sbin/alsaconf \
"$subpkgdir"/usr/sbin
}
sha512sums="
0e319e553c9c209a46f5c83c50007bd82acf1c9cf78649978b3ab6fbb4349f51c1c7c6a975a8c24d25ba07ad5325e74d2c34dc5c89180998a0f63d1326fde8b1 alsa-utils-1.2.5.tar.bz2
f04155e1e391c7f36d44422c8e769bf9370117f6bbea6c0664e9858f7a676cc958e4260e4b4d226e71d0716f6be4e6fdd60f1d07cb7e9922fff378ceec01c47d alsaconf.patch
c66959a4a1a24a727c9c91a455caa5fa093c523d17a563b56ec2449a02ff30c83683db555006954b1fe571446cf4a117cc41de8c8b869a6e875d386595b3cc1f alsa.initd
d7e212e9f624b09168117b46c66289204a23915adf0d1b0c9ae258049430397b8f2d86d3b5f7e3087151948a031c4eab863e8195a6c7b1276704e9cba9c2d2a7 alsa.confd
"

View file

@ -0,0 +1,20 @@
# RESTORE_ON_START:
# Do you want to restore your mixer settings? If not, your cards will be
# muted.
# no - Do not restore state
# yes - Restore state
RESTORE_ON_START="yes"
# SAVE_ON_STOP:
# Do you want to save changes made to your mixer volumes when alsasound
# stops?
# no - Do not save state
# yes - Save state
SAVE_ON_STOP="yes"
# Additional options which should be passed to alsactl. Most notably,
# if you get "UCM is not supported" messages on startup, you can pass
# --no-ucm here.
#alsactl_opts="--no-ucm"

View file

@ -0,0 +1,90 @@
#!/sbin/openrc-run
# $Header: /var/cvsroot/gentoo-x86/media-sound/alsa-utils/files/alsasound.initd-r6,v 1.1 2014/06/23 21:34:42 ssuominen Exp $
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
description="Save/Restore Sound Card State"
alsastatedir=/var/lib/alsa
alsascrdir=/etc/alsa.d
alsahomedir=/var/run/alsasound
extra_commands="save restore"
depend() {
need localmount
after bootmisc modules isapnp coldplug hotplug
}
restore() {
ebegin "Restoring Mixer Levels"
checkpath -q -d -m 0700 -o root:root ${alsahomedir} || return 1
if [ ! -r "${alsastatedir}/asound.state" ] ; then
ewarn "No mixer config in ${alsastatedir}/asound.state, you have to unmute your card!"
eend 0
return 0
fi
local cards="$(sed -n -e 's/ *\([[:digit:]]*\) .*/\1/p' /proc/asound/cards)"
local CARDNUM
for cardnum in ${cards}; do
[ -e /dev/snd/controlC${cardnum} ] || sleep 2
[ -e /dev/snd/controlC${cardnum} ] || sleep 2
[ -e /dev/snd/controlC${cardnum} ] || sleep 2
[ -e /dev/snd/controlC${cardnum} ] || sleep 2
alsactl ${alsactl_opts} -E HOME="${alsahomedir}" -I -f "${alsastatedir}/asound.state" restore ${cardnum} \
|| ewarn "Errors while restoring defaults, ignoring"
done
for ossfile in "${alsastatedir}"/oss/card*_pcm* ; do
[ -e "${ossfile}" ] || continue
# We use cat because I'm not sure if cp works properly on /proc
local procfile="${ossfile##${alsastatedir}/oss}"
procfile="$(echo "${procfile}" | sed -e 's,_,/,g')"
if [ -e /proc/asound/"${procfile}"/oss ] ; then
cat "${ossfile}" > /proc/asound/"${procfile}"/oss
fi
done
eend 0
}
save() {
ebegin "Storing ALSA Mixer Levels"
checkpath -q -d -m 0700 -o root:root ${alsahomedir} || return 1
mkdir -p "${alsastatedir}"
if ! alsactl ${alsactl_opts} -E HOME="${alsahomedir}" -f "${alsastatedir}/asound.state" store; then
eerror "Error saving levels."
eend 1
return 1
fi
for ossfile in /proc/asound/card*/pcm*/oss; do
[ -e "${ossfile}" ] || continue
local device="${ossfile##/proc/asound/}" ; device="${device%%/oss}"
device="$(echo "${device}" | sed -e 's,/,_,g')"
mkdir -p "${alsastatedir}/oss/"
cp "${ossfile}" "${alsastatedir}/oss/${device}"
done
eend 0
}
start() {
if [ "${RESTORE_ON_START}" = "yes" ]; then
restore
fi
return 0
}
stop() {
if [ "${SAVE_ON_STOP}" = "yes" ]; then
save
fi
return 0
}

View file

@ -0,0 +1,12 @@
diff -Naur alsa-utils-1.0.9a-orig/alsaconf/alsaconf.in alsa-utils-1.0.9a/alsaconf/alsaconf.in
--- alsa-utils-1.0.9a-orig/alsaconf/alsaconf.in 2005-03-24 00:24:52.000000000 -0800
+++ alsa-utils-1.0.9a/alsaconf/alsaconf.in 2005-07-18 09:25:02.000000000 -0700
@@ -65,6 +58,8 @@
distribution="redhat"
elif test -f /etc/fedora-release && grep -q "Fedora" /etc/fedora-release; then
distribution="fedora"
+elif test -f /etc/alpine-release; then
+ distribution="alpine"
elif [ -f /etc/slackware-version -o -f /etc/slamd64-version ]; then
distribution="slackware"
else