diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2020-05-17 14:32:10 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2020-05-17 14:32:10 +0100 |
commit | 51c50bd4c895ebf56d81fecae8e45ec3b5fc3efa (patch) | |
tree | 753b6b08624c34d1ed8414bbe22c45409f7741b9 /media-sound/apulse/files | |
parent | be9d77d3ac6af8f4ead98d89706f356b65578c93 (diff) | |
parent | deba8115d2c2af26df42966b91ef04ff4dd79cde (diff) |
Merge branch 'edge' into next
Diffstat (limited to 'media-sound/apulse/files')
-rw-r--r-- | media-sound/apulse/files/check-key-before-remove.patch | 54 | ||||
-rw-r--r-- | media-sound/apulse/files/man.patch | 30 |
2 files changed, 84 insertions, 0 deletions
diff --git a/media-sound/apulse/files/check-key-before-remove.patch b/media-sound/apulse/files/check-key-before-remove.patch new file mode 100644 index 000000000000..28fe0fc0d168 --- /dev/null +++ b/media-sound/apulse/files/check-key-before-remove.patch @@ -0,0 +1,54 @@ +From bf146f0d711ce3e48cdc8ba772039d843d590b47 Mon Sep 17 00:00:00 2001 +From: "Miouyouyou (Myy)" <myy@miouyouyou.fr> +Date: Sun, 20 Oct 2019 05:09:29 +0200 +Subject: [PATCH] stream: Check the key before invoking g_hash_table_remove + +Turns out that I hit a bug where pa_stream_unref would +call g_hash_table_remove with a NULL key. + +Thanks for the lightweight and smooth error handling from +Glib, g_hash_table_remove generated an ABORT call, crashing +some Unity3D games I was trying to start. +Now, you also CANNOT call g_hash_table_lookup with a NULL +key. That also generate a crash... Ugh... + +So, yeah, we first check that the key is not 0, then check +if the key is actually inside the Hash table and THEN remove +it. + +Note, here's my ~/.asoundrc, just in case : +defaults.pcm.!card Audio +defaults.ctl.!card Audio + +Audio being : +card 3: Audio [DigiHug USB Audio], device 0: USB Audio [USB Audio] + Subdevices: 0/1 + Subdevice #0: subdevice #0 +card 3: Audio [DigiHug USB Audio], device 1: USB Audio [USB Audio #1] + Subdevices: 1/1 + Subdevice #0: subdevice #0 + +I'm using a FiiO device for sound output. + +Signed-off-by: Miouyouyou (Myy) <myy@miouyouyou.fr> +--- + src/apulse-stream.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/src/apulse-stream.c b/src/apulse-stream.c +index 84b18bb..1de4885 100644 +--- a/src/apulse-stream.c ++++ b/src/apulse-stream.c +@@ -1019,7 +1019,11 @@ pa_stream_unref(pa_stream *s) + + s->ref_cnt--; + if (s->ref_cnt == 0) { +- g_hash_table_remove(s->c->streams_ht, GINT_TO_POINTER(s->idx)); ++ GHashTable * __restrict const streams_ht = ++ s->c->streams_ht; ++ void const * key = GINT_TO_POINTER(s->idx); ++ if (key && g_hash_table_lookup(streams_ht, key)) ++ g_hash_table_remove(streams_ht, key); + ringbuffer_free(s->rb); + free(s->peek_buffer); + free(s->write_buffer); diff --git a/media-sound/apulse/files/man.patch b/media-sound/apulse/files/man.patch new file mode 100644 index 000000000000..a26e32d8b9c0 --- /dev/null +++ b/media-sound/apulse/files/man.patch @@ -0,0 +1,30 @@ +From 2c2bf366599d957837acbdf54eb300526fc125a1 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com> +Date: Tue, 5 May 2020 14:24:52 -0300 +Subject: [PATCH] Add ENVIRONMENT to man-page. + +--- + man/apulse.1 | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +diff --git a/man/apulse.1 b/man/apulse.1 +index cd67cf3..df75c60 100644 +--- a/man/apulse.1 ++++ b/man/apulse.1 +@@ -36,6 +36,16 @@ compatibility layer between OSS programs and \fBALSA\fR, \fBapulse\fR was + designed to be compatibility layer between PulseAudio applications and + \fBALSA\fR. + ++.SH ENVIRONMENT ++ ++The following environment variables can be used to configure the devices used ++by \fBapulse\fR. Try \fIhw:0,0\fR, \fIplughw:0,0\fR and the like. ++Refer to the ALSA user guide for a full list of device names. ++ ++\fIAPULSE_CAPTURE_DEVICE\fR: Can be used to configure the capture device. ++ ++\fIAPULSE_PLAYBACK_DEVICE\fR: Can be used to configure the playback device. ++ + .SH RETURN VALUE + + \fBapulse\fR is a simple shell wrapper script that calls \fBexec\fR on the |