qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Geoffrey McRae <geoff@hostfission.com>
To: Christian Schoenebeck <qemu_oss@crudebyte.com>
Cc: qemu-devel@nongnu.org, "José Pekkarinen" <koalinux@gmail.com>,
	kraxel@redhat.com
Subject: Re: [PATCH v2] Autoconnect jack ports by default
Date: Thu, 25 Feb 2021 09:04:47 +1100	[thread overview]
Message-ID: <5694e258e36c6623aae5465aafeec951@hostfission.com> (raw)
In-Reply-To: <3407243.daszWApDLn@silver>

This goes against how all standard jack clients work, a new jack client 
should not auto-connect at all unless explicitly configured to as if 
there is an existing audio diagram configured (which is 99% of the time) 
it will cause unexpected/undesired behavior.

Jack is not supposed to be an 'automatic' system, it's the 
responsibility of the patch bay software to route connections.

The auto-connect feature exists to allow the jack audiodev to re-connect 
a broken connection when the jack device restarts/reconnects.

On 2021-02-25 06:39, Christian Schoenebeck wrote:
> On Mittwoch, 24. Februar 2021 20:19:27 CET José Pekkarinen wrote:
>> 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;
> 
> Looks fine to me now.
> 
> Reviewed-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
> 
> Thanks José!
> 
> Best regards,
> Christian Schoenebeck


  reply	other threads:[~2021-02-24 22:06 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5694e258e36c6623aae5465aafeec951@hostfission.com \
    --to=geoff@hostfission.com \
    --cc=koalinux@gmail.com \
    --cc=kraxel@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu_oss@crudebyte.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).