GNOME Bugzilla – Bug 690719
jackaudiosink: add new property (port-pattern) to specify which jack ports to autoconnect to
Last modified: 2015-02-18 13:55:53 UTC
Hi, I added a new property to jackaudiosink, which makes it possible to autoconnect to a set of ports specified by a regular expression. The patch is against 0.10.31
Created attachment 232218 [details] [review] patch
Review of attachment 232218 [details] [review]: Could you rebase the patch for 1.0? Also what about the src? ::: gst-plugins-good0.10-0.10.31/ext/jack/gstjackaudiosink.c @@ +464,3 @@ + ports = jack_get_ports (client, sink->port_pattern, NULL, + JackPortIsInput); + } why are you dropping JackPortIsPhysical when using a pattern. I think this would be worth a discussion in general (or controlled by a separate flag).
Created attachment 242608 [details] [review] new patch (based on 1.0 and src added)
I rebased the patch on 1.0 and added the src. The reason why i did it this way is because i am using jack to route audio between applications (which are not physical ports), and because adding a flag is redundant, if you want to connect to a physical port you can do that with a pattern (or by not using port-pattern).
Review of attachment 242608 [details] [review]: uploaded wrong file
Created attachment 242609 [details] [review] based on gst1.0, added jackaudiosrc right file this time
Review of attachment 242609 [details] [review]: This is leaking the port_pattern string in both cases. Needs to be free'd in GObject::finalize()
Review of attachment 242609 [details] [review]: ::: ext/jack/gstjackaudiosink.c @@ +767,3 @@ + * autoconnect to ports matching pattern, when NULL connect to physical ports + * + * Since: Since: 1.4 ::: ext/jack/gstjackaudiosrc.c @@ +786,3 @@ + * autoconnect to ports matching pattern, when NULL connect to physical ports + * + * Since: Since: 1.4
Is it 2015 and there is no JACK port selection in GStreamer yet ? Good thing this can be worked around with forced patchbay redirection but that's still a legitimate deficiency and a patch is lying here for years.
And it has some minor things that have to be fixed, and then ideally be tested by someone who actually uses JACK. Want to help? :)
Well, i do use and build the system that uses JACK by default and has GStreamer both 0.10 and 1.0 - https://github.com/v-fox/live_opensuse_hsf And soon proper public build of live image starting from version 0.8.0 with JACK & full-scale redirection of everything to it will be made. As of now, i've put all audio sink variables of gconf at "/system/gstreamer/0.10/default" and dconf at "/desktop/gstreamer/0.10/default-elements/" to 'jackaudiosink buffer-time=2000000' (not sure why buffer-time is needed but people on Internet insist on it). But it doesn't seem to affect anything anywhere and there are no options for GStreamer 1.0 found anywhere. So i just select jack sink per app where i can and force global redirection from everything with port names "out_.*audiosink_.[1-2]" (most apps do 'out_jackaudiosink_X' but today I've found out one with 'out_audiosink_X' - subtitlecomposer) in JACK patchbay. I direct their first 2 ports (stereo) to jamin instead of physical, then jamin processes it and puts it there itself. It would be nice if GStreamer would have well-known working global configuration somewhere where one could force it to use jack sink/src and to connect to certain client/port. Like in ALSA/JACK compatibility plugin you can just put this in asoundrc: playback_ports { 0 jamin:in_L 1 jamin:in_R } capture_ports { 0 system:capture_1 1 system:capture_2 } But PulseAudio has the same problem as GStreamer: only boolean "connect" option for physical without any port definition (http://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/Modules/#index9h2). And, yeah, don't forget about capture/source ports too. They are not necessary physical either. As about "help": my coding skills are non-existent but testing and system building are present. I will assist with what i can. Too bad thought that making testing builds on non-bleeding-edge non-source-based systems is borderline masochistic.
Created attachment 296980 [details] [review] patch that free's port_pattern This patch should free port_pattern in gst_jack_audio_src_dispose
Comment on attachment 296980 [details] [review] patch that free's port_pattern Looks good except for some minor style issues that I will fix when merging. But can you please attach it in "git format-patch" format, or at least provide your real name for the commit?
Created attachment 297013 [details] [review] patch in git format-patch format
commit b1098c2ea5eabea7af08ce51d22b867eaed2bbe2 Author: hark <hark@puscii.nl> Date: Tue Feb 17 12:20:57 2015 +0100 jack: Add property port-pattern to specify which JACK ports to connect to https://bugzilla.gnome.org/show_bug.cgi?id=690719
Thanks for updating the patch :)
Thanks for merging it :)