After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 690719 - jackaudiosink: add new property (port-pattern) to specify which jack ports to autoconnect to
jackaudiosink: add new property (port-pattern) to specify which jack ports to...
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other Linux
: Normal enhancement
: 1.5.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2012-12-25 22:22 UTC by hark
Modified: 2015-02-18 13:55 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch (3.34 KB, patch)
2012-12-25 22:24 UTC, hark
rejected Details | Review
new patch (based on 1.0 and src added) (2.92 KB, patch)
2013-04-26 18:38 UTC, hark
rejected Details | Review
based on gst1.0, added jackaudiosrc (6.37 KB, patch)
2013-04-26 18:45 UTC, hark
needs-work Details | Review
patch that free's port_pattern (6.90 KB, patch)
2015-02-17 00:57 UTC, hark
reviewed Details | Review
patch in git format-patch format (7.40 KB, patch)
2015-02-17 11:28 UTC, hark
committed Details | Review

Description hark 2012-12-25 22:22:54 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
Comment 1 hark 2012-12-25 22:24:33 UTC
Created attachment 232218 [details] [review]
patch
Comment 2 Stefan Sauer (gstreamer, gtkdoc dev) 2013-04-20 18:43:04 UTC
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).
Comment 3 hark 2013-04-26 18:38:22 UTC
Created attachment 242608 [details] [review]
new patch (based on 1.0 and src added)
Comment 4 hark 2013-04-26 18:39:46 UTC
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).
Comment 5 hark 2013-04-26 18:41:51 UTC
Review of attachment 242608 [details] [review]:

uploaded wrong file
Comment 6 hark 2013-04-26 18:45:21 UTC
Created attachment 242609 [details] [review]
based on gst1.0, added jackaudiosrc

right file this time
Comment 7 Sebastian Dröge (slomo) 2013-12-27 13:23:51 UTC
Review of attachment 242609 [details] [review]:

This is leaking the port_pattern string in both cases. Needs to be free'd in GObject::finalize()
Comment 8 Sebastian Dröge (slomo) 2013-12-27 13:24:32 UTC
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
Comment 9 Sergey Kondakov 2015-02-16 13:46:36 UTC
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.
Comment 10 Sebastian Dröge (slomo) 2015-02-16 14:07:49 UTC
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? :)
Comment 11 Sergey Kondakov 2015-02-16 16:10:43 UTC
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.
Comment 12 hark 2015-02-17 00:57:31 UTC
Created attachment 296980 [details] [review]
patch that free's port_pattern

This patch should free port_pattern in gst_jack_audio_src_dispose
Comment 13 Sebastian Dröge (slomo) 2015-02-17 08:41:59 UTC
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?
Comment 14 hark 2015-02-17 11:28:13 UTC
Created attachment 297013 [details] [review]
patch in git format-patch format
Comment 15 Sebastian Dröge (slomo) 2015-02-17 11:44:30 UTC
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
Comment 16 Sebastian Dröge (slomo) 2015-02-17 11:44:45 UTC
Thanks for updating the patch :)
Comment 17 hark 2015-02-18 13:55:53 UTC
Thanks for merging it :)