Update of /cvsroot/alsa/alsa-lib/src/pcm/ext
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20967/ext
Modified Files:
pcm_jack.c
Log Message:
Michel Daenzer <[EMAIL PROTECTED]>:
This patch changes the JACK plugin to use a unique client name, which
allows for multiple ALSA streams to share a JACK server.
Index: pcm_jack.c
===================================================================
RCS file: /cvsroot/alsa/alsa-lib/src/pcm/ext/pcm_jack.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- pcm_jack.c 28 Oct 2003 18:19:09 -0000 1.4
+++ pcm_jack.c 5 Feb 2004 11:48:19 -0000 1.5
@@ -483,9 +483,9 @@
static snd_pcm_sframes_t snd_pcm_jack_avail_update(snd_pcm_t *pcm)
{
- snd_pcm_jack_t *jack = pcm->private_data;
snd_pcm_sframes_t ret = snd_pcm_mmap_avail(pcm);
#ifdef PCM_JACK_DEBUG
+ snd_pcm_jack_t *jack = pcm->private_data;
printf("snd_pcm_jack_avail_update appl=%d hw=%d
ret=%d\n",(int)jack->appl_ptr,(int)jack->hw_ptr,(int)ret); fflush(stdout);
#endif
return ret;
@@ -697,6 +697,8 @@
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,11 +725,9 @@
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) {
@@ -735,6 +735,15 @@
goto _free;
}
+ if (snprintf(jack_client_name, sizeof(jack_client_name), "alsa%s.%d.%d",
+ stream == SND_PCM_STREAM_PLAYBACK ? "P" : "C", getpid(), num++)
+ >= (int)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;
goto _free;
-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
Alsa-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-cvslog