mod-audio / mod-desktop

MOD Audio for the desktop
https://mod.audio/
GNU Affero General Public License v3.0
169 stars 9 forks source link

[Linux] Enhanchement - Jack DBUS option to route desktop audio via pulseaudio #25

Closed raidolo closed 11 months ago

raidolo commented 12 months ago

Hi,

I've noticed that using mod-app I can't use the pulseaudio jack sink, because jackdbus is not enabled, so basically I can't play anything from the desktop using the same audio card used in Jack.

It would be great to have jackdbus enabled in the jackd instance created by mod-app, so then the pulse audio jack sink can be loaded at least via "pacmd" using a script.

Thanks!

falkTX commented 12 months ago

that is a no. we need classic jackd without dbus. the dbus stuff would involve mod-app becoming the "owner" of the audio device which dont think it is ideal.

for using together with pulseaudio just pick the "ALSA::pulse" device.

raidolo commented 12 months ago

that is a no. we need classic jackd without dbus. the dbus stuff would involve mod-app becoming the "owner" of the audio device which dont think it is ideal.

for using together with pulseaudio just pick the "ALSA::pulse" device.

I'll try this way, I'll let you know. Routing desktop audio inside Mod would allow also recording other sources plus you can patch anything inside jack. In windows some devices has loopback capabilities inside the Asio drivers that create "virtual" devices and allows this. For instance, is possible to live stream the audio with this approach. I'll do some more tests.

raidolo commented 12 months ago

that is a no. we need classic jackd without dbus. the dbus stuff would involve mod-app becoming the "owner" of the audio device which dont think it is ideal.

for using together with pulseaudio just pick the "ALSA::pulse" device.

The thing is: in windows, using Asio drivers, I can hear the audio coming from the browser, using the same interface I'm using with Mod. (I need to check if I have the loopback enabled or not). In Linux currently, I hear nothing outside Mod. Not ideal either

raidolo commented 12 months ago

I've tried to use ALSA::pulse and then I've set the system mixer recording to the usb soundcard. The latency is huge, it can't be used like this really. ;(

falkTX commented 11 months ago

I looked more into this, did some changes but overall it is not good news. The automatic way of pulseaudio to give away the device and switch to a jack client mode relies on a global jack instance, which mod-app being a self-contained thing cannot do.

I revised the linux device discovery to make sure it lists all devices, regardless of them being in use or not. Also renamed the "JACK" option to "JACK / PipeWire" as it should work there too. And yeah, the "ALSA::pulse" driver was quite useless so that got removed now.

So now mod-app can start with any audio device by asking the currently active server (pulseaudio, pipewire, jack or other) to give it up. But connecting this to other parts of the system breaks the self-contained usage of mod-app, and thus can't be done.

The approach here is to either use pipewire, or start jack before starting mod-app, so you can can pick "JACK / PipeWire" from the device list.

raidolo commented 11 months ago

Thanks!! I'll try the new options soon. I believe it's enough to let the user use the system audio server.

raidolo commented 11 months ago

It works GOOOODDDD! I'll test it more but for now, using the system's Jackd is ok!