30 Nov 03:10 2015
[LAU] Changing default Jack output ports to be an application's ports
Element Green <element@...>
2015-11-30 02:10:18 GMT
2015-11-30 02:10:18 GMT
Hello Linux Audio Users,
I'm working on a program to drive LED lights based on music playback on a Linux system. My application creates Jack input ports for frequency analysis which I'm currently connecting to the Jack monitor ports, this frequency analysis info is then used for controlling some RGB LED lights. The application I'm currently using for music playback is Clementine, which has a Jack sink option.
All this works fine. However, the frequency analysis of the input audio incurs unwanted latency, so there is a slight delay between changes in the music and lighting changes. What I want to do is delay the audio playback to match the full system latency to match the lighting updates as close to real time as possible.
My current thinking is to route the incoming Jack audio in my application back to the Jack playback ports, with a fixed delay buffer.
The problem is getting applications, such as Clementine, to connect to my application's ports instead of the physical output ports. My understanding of Clementine is that it is using gstreamer, and thus the jackaudiosink plugin. This plugin appears to have some properties for changing the default ports it connects to ("connect" and "port-pattern"). Clementine does not seem to offer a way to specify what ports it connects to though. What complicates it more is that the ports are disconnected/recreated for each song.
I suppose I could look into modifying the Clementine code to allow for a value for the "port-pattern" property to be specified, but I thought someone on this list might have some better ideas.
Some other thoughts I had:
Is it possible to modify the default system wide Jack playback ports to be an application? From what I have seen of code that auto connects to the playback ports, is that it looks for the first input port marked as Physical.
Is it possible to change the default system wide setting "port-pattern" for jackaudiosink?
Is it possible to modify jackaudiosink settings on a per application basis (say with an environment variable or config file) without having to modify the client program's source.
Thanks in advance for any help on this and cheers!
_______________________________________________ Linux-audio-user mailing list Linux-audio-user@... http://lists.linuxaudio.org/listinfo/linux-audio-user