Puredata, Jack and multi channel audio (only 2 channels showing, not 4)
@bobfred said:
How can I view a bluetooth output in jack so I can send these outputs independently to seperate devices?
JACK cannot do this. Period. JACK's timing requirements are far too strict for BT. Period.
(For sake of completeness: Some years ago, I tried to hack it using bluez-alsa and I did actually get JACK piping into Bluetooth earpieces for a short time, with a ridiculous buffer size of 8192 samples x 2 periods, like a quarter-second latency But then JACK would always hang within 15 minutes, and it was impossible to restart the JACK server without rebooting the whole system. So I found that this was not an especially joyful way to work and I gave it up.)
Pipewire might be able to do this.
hjh
Puredata, Jack and multi channel audio (only 2 channels showing, not 4)
I think this idea about the "system" only have 2 output channels is a good intuitive guess, only because it resonates with something I was supposing. Still not sure why or how thats the case it would impact it, nor how to change it.
However, ass FFWs post below displays, they are successful getting it to work on Debian.
@FFW said:
It works out of the box on Debian sid but with jack checked not portaudio
I was able to achieve this also, but the issue with jack is that it is not displaying bluetooth output devices.
Jack cannot support Bluetooth and it seems bluetooth headphone support is handled exclusively by PulseAudio (not even ALSA). How can I view a bluetooth output in jack so I can send these outputs independently to seperate devices?
thanks for confirming that jack supports the multiple inputs. I must have missed something... any idea why it wont work with pipewire? I am happy to use jack so long as I can get access to the bluetooth output.
readsf~, play speed, sample rate, and [timer] base time
@rph-r The only way Pulse could be the culprit is if you are running jack/portaudio through Pulse, but that is generally not done since Pulse has too much latency for realtime audio. I can't speak of portaudio (never used it) but with jack the general setup is to either have Pulse as a client of jack or have jack kill Pulse when it starts and restart Pulse when it shuts down. I would guess that the later is your setup, Pulse configures your audio card and jack is not great at doing that so just accepts what Pulse set it at. You might be able to get jack to set it properly or configure Pulse to use 44.1. Some soundcards jack just can not configure as far as I can tell so if you are using Pulse and having jack kill Pulse you need to either configure the soundcard manually or do it in Pulse before starting jack, I have to do this with my laptop, jack can not select between headphone and speaker outs and will use which ever is enabled when it starts.
Edit: I suppose it could also be the case that your soundcard is 48k only?
Pd on a Mac with Jack
@jameslo ALSA and OSS are low level/tied into the kernel. PipeWire, Jack and PulseAudio are more user level and communicate with ALSA or OSS. All of these have overlap but they are not quite the same thing. Essentially linux used OSS back in the day than OSS changed its licence so linux had to find something new in a hurry, enter ALSA which was not at all ready but pretty good, not as mature as OSS or as featureful but it did a good job within its limits, which is where Jack and Pulse come in. Jack and Pulse flesh out the features of ALSA but Pulse got adopted before it was ready and that first year or two was not fun and few seem to really like it, Jack is great when it works but can be a nightmare when it does not. Enter PipeWire which brings video into the mix and seems to solve many of the user/administration issues of the rest. Just fired up PipeWire for the first time ever and it seems to work quite well without issues but I have yet to give it a good test.
An application needs to be built with support for Jack, Pulse, ALSA and OSS if it wants to use them, PipeWire understands the languages of all of those and an app built with Jack or Pulse support will* work with PipeWire and unlike Pulse and Jack can also expose ALSA/OSS ports so applications can access them directly without the middle man which is one of the huge issues with Jack and Pulse, they both take over all available ports so no one else can get in. So now I am recompiling PD to see if it speaks to PipeWire through its Jack interface.
I know little to nothing about PortAudio, I believe it is a crossplatform library capable of talking to many different audio services.
*apparently you need to build the apps off of the PipeWire Jack libs and not the regular Jack libs which kind of sucks but nothing major, we don't have to wait for the devs to get around to fixing anything at least.
Pd on a Mac with Jack
Dummy check please. Is it true that:
- Jack can serve as audio loopback software between MacOS audio apps such as Pd
- Jack can run on an M2 processor
- The Qjackctl.app that is bundled with the Jack MacOS download runs on Monterrey without any additional runtime frameworks installed
- For Pd to send/receive from a Jack channel, Jack has to be running and you have to select Jack in the audio settings before you can select which particular Jack channel you want for input or output
- Soundflower is obsolete; Jack is current
?
Edit: I can confirm the 2nd through 4th bullet point but not the first and last. I've seen 2 tutorial videos on Mac audio loopback where you can see that the presenter has Soundflower installed in addition to whatever loopback software they were demonstrating, so that makes me scratch my head. RE that first point, I'm tentatively concluding that an audio app has to be Jack-aware (like Pd) in order for it to be routed by Jack, which isn't a requirement of other loopback drivers like Soundflower or Blackhole. Finally, it's worth noting that Jack doesn't come with an uninstaller, so to get rid of it you have to manually remove files from /usr/local and below, and the list of files can be found on one of the windows of the installation package if you scroll down. If that's not your cup of tea, don't install it!
TLDR: I'm not sure why anyone would want to use Jack on a Mac. Still happy to be schooled though.
Instability
Hello, first of all I want to say that I have been using Pd for 6 years on a PC i5 (fourth generation) 16gb ram and Windows 7 ultimate. Pd and other DAWs I have have always worked without any stability problems. A year ago I upgraded to Windows 10 home (I have always optimized Windows following the indications offered by Merging Technologies and some professional DAWS) Today all the software related to audio works perfectly and without any problem except PS that drives me crazy.
Just create a new patch with 2-3 tables and 2-3 signal objects to start the instability in Pd.
The first symptom that appears is the "feeling" of "overloaded". For example, when dragging an object with the mouse, the object is delayed with respect to the mouse pointer (the more the object patch is loaded, the more noticeable the delay is)
If I save the content of a table of only 8820 samples for example (200ms) with [soundfiler], it can take between 2 and 3 seconds to wait until the message appears in the console
It has also happened to me (although on fewer occasions) that when I press a bang button, the button remains pressed in black and Pd blocked (although I am not aware that this problem is directly related to the other comments).
I want to make it clear that I have not had any problems related to the audio, it is with the GUI that makes me think that something is not right. The first of the problems that I have named is the one that I consider serious for me, because it prevents me from working at ease and in the end I end up not going ahead with any patch. This happens to me in version 0.53.0 that I have now and in the previous 4 versions. I have used the same patches on a laptop that I have and everything works normally. I can't get to understand what is really happening and what the blissful problem may be related to, I have asked several Pd users on telegram and they have not been able to help me either...
Any ideas that occur to you will be welcome. Thank you!
No sound. Failed install?
@mario60 PulseAudio is hogging alsa. Supposedly you can use pd with pulse audio through the portaudio backend but it has never worked for me. You have a few other options as well, you can install jack recompile pd with jack support, this requires you to run pulse into jack, or jack into pulse, or suspend pulse when you start jack. Or you can suspend pulse and use alsa direct. Portaudio->PulseAudio can be troublesome with audio, Pulse has a fair amount of latency so if you want to process live sound it generally is not a viable option, but if you just want to patch together synths in pd than it should be fine.
Jack is the most reliable and the frontends for jack have provisions to handle the pulse stuff for you, but you will probably need to do some setup the first time around on a system like Fedora which does not seem all that popular in the audio community. Initial setup can be a pain but once it is going you just start jack and that is it. Suspending pulse manually and using alsa works well but there can be surprises when restarting pulse, and they can be a trick to sort out.
Problems with jack on linux.
Have you tried replacing both JACK & Pulseaudio with Pipewire? I have high-hopes for that, down the road. The artix Wiki has page specific to this: https://wiki.artixlinux.org/Site/PipewireInsteadPulseaudio
On Ubuntu & Debian now, Pulse and JACK can co-exist fairly well. I migrated to the KXstudio way of handling the two, vs Qjackctl, with the bridging controls in Cadence. Three, really, since there's also an ALSA bridge.
Even with JACK & Pulse bridged, my system automatically resets to the onboard sound device for Pulse, vs my default JACK interface (USB). Usually not an issue, but if I'm using Firefox or a video editor, it needs to be explicitly set.
I also use a pair of scripts to kill or restart Pulseaudio, since I'm using JACK 99% of the time. It's not really necessary, but it can reduce CPU load 3-4% :
#!/bin/bash
systemctl --user stop pulseaudio.socket
systemctl --user stop pulseaudio.service
If JACK can't start because some other service has grabbed the interface, try that script before re-configuring (I don't recall if that script alone stops Pulse from respawning, tho).
Problems with jack on linux.
@bocanegra Thank you, i do hve librewolf (firefox) open, so i want that to work. i installed qjackctl and pulseaudio-jack on my artix (arch based) openrc system. it worked, purr data works, but librewolf audio clips and sounds like crap, i disconnected my usb headphones and reconnected them, but now librewolf outpts no audio, the same with purr data, except it shows up in the graph in qjackctl unlike librewolf which disappeared from there.
i restarted my system just now and jack won't start for some reason, but librewolf audio works fine.
error message in qjackctl:
13:31:47.206 JACK is starting...
13:31:47.208 /usr/bin/jackd -dalsa -dhw:0 -r48000 -p64
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
13:31:47.226 JACK was started with PID=3085.
Could not open component .so '/usr/lib/jack/jack_firewire.so': libffado.so.2: cannot open shared object file: No such file or directory
Could not open component .so '/usr/lib/jack/jack_firewire.so': libffado.so.2: cannot open shared object file: No such file or directory
jack_get_descriptor : dll
jack_get_descriptor returns null for 'jack_firewire.so'
Could not open component .so '/usr/lib/jack/jack_firewire.so': libffado.so.2: cannot open shared object file: No such file or directory
jackdmp 1.9.19
Copyright 2001-2005 Paul Davis and others.
Copyright 2004-2016 Grame.
Copyright 2016-2021 Filipe Coelho.
jackdmp comes with ABSOLUTELY NO WARRANTY
This is free software, and you are welcome to redistribute it
under certain conditions; see the file COPYING for details
JACK server starting in realtime mode with priority 10
self-connect-mode is "Don't restrict self connect requests"
Cannot lock down 107341340 byte memory area (Cannot allocate memory)
audio_reservation_init
Acquire audio card Audio0
creating alsa driver ... hw:0|hw:0|64|2|48000|0|0|nomon|swmeter|-|32bit
ATTENTION: The playback device "hw:0" is already in use. Please stop the application using it and run JACK again
Released audio card Audio0
audio_reservation_finish
Cannot initialize driver
JackServer::Open failed with -1
Failed to open server
13:31:47.348 JACK was stopped
13:31:49.270 Could not connect to JACK server as client. - Overall operation failed. - Unable to connect to server. Please check the messages window for more info.
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
Any help?
Problems with jack on linux.
@bocanegra said:
jack has to be set up properly for the server to run without dropouts (select the correct soundcard, buffer size etc in settings), or even start at all. For this purpose I use qjackctl, which is a GUI control panel for the jack server-
Agreed -- IMO it's highly recommended to manage the JACK server using JACK tools, and not recommended to expect the JACK client app to do it for you.
qjackctl.
Also there are PulseAudio-JACK modules which, when configured correctly, allow JACK and non-JACK apps to coexist peacefully. I've been running this way for 11 years now in Ubuntu. It's unfortunate that it isn't set up like this out of the box, but you don't have to accept the either/or situation.
hjh