All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] Autoconnect jack ports by default
@ 2021-02-24 19:19 José Pekkarinen
  2021-02-24 19:39 ` Christian Schoenebeck
  0 siblings, 1 reply; 14+ messages in thread
From: José Pekkarinen @ 2021-02-24 19:19 UTC (permalink / raw)
  To: kraxel; +Cc: geoff, qemu-devel, koalinux

This patch provides a default value to connect
jack ports when the user don't specify connect-ports.

Buglink: https://bugs.launchpad.net/qemu/+bug/1908832

Signed-off-by: José Pekkarinen <koalinux@gmail.com>
---
 audio/jackaudio.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/audio/jackaudio.c b/audio/jackaudio.c
index 3031c4e29b..0a87d5e23a 100644
--- a/audio/jackaudio.c
+++ b/audio/jackaudio.c
@@ -369,14 +369,23 @@ static size_t qjack_read(HWVoiceIn *hw, void *buf, size_t len)
 
 static void qjack_client_connect_ports(QJackClient *c)
 {
-    if (!c->connect_ports || !c->opt->connect_ports) {
+    if (!c->connect_ports) {
         return;
     }
 
     c->connect_ports = false;
     const char **ports;
-    ports = jack_get_ports(c->client, c->opt->connect_ports, NULL,
-        c->out ? JackPortIsInput : JackPortIsOutput);
+    if (c->out) {
+        ports = jack_get_ports(c->client,
+            c->opt->connect_ports ? c->opt->connect_ports
+                : "system:playback_.*",
+            NULL, JackPortIsInput);
+    } else {
+        ports = jack_get_ports(c->client,
+            c->opt->connect_ports ? c->opt->connect_ports
+                : "system:capture_.*",
+            NULL, JackPortIsOutput);
+    }
 
     if (!ports) {
         return;
-- 
2.26.2



^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2021-03-04 14:13 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-24 19:19 [PATCH v2] Autoconnect jack ports by default José Pekkarinen
2021-02-24 19:39 ` Christian Schoenebeck
2021-02-24 22:04   ` Geoffrey McRae
2021-02-24 22:33     ` Christian Schoenebeck
2021-02-24 22:38       ` Geoffrey McRae
2021-02-25  8:31         ` José Ramón Muñoz Pekkarinen
2021-02-25  8:48       ` Gerd Hoffmann
2021-02-26 11:40         ` Christian Schoenebeck
2021-03-03  7:13           ` Gerd Hoffmann
2021-03-04 11:24             ` Christian Schoenebeck
2021-03-04 11:56               ` Daniel P. Berrangé
2021-03-04 13:12                 ` Gerd Hoffmann
2021-03-04 13:53                   ` Daniel P. Berrangé
2021-03-04 14:12                     ` Gerd Hoffmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.