commit 885e1b5
hovercats
·
2024-02-06 18:09:03 +0000 UTC
parent 8743d00
tinyalsa: import from oasis
8 files changed,
+121,
-0
+4,
-0
1@@ -101,6 +101,10 @@
2 [submodule "pkg/sdhcp/src"]
3 path = pkg/sdhcp/src
4 url = https://github.com/michaelforney/sdhcp
5+[submodule "pkg/tinyalsa/src"]
6+ path = pkg/tinyalsa/src
7+ url = https://github.com/tinyalsa/tinyalsa.git
8+ ignore = all
9 [submodule "pkg/tz/src"]
10 path = pkg/tz/src
11 url = https://github.com/eggert/tz
+1,
-0
1@@ -48,6 +48,7 @@ subgen 'sbase'
2 subgen 'sdhcp'
3 subgen 'skeleton'
4 subgen 'strace'
5+subgen 'tinyalsa'
6 subgen 'transmission'
7 subgen 'tz'
8 subgen 'ubase'
+33,
-0
1@@ -0,0 +1,33 @@
2+cflags{
3+ '-std=c99', '-Wall', '-Wpedantic', '-Wno-overflow',
4+ '-D _POSIX_C_SOURCE=201112L',
5+ '-I $srcdir/include',
6+ '-isystem $builddir/pkg/linux-headers/include',
7+}
8+
9+pkg.deps = {'pkg/linux-headers/headers'}
10+
11+pkg.hdrs = copy('$outdir/include/tinyalsa', '$srcdir/include/tinyalsa', {
12+ 'attributes.h',
13+ 'pcm.h',
14+ 'mixer.h',
15+ 'asoundlib.h',
16+ 'version.h',
17+})
18+
19+lib('libtinyalsa.a', [[
20+ src/(
21+ limits.c
22+ pcm.c
23+ pcm_hw.c
24+ mixer.c
25+ mixer_hw.c
26+ )
27+]])
28+
29+for _, tool in ipairs{'tinycap', 'tinymix', 'tinypcminfo', 'tinyplay'} do
30+ file('bin/'..tool, '755', exe(tool, {'utils/'..tool..'.c', 'libtinyalsa.a'}))
31+ man{'$srcdir/utils/'..tool..'.1'}
32+end
33+
34+fetch 'git'
1@@ -0,0 +1,27 @@
2+From 6dc78a2ca2a3f4e74816a014c73b71201a1290c6 Mon Sep 17 00:00:00 2001
3+From: Michael Forney <mforney@mforney.org>
4+Date: Mon, 30 Aug 2021 20:11:37 -0700
5+Subject: [PATCH] make use of snd_utils_close_dev_node conditional on
6+ TINYALSA_USES_PLUGINS
7+
8+---
9+ src/pcm.c | 2 ++
10+ 1 file changed, 2 insertions(+)
11+
12+diff --git a/src/pcm.c b/src/pcm.c
13+index d681563..287b4a2 100644
14+--- a/src/pcm.c
15++++ b/src/pcm.c
16+@@ -986,7 +986,9 @@ int pcm_close(struct pcm *pcm)
17+ pcm->ops->munmap(pcm->data, pcm->mmap_buffer, pcm_frames_to_bytes(pcm, pcm->buffer_size));
18+ }
19+
20++#if TINYALSA_USES_PLUGINS
21+ snd_utils_close_dev_node(pcm->snd_node);
22++#endif
23+ pcm->ops->close(pcm->data);
24+ pcm->buffer_size = 0;
25+ pcm->fd = -1;
26+--
27+2.37.3
28+
1@@ -0,0 +1,25 @@
2+From a307284f4d4dce9974444f9b304c6bcbbf039780 Mon Sep 17 00:00:00 2001
3+From: Michael Forney <mforney@mforney.org>
4+Date: Tue, 31 Aug 2021 14:24:09 -0700
5+Subject: [PATCH] expose pcm_state in public API
6+
7+---
8+ include/tinyalsa/pcm.h | 2 ++
9+ 1 file changed, 2 insertions(+)
10+
11+diff --git a/include/tinyalsa/pcm.h b/include/tinyalsa/pcm.h
12+index 9fca92d..ddf58f0 100644
13+--- a/include/tinyalsa/pcm.h
14++++ b/include/tinyalsa/pcm.h
15+@@ -363,6 +363,8 @@ int pcm_start(struct pcm *pcm);
16+
17+ int pcm_stop(struct pcm *pcm);
18+
19++int pcm_state(struct pcm *pcm);
20++
21+ int pcm_wait(struct pcm *pcm, int timeout);
22+
23+ long pcm_get_delay(struct pcm *pcm);
24+--
25+2.37.3
26+
1@@ -0,0 +1,29 @@
2+From ecc8e52555cfbbbb14269880dea48cf0bf42ab50 Mon Sep 17 00:00:00 2001
3+From: Michael Forney <mforney@mforney.org>
4+Date: Mon, 31 Oct 2022 00:07:42 -0700
5+Subject: [PATCH] tinyplay: fix playback of 24-bit and 8-bit pcm
6+
7+The bits-to-format function returned bool, which happened to work
8+for PCM_FORMAT_S16_LE (0) and PCM_FORMAT_S32_LE (1). However, all
9+other formats were incorrectly mapped to PCM_FORMAT_S32_LE. Return
10+enum pcm_format instead.
11+---
12+ utils/tinyplay.c | 2 +-
13+ 1 file changed, 1 insertion(+), 1 deletion(-)
14+
15+diff --git a/utils/tinyplay.c b/utils/tinyplay.c
16+index 9f72bbb..d617074 100644
17+--- a/utils/tinyplay.c
18++++ b/utils/tinyplay.c
19+@@ -112,7 +112,7 @@ static bool is_wave_file(const char *filetype)
20+ return filetype != NULL && strcmp(filetype, "wav") == 0;
21+ }
22+
23+-static bool signed_pcm_bits_to_format(int bits)
24++static enum pcm_format signed_pcm_bits_to_format(int bits)
25+ {
26+ switch (bits) {
27+ case 8:
28+--
29+2.37.3
30+
+1,
-0
1@@ -0,0 +1 @@
2+Subproject commit 4fbaeef03cd1cb216e0f356c0433ca70f8b9c464
+1,
-0
1@@ -0,0 +1 @@
2+4fbaeef r0