From: "Michel Dänzer" <michel@daenzer.net>
To: alsa-devel@lists.sourceforge.net
Subject: [PATCH] make JACK client name unique
Date: Wed, 04 Feb 2004 22:17:19 +0100 [thread overview]
Message-ID: <1075929438.12299.163.camel@thor.asgaard.local> (raw)
[-- Attachment #1: Type: text/plain, Size: 616 bytes --]
Now that dmix is working well, I felt like trying something new. :)
This patch changes the JACK plugin to use a unique client name, which
allows for multiple ALSA streams to share a JACK server.
Unfortunately, as reported earlier, some apps hang with the JACK plugin,
and some even fail, e.g.
ogg123: pcm_plug.c:884: snd_pcm_plug_hw_params: Assertion `err >= 0'
failed.
I can provide output from pcm_params.c built with RULES_DEBUG defined if
that's useful.
--
Earthling Michel Dänzer | Debian (powerpc), X and DRI developer
Libre software enthusiast | http://svcs.affero.net/rm.php?r=daenzer
[-- Attachment #2: alsa-pcm-jack-unique-client-name.diff --]
[-- Type: text/x-patch, Size: 1440 bytes --]
Index: src/pcm/ext/pcm_jack.c
===================================================================
RCS file: /cvsroot/alsa/alsa-lib/src/pcm/ext/pcm_jack.c,v
retrieving revision 1.4
diff -p -u -r1.4 pcm_jack.c
--- src/pcm/ext/pcm_jack.c 28 Oct 2003 18:19:09 -0000 1.4
+++ src/pcm/ext/pcm_jack.c 4 Feb 2004 19:18:07 -0000
@@ -697,6 +697,8 @@ int snd_pcm_jack_open(snd_pcm_t **pcmp,
snd_pcm_jack_t *jack;
int err;
int fd[2];
+ static unsigned int num = 0;
+ char jack_client_name[32];
assert(pcmp);
#ifdef PCM_JACK_DEBUG
@@ -723,17 +725,24 @@ int snd_pcm_jack_open(snd_pcm_t **pcmp,
if (stream == SND_PCM_STREAM_PLAYBACK) {
jack->channels = jack->playback_ports_n;
- jack->client = jack_client_new("alsaP");
}
else {
jack->channels = jack->capture_ports_n;
- jack->client = jack_client_new("alsaC");
}
if (jack->channels == 0) {
SNDERR("define the %s_ports section\n", stream == SND_PCM_STREAM_PLAYBACK ? "playback" : "capture");
goto _free;
}
+
+ if (snprintf(jack_client_name, sizeof(jack_client_name), "alsa%s.%d.%d",
+ stream == SND_PCM_STREAM_PLAYBACK ? "P" : "C", getpid(), num++)
+ >= sizeof(jack_client_name)) {
+ fprintf(stderr, "%s: WARNING: JACK client name '%s' truncated to %d characters, might not be unique\n",
+ __func__, jack_client_name, strlen(jack_client_name));
+ }
+
+ jack->client = jack_client_new(jack_client_name);
if (jack->client==0) {
err = -ENOENT;
next reply other threads:[~2004-02-04 21:17 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-02-04 21:17 Michel Dänzer [this message]
2004-02-05 11:52 ` [PATCH] make JACK client name unique Takashi Iwai
2004-02-05 23:22 ` Michel Dänzer
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=1075929438.12299.163.camel@thor.asgaard.local \
--to=michel@daenzer.net \
--cc=alsa-devel@lists.sourceforge.net \
/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 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.