madhatter68 / JackRouter

Yet Another JackRouter implementation for MacOS
MIT License
32 stars 5 forks source link

Multiple Inputs and Outputs #1

Open dainiusbukauskas opened 5 years ago

dainiusbukauskas commented 5 years ago

Hi Madhatter,

This is amazing! Thank you so much. Super low latency and working for me.

I would love to be able to set it up with maybe like 4 channels of in/out. Is there a way to do this with this app how it is? Or is that a feature not yet available.

Thanks,

madhatter68 commented 5 years ago

Hi Dain,

Thank you for comment. Sorry, the number of audio channels is not configurable because it's hard-coded. At first step, I fixed to make it configurable by changing macro in JackBridge.h. It still requires recompilation. So I prepared 8in-8out JackBridge driver/daemon for testing.

http://linux-dtm.ivory.ne.jp/downloads/MacOS/JackBridge_8in8out_20190214.zip

If you don't mind, please try it. I think replacing driver and restarting coreaudiod is enough for update. But you may have to reboot system after installation.

dainiusbukauskas commented 5 years ago

Hi Madhatter,

Thanks so much for putting this together. Unfortunately I can't get it to work. I tried several things, restarting multiple times, killing audiod, reinstalling, uninstalling jackrouter, reinstalling and I can't it to work. It's showing up in AudioMidi setup with 8ins and 8outs, but no audio is getting through. I'm sorry I'm not very good at this kind of coding. Here's what the jackrouter daemon gave me:

Last login: Wed Feb 13 15:19:10 on ttys000 You have new mail. aphrodite:~ dainiusbukauskas$ /Users/dainiusbukauskas/Downloads/JackBridge/JackBridge ; exit; Cannot connect to server socket err = Connection refused Cannot connect to server request channel jackdmp 1.9.11 Copyright 2001-2005 Paul Davis and others. Copyright 2004-2016 Grame. 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 set size of engine shm registry 0 (Invalid argument) Cannot create shared memory segment of size = 82280346 JackShmMem::new bad alloc jackctl_server_open error... Failed to open server Cannot connect to server socket err = Connection refused Cannot connect to server request channel Cannot connect to server socket err = Connection refused Cannot connect to server request channel Cannot connect to server socket err = Connection refused Cannot connect to server request channel Cannot connect to server socket err = Connection refused Cannot connect to server request channel Cannot connect to server socket err = Connection refused 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 jack_port_register called with a NULL client jack_port_register called with a NULL client jack_port_register called with a NULL client jack_port_register called with a NULL client jack_port_register called with a NULL client jack_port_register called with a NULL client jack_port_register called with a NULL client jack_port_register called with a NULL client jack_port_register called with a NULL client jack_port_register called with a NULL client jack_port_register called with a NULL client jack_port_register called with a NULL client jack_port_register called with a NULL client jack_port_register called with a NULL client jack_port_register called with a NULL client jack_port_register called with a NULL client jack_activate called with a NULL client

and this is what I'm seeing in audiomidi setup. The difference I noticed between Jack Router and Jack Bridge was that the volume control here is disabled, whereas it shows up as enabled with Jack Router.

screen shot 2019-02-13 at 3 24 00 pm

Thanks again for trying to get this working!

madhatter68 commented 5 years ago

It looks jack daemon startup failure. I haven't met this kind of error and couldn't reproduce it on my environment. Could you try following?

1) System restart, start only jack daemon, then start JackBridge. 2) If it works, compare the current jackd options (with 'ps ax | grep jack') with the contents in '~/.jackdrc' which should keep jackd options at autostart mode. 3) If staring daemon fails, check jack version (I think the latest version is here) and send me the messages from jackdmp. 4) If starting JackBridge fails, please send me the message log again.

Here is my jackd options I confirmed to work on my environment. (-C and -P depend on your audio device)

/usr/local/bin/jackdmp -T -ndefault -R -d coreaudio -r 44100 -p 512 -i 2 -o 2 -C AppleHDAEngineInput:1B,0,1,0:1 -P AppleHDAEngineOutput:1B,0,1,1:0

Thank you for cooperation.

tremblap commented 4 years ago

Hello. I've tried to compile myself in 8i 8o configuration, but I get strange error. What I did is to change lines 67-68-69 of JackBridge.h. to

#define NUM_INPUT_STREAMS   4
#define NUM_OUTPUT_STREAMS  4
#define MAX_STREAMS         4

and it compiles but I get this error when I start JackBridge:

does not match shmsize(196608). May be driver version mismatch mmap() failed with Invalid argument Attaching shared memory failed (id=0)

I have searched the code for shmsize and find it declared in two places:

I don't know how to compute the requested value, nor if either should match. Happy to test it here as I need JackRouter to work in a multi core audio software workflow so let me know if/how I can help/test stuff.

3x-sdda commented 3 years ago

Hello. I'm imac osx 10.13.6 user. i used precompiled build binary from this repo provided at start README.MD and it works, but JackBridgePlugIn.driver has only 4 mono in/outs available.

I also interested to get at least 32 mono - 16 stereo in/out, to JackBridge my audio equipment. Is there any guided solution how to patch these sources and compiile into working JackBridge? I tried to build the .driver with following parameters with Xcode

JackBridge.h:

define NUM_INPUT_STREAMS 32

define NUM_OUTPUT_STREAMS 32

define MAX_STREAMS 32

And after all manipulation guided at this repo in other issues i run in 'daemon' dir ./build.sh then cp'ed it to my 'bin' start jackd via qjackctl with 'default' name and my digi003 rack+ then i run JackBridge daemon and it terminates with

Jack: JackClient::SetupDriverSync driver sem in flush mode Jack: JackMachSemaphore::Connect name = js501.JackBridge #1 Jack: JackLibClient::Open name = JackBridge #1 refnum = 3 does not match shmsize(4259840). May be driver version mismatch Jack: JackClient::PortRegister ref = 3 name = JackBridge #1:input_1 type = 32 bit float mono audio port_index = 37 Jack: JackClient::PortRegister ref = 3 name = JackBridge #1:input_2 type = 32 bit float mono audio port_index = 38 Jack: JackClient::PortRegister ref = 3 name = JackBridge #1:input_3 type = 32 bit float mono audio port_index = 39 Jack: JackClient::PortRegister ref = 3 name = JackBridge #1:input_4 type = 32 bit float mono audio port_index = 40 Jack: JackClient::PortRegister ref = 3 name = JackBridge #1:input_5 type = 32 bit float mono audio port_index = 41 Jack: JackClient::PortRegister ref = 3 name = JackBridge #1:input_6 type = 32 bit float mono audio port_index = 42 Jack: JackClient::PortRegister ref = 3 name = JackBridge #1:input_7 type = 32 bit float mono audio port_index = 43 Jack: JackClient::PortRegister ref = 3 name = JackBridge #1:input_8 type = 32 bit float mono audio port_index = 44 Jack: JackClient::PortRegister ref = 3 name = JackBridge #1:input_9 type = 32 bit float mono audio port_index = 45 Jack: JackClient::PortRegister ref = 3 name = JackBridge #1:input_10 type = 32 bit float mono audio port_index = 46 Jack: JackClient::PortRegister ref = 3 name = JackBridge #1:input_11 type = 32 bit float mono audio port_index = 47 Jack: JackClient::PortRegister ref = 3 name = JackBridge #1:input_12 type = 32 bit float mono audio port_index = 48 Jack: JackClient::PortRegister ref = 3 name = JackBridge #1:input_13 type = 32 bit float mono audio port_index = 49 Jack: JackClient::PortRegister ref = 3 name = JackBridge #1:input_14 type = 32 bit float mono audio port_index = 50 Jack: JackClient::PortRegister ref = 3 name = JackBridge #1:input_15 type = 32 bit float mono audio port_index = 51 Jack: JackClient::PortRegister ref = 3 name = JackBridge #1:input_16 type = 32 bit float mono audio port_index = 52 Jack: JackClient::PortRegister ref = 3 name = JackBridge #1:output_1 type = 32 bit float mono audio port_index = 53 Jack: JackClient::PortRegister ref = 3 name = JackBridge #1:output_2 type = 32 bit float mono audio port_index = 54 Jack: JackClient::PortRegister ref = 3 name = JackBridge #1:output_3 type = 32 bit float mono audio port_index = 55 Jack: JackClient::PortRegister ref = 3 name = JackBridge #1:output_4 type = 32 bit float mono audio port_index = 56 Jack: JackClient::PortRegister ref = 3 name = JackBridge #1:output_5 type = 32 bit float mono audio port_index = 57 Jack: JackClient::PortRegister ref = 3 name = JackBridge #1:output_6 type = 32 bit float mono audio port_index = 58 Jack: JackClient::PortRegister ref = 3 name = JackBridge #1:output_7 type = 32 bit float mono audio port_index = 59 Jack: JackClient::PortRegister ref = 3 name = JackBridge #1:output_8 type = 32 bit float mono audio port_index = 60 Jack: JackClient::PortRegister ref = 3 name = JackBridge #1:output_9 type = 32 bit float mono audio port_index = 61 Jack: JackClient::PortRegister ref = 3 name = JackBridge #1:output_10 type = 32 bit float mono audio port_index = 62 Jack: JackClient::PortRegister ref = 3 name = JackBridge #1:output_11 type = 32 bit float mono audio port_index = 63 Jack: JackClient::PortRegister ref = 3 name = JackBridge #1:output_12 type = 32 bit float mono audio port_index = 64 Jack: JackClient::PortRegister ref = 3 name = JackBridge #1:output_13 type = 32 bit float mono audio port_index = 65 Jack: JackClient::PortRegister ref = 3 name = JackBridge #1:output_14 type = 32 bit float mono audio port_index = 66 Jack: JackClient::PortRegister ref = 3 name = JackBridge #1:output_15 type = 32 bit float mono audio port_index = 67 Jack: JackClient::PortRegister ref = 3 name = JackBridge #1:output_16 type = 32 bit float mono audio port_index = 68 Jack: JackClient::Activate Jack: JackPosixThread::StartImp : create non RT thread Jack: JackPosixThread::ThreadHandler : start Jack: JackClient::kBufferSizeCallback buffer_size = 256 Jack: JackClient::Init : period = 5337 computation = 100 constraint = 5337 Jack: JackMachThread::AcquireSelfRealTime fPeriod = 5337 fComputation = 100 fConstraint = 5337 Jack: JackMachThread::thread_policy_set res = 0 Jack: JackClient::ClientNotify ref = 3 name = JackBridge #1 notify = 2 Jack: JackClient::kActivateClient name = JackBridge #1 ref = 3 Jack: JackClient::ClientNotify ref = 3 name = JackBridge #1 notify = 18 Jack: JackClient::ClientNotify ref = 3 name = JackBridge #1 notify = 18 jack_port_get_buffer called with an incorrect port 0 Jack: JackClient::ClientNotify ref = 3 name = JackBridge #1 notify = 18 Segmentation fault: 11

Would be appreciate to point me at right way to understand how exactly coreaudio api internals cooperates with driver.