Skip to content
This repository has been archived by the owner on Aug 21, 2023. It is now read-only.

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

Open
markjfisher opened this issue Oct 29, 2018 · 13 comments
Open

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

markjfisher opened this issue Oct 29, 2018 · 13 comments

Comments

@markjfisher
Copy link

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
Copy link

max-l commented Dec 3, 2018

+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
Copy link
Author

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
Copy link

max-l commented Dec 3, 2018

@markjfisher brilliant !

I volunteer for beta testing ! ;-)

@Lars
Copy link

Lars commented May 1, 2019

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
Copy link

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

@markjfisher
Copy link
Author

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
Copy link

nicola-lunghi commented Aug 12, 2019 via email

@nik-gnomic
Copy link

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
Copy link

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

@shiro
Copy link

shiro commented May 11, 2020

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
Copy link
Author

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

mead0w0 added a commit to mead0w0/Cadence that referenced this issue Feb 12, 2021
The pulse configuration file is selected from, in order:
- An environment variable
  - CADENCE_PULSE2JACK_PLAY/CADENCE_PULSE2JACK_PLAYREC
- A file
  - ~/.config/Cadence/pulse2jack/play[+rec].pa
- The original default file
  - $INSTALL_PREFIX/share/cadence/pulse2jack/play[+rec].pa

This is a partial solution for falkTX#234
@mead0w0
Copy link

mead0w0 commented Feb 12, 2021

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
Copy link

Ghostbird commented Mar 22, 2021

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants