gisogrimm / ov-client

Clients (headless and GUI) to share and receive spatial realtime audio on Linux and MacOS using JACK, zita-njbridge and TASCAR
GNU General Public License v3.0
24 stars 7 forks source link

[macOS] jackd tries to use 'alsa' instead of coreaudio #24

Closed delude88 closed 2 years ago

delude88 commented 4 years ago

When running ov-client on macOS, the following line appears inside the console output:

jackd: unknown driver 'alsa'

It seems like jackd tries to use alsa instead of coreaudio.

Also there is no sound input or output on any device (that is chosen via box.orlandoviols.com frontend).

delude88 commented 4 years ago

Full console output for

tobias@imac build % ./ov-client
creating renderer with device id "38c9863eb6f1" and pinglogport 0.
creating frontend interface for http://oldbox.orlandoviols.com/
starting services
src/ov_render_tascar.cc:534: virtual void ov_render_tascar_t::start_audiobackend() audiodevice.devicename=hw:1
src/ov_render_tascar.cc:550: virtual void ov_render_tascar_t::start_audiobackend() cmd=JACK_NO_AUDIO_RESERVATION=1 jackd --sync -P 40 -d alsa -d hw:1 -r 48000 -p 96 -n 2
jackd: unknown driver 'alsa'
listening on "osc.udp://imac.fritz.box:9871/"
Error: Unable to open receiver module "ortf": dlopen(ovclienttascarreceiver_ortf.dylib, 2): image not found
listening on "osc.udp://imac.fritz.box:9871/"
Error: Unable to open receiver module "ortf": dlopen(ovclienttascarreceiver_ortf.dylib, 2): image not found
listening on "osc.udp://imac.fritz.box:9871/"
Error: Unable to open receiver module "ortf": dlopen(ovclienttascarreceiver_ortf.dylib, 2): image not found
Wed Oct 28 18:33:41 2020 [4468] listening
listening on "osc.udp://imac.fritz.box:9871/"
Error: Unable to open receiver module "ortf": dlopen(ovclienttascarreceiver_ortf.dylib, 2): image not found
src/ov_render_tascar.cc:534: virtual void ov_render_tascar_t::start_audiobackend() audiodevice.devicename=highest
src/ov_render_tascar.cc:540: virtual void ov_render_tascar_t::start_audiobackend() devs.empty()=1
src/ov_render_tascar.cc:550: virtual void ov_render_tascar_t::start_audiobackend() cmd=JACK_NO_AUDIO_RESERVATION=1 jackd --sync -P 40 -d alsa -d highest -r 48000 -p 96 -n 2
Wed Oct 28 18:39:02 2020 [4468] listening
listening on "osc.udp://imac.fritz.box:9871/"
Error: Unable to open receiver module "ortf": dlopen(ovclienttascarreceiver_ortf.dylib, 2): image not found
delude88 commented 4 years ago

The issue can be fixed here:

https://github.com/gisogrimm/ov-client/blob/ddb44df133208458ec6663409898e11791b5e05f/src/ov_render_tascar.cc#L546

Here we have to modify the call, so that core audio is used instead of alsa. Also the other parameter have to be different.

Example for -p 96: CA: -p must be a power of two.

gisogrimm commented 4 years ago

The structure audio_device_t should handle this. Right now drivername is always "jack", but maybe it would be better to have "jack/alsa" and "jack/coreaudio", or if jack to use always coreaudio on MacOS. In general the ov-client should report the available drivers along with the list of available devices. Maybe it needs improvement, as the list of devices typically will depend on the driver. The devices are listed here: https://github.com/gisogrimm/ov-client/blob/master/src/ov_client_orlandoviols.cc#L124 Better would be a return value of type std::map< std::string,std::vector<std::string> > (for each driver a list of possible devices). Or even better: std::map< std::string,std::vector<soundcard_settings_range_t> > where soundcard_settings_range_t contains the device name, supported sampling rates and supported period sizes/size ranges. This would be the right place to restrict it to power of two with coreaudio.

gisogrimm commented 4 years ago

Please try https://github.com/gisogrimm/ov-client/commit/ef9af7fa8d59ee31027e542528d5898acd5c55da to see if it solves this issue.

gisogrimm commented 4 years ago

Please see also #25 - currently no soundcards are detected on MacOS, which means it may only work if jack is started manually.

hendrikkayser commented 3 years ago

It works if jack is started manually, also -r 48000 -p 96 works fine for me under MacOS.

The 'hw:1' option does not work as strange device names are used, e.g., my USB device is the following: Device ID = '87' name = 'Scarlett 2i2 USB', internal name = 'AppleUSBAudioEngine:Focusrite:Scarlett 2i2 USB:Y8PPJNE93055F3:1,2' (to be used as -C, -P, or -d parameter)

delude88 commented 3 years ago

@hendrikkayser which version of jack are you using?

I'm using the home-brew version of jack: https://formulae.brew.sh/formula/jack

hendrikkayser commented 3 years ago

I'm using jack2 (1.9.11).

gisogrimm commented 2 years ago

Problem was fixed a while ago.