Skip to contentSkip to conversation

pcm_jack multi-channel and configurability patch

DISCUSSION Maarten de Boer 1 participant 3 messages Feb 17, 2003

lore
Share & tools
lore
#0 lore raw

Hello Jaroslav,

Attach you find another pcm_jack patch, that contains some major changes.

- now multichannel works (before only 1 channel worked). i tested stereo, and it works fine.

- i extended the configuration. the jack ports to connect to are now not hard-coded anymore. instead, they will have to be specified in the asound.conf, which allows to connect to any other jack client.

my asound.conf now looks like this:

pcm.jackplug {
	type plug
	slave { pcm "jack" }
}
pcm.jack {
	type jack
	playback_ports {
		0 alsa_pcm:playback_1
		1 alsa_pcm:playback_2
	}
	capture_ports {
		0 alsa_pcm:capture_1
		1 alsa_pcm:capture_2
	}
}

Is this syntax okay with you?

Right now, draining is not implemented, and I am not sure how to do it. For you it is probably very easy. Could you have a look at it?

When I ctrl-c the alsa application (I'm testing with aplay), I notice that close is called twice (?!), and that the client doesn't quit... I have no idea where this problem comes from. Alsa? Jack? Maybe Paul has an idea?

Maarten

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf

#1 lore raw
Quoted 2 lines · I wrote:

Attach you find another pcm_jack patch, that contains some major changes.

Forgot to attach it.

Maarten

Index: include/pcm_plugin.h
===================================================================
RCS file: /cvsroot/alsa/alsa-lib/include/pcm_plugin.h,v retrieving revision 1.6

pcm_plugin.h +2 -0
diff -u -r1.6 pcm_plugin.h
@@ -187,6 +187,8 @@
  *  Jack plugin
  */
 int snd_pcm_jack_open(snd_pcm_t **pcmp, const char *name,
+					snd_config_t *playback_conf,
+					snd_config_t *capture_conf,
 		      snd_pcm_stream_t stream, int mode);
 int _snd_pcm_jack_open(snd_pcm_t **pcmp, const char *name,
                        snd_config_t *root, snd_config_t *conf,

Index: src/pcm/pcm_jack.c
===================================================================
RCS file: /cvsroot/alsa/alsa-lib/src/pcm/pcm_jack.c,v retrieving revision 1.4

pcm/pcm_jack.c +205 -95

464 lines not on this page · raw message

#2 lore raw
In reply to Maarten de Boer

Hello Jaroslav,

Something else I need your advice on, is the full duplex operation.

When I try to run the latency test
./latency -c 2 -r 48000 -F FLOAT_LE -m 8192 -M 8192 -Pjack -Cjack -e

(btw, note the bug with the -f / -F flag!)

first of all,

	snd_pcm_hw_params_get_period_time(p_params, &p_time, NULL);
	snd_pcm_hw_params_get_period_time(c_params, &c_time, NULL);

return bogus values. I don't know why... anyway, I remove the p_time==c_time comparison to move on.

second, the playback is never started, since the snd_pcm_link doesn't work, so I start it by hand.

but then I get in XRUN immediately...

any suggestions?

Maarten

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf