falkTX / Cadence

Collection of tools useful for audio production
GNU General Public License v2.0
370 stars 81 forks source link

Feature Request: Configurable Pulse2Jack Sink/Sources (multiple) #234

Open markjfisher opened 5 years ago

markjfisher commented 5 years ago

I've locally changed cadence-pulse2jack to read from a local configuration file to setup multiple sink/sources in pulse2jack bridges.

The config file looks something like:

#type|Name|channels|connect
source|PulseAudio JACK Source|2|yes
sink|PulseAudio JACK Sink|2|yes
source|Discord Input|2|no
sink|Discord Output|2|no
sink|Music Output|2|no

and then cadence-pulse2jack sources this into a copy of /usr/share/cadence/pulse2jack/play+rec.pa (or in the case of it running, directly into pactl commands) when starting up the bridge, so I end up with multiple sink/sources available in jack, that are also available to applications that you can set input/output, and which then allows me to load different effects on each channel, rather than everything on the global "PulseAudio JACK Source/Sink".

Is this something that would be useful to contribute as a pull request? If so, how would you like the configuration done? I've currently got a simple text file in a known location. Also, is this possible in a different way? I'm copying a similar setup on my linux box from my Windows machine, where I was able to create multiple loopback devices to achieve the same thing, but this seemed to be missing in the linux setup, hence why I've added it.

Example look after startup in Claudia: image

Mark Fisher

max-l commented 5 years ago

+1000

@markjfisher I was about to create an issue for this precise feature (the ability to have multiple pulse sinks and sources),

@falkTX please accept this pull request !

markjfisher commented 5 years ago

I've been working on it over last few weeks in my spare time and will have something to show soon, with configuration done directly from within cadence.

Here's how it currently looks.

image

max-l commented 5 years ago

@markjfisher brilliant !

I volunteer for beta testing ! ;-)

Lars commented 5 years ago

Hello @markjfisher I wonder if you've made any progress with this test, or if you're willing to push the changes to git to give it a spin. I'm trying to achieve this on my side and any work done would help me get jumpstarted on it greatly.

nicola-lunghi commented 5 years ago

+100000 even here can you create a pull request/patch?

markjfisher commented 5 years ago

I'm sorry I haven't pushed this yet. My linux dev machine went problematic several months ago and I switched back to a Mac, so this got left behind. I still have the code, and will be getting a new Linux machine soon, so intend to bring it back up to date. The bits that were missing are: 1) the interaction with GUI is not the best, I've never done QT dev before. 2) Amending the startup shell script needs some tweaking. It's not far off, I will definitely finish this.

nicola-lunghi commented 5 years ago

Hi Thanks for your response. If you push it in a branch somewhere I can have a look. Cheers Nick

On Mon 12 Aug 2019, 06:47 Mark Fisher, notifications@github.com wrote:

I'm sorry I haven't pushed this yet. My linux dev machine went problematic several months ago and I switched back to a Mac, so this got left behind. I still have the code, and will be getting a new Linux machine soon, so intend to bring it back up to date. The bits that were missing are: 1) the interaction with GUI is not the best, I've never done QT dev before. 2) Amending the startup shell script needs some tweaking. It's not far off, I will definitely finish this.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/falkTX/Cadence/issues/234?email_source=notifications&email_token=AGB6YTCGTYCV5QKVWRG67L3QED2NZA5CNFSM4GADNGAKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4BTQYA#issuecomment-520304736, or mute the thread https://github.com/notifications/unsubscribe-auth/AGB6YTEXI5VUWJT6JN5PSHTQED2NZANCNFSM4GADNGAA .

nik-gnomic commented 4 years ago

i use a bash script for 2 sinks and 1 source with additional options to rename Pulseaudio JACK Sinks/Sources

pactl load-module module-jack-sink sink_name=aux_out client_name=aux2jack channels=2 connect=0
pactl load-module module-jack-sink sink_name=voip_out client_name=voip2jack channels=2 connect=0
pactl load-module module-jack-source source_name=voip_in client_name=jack2voip channels=2 connect=0
pactl set-default-sink aux_out
pactl set-default-source voip_in

audio playback in Pulseaudio uses default sink aux2jack. VOIP calls must be manually assigned to voip_out in pavucontrol --tab=1

GraithTiger commented 4 years ago

I'm quite interested in this, but @nik-gnomic's workaround works for me atm.

shiro commented 4 years ago

This would be much appreciated. Another workaround I use to disconnect it is to put this in my audio startup script:

#!/bin/bash
jack_disconnect "PulseAudio JACK Sink:front-left"  "system:playback_1"
jack_disconnect "PulseAudio JACK Sink:front-right" "system:playback_2"

I don't want to disable self-connect throughout the entire jack server, so this was my only option that works with cadence atm.

markjfisher commented 4 years ago

I've made a PR for this UI change, see #290

mead0w0 commented 3 years ago

If anyone's interested, the PR I just added can be used as a workaround for this in the meantime. It allows you to specify a configuration file in ~/.config or via an environment variable.

Ghostbird commented 3 years ago

I'm using the Non Session Manager, with this script to add sinks and sources.

You can easily adapt it to your own wishes, and of course you can use any other session manager you want, or run the script in other ways.

Not to diminish the efforts of people who actually contribute to the program. Just to bridge the time until the PR is merged.