monocasual / giada

Your Hardcore Loop Machine.
https://www.giadamusic.com
GNU General Public License v3.0
1.71k stars 98 forks source link

[macOS] Input Device won't stick, always resets to (disabled) #157

Closed ssteinerx closed 4 years ago

ssteinerx commented 6 years ago

Using Core Audio, the built in mic and my USB input device show up in the dropdown.

Both inputs show correct input level in System Preferences i.e. they're both working and I use them for other things.

If I go to preferences, select either input, save, immediately reopen the dialog and it's back to (disabled). I've tried all permutations; I write software for a living.

Something has changed, however, because when I exit and reopen Giada, it tells me my soundcard is not configured.

Dead in the water at this point.

OS X 10.12.6, Giada 0.14.4 (1.0)

monocasual commented 6 years ago

Hi @ssteinerx , this is odd. First of all, could you please paste here the console output when you run Giada?

ssteinerx commented 6 years ago

@monocasual I'm on OS X and there is nothing useful in the console. A search from Giada comes up empty, and any messages that may be related are buried among many many others.

Anything else I can try (other than building and tracing through)? Any good place for a breakpoint etc.?

monocasual commented 6 years ago

Try to run the app from the command line (i.e. don't double-click on the .app package), otherwise I would set a breakpoint @:

  1. https://github.com/monocasual/giada/blob/3a01f5cdf5cf3355ef22724a34a4586f1850930f/src/core/kernelAudio.cpp#L96 - this is where the sound system is initialized, just to make sure your sound card is recognized properly;

  2. https://github.com/monocasual/giada/blob/3a01f5cdf5cf3355ef22724a34a4586f1850930f/src/gui/elems/config/tabAudio.cpp#L449 - more likely, this is where the "Input Device" selection is stored from the drop-down menu. I'm pretty sure there is something wrong with it, might worth investigating...

Later on I too wil give it a try on our ancient Mac.

ssteinerx commented 6 years ago

int openDevice() is getting api == 16 from conf::soundSystem and the log message "[KA] using rtSystem..." is NOT coming out in the console.

In the call (kernelAudio.cpp): if (api == G_SYS_API_CORE && hasAPI(RtAudio::MACOSX_CORE))

in hasAPI, RtAudio::getCompiledApi(APIs); gets APIs back containing a single element which is RTAUDIO_DUMMY.

From reading in the RtAudio.cpp file, it looks like __MACOSXCORE_\ isn't #defined, or MACOSX_CORE would be in there too.

Not sure what to do at this point; looks more like a broken build process than a specific code problem since the missing #define of __MACOSXCORE_\ in RtAudio.cpp is making it so the code can't work.

monocasual commented 6 years ago

in hasAPI, RtAudio::getCompiledApi(APIs); gets APIs back containing a single element which is RTAUDIO_DUMMY.

This is the core problem: RtAudio didn't find any available API during the compilation phase. You shouldn't get this kind of error if you are using the pre-compiled version (i.e. the one you download from the website).

My suggestion: try again with the new commit 4d9d5375affc749167043e9a21ddc2bc850626e2, it will output some additional debug information during the KernelAudio::OpenDevice call.

ssteinerx commented 6 years ago

During compliation?

What is it that's different about the pre-compiled version build process?

ssteinerx commented 6 years ago

Sorry, identical result and I'm not seeing the log output anywhere; am I supposed to be using some switches that autoconf/configure/make don't set?

monocasual commented 6 years ago

OK, let's try to sort out the log output first. Just make sure it is enabled:

  1. open the configuration window (use this trick from #163 if it still crashes);
  2. select "Misc" tab;
  3. enable debug messages "to standard output" for the traditional console output. Or "to file" to redirect all messages to [your_home]/Library/Application Support/Giada/giada.log file.
ssteinerx commented 6 years ago

Can't open config in the program, "log_mode" is 4 in config. I guess I'll go spelunking around to find what turns on stdout/file.

ssteinerx commented 6 years ago

Setting log_mode to LOG_MODE_FILE put the log in ~/Library/Application\ Support/Giada/giada.log which I had to find by reading the source code. The file name should be logged to the console to make it easier to find.

I set it to LOG_MODE_STDOUT and got this as soon as I hit 'configure' in the UI: ➜ giada [init] Giada 0.14.5 - Sun Dec 24 12:23:31 2017 [storager::setBool] key 'midi_in' not found, using default value [storager::setUint32] key 'midi_in_filter' not found, using default value [init] configuration file ready [init] scanning midimaps directory... [init] unable to scan midimaps directory! [read] midimap not specified, nothing to do [init_prepareMidiMap] MIDI map read failed! [KA] using system 0x10 [KA] No API available, nothing to do! [Mixer::allocVirtualInput] vChanInput ready, 176400 frames [KM] using system 0x1 [KM] 0 output MIDI ports found [KM] 0 input MIDI ports found [geKeyboard::cb_addColumn] new column added (index=0, w=380), total count=1, addColumn(x)=404 [geKeyboard::__cb_addColumn] new column added (index=1, w=380), total count=2, addColumn(x)=800 [geKeyboard::cb_addColumn] new column added (index=2, w=380), total count=3, addColumn(x)=1196 [geKeyboard::cb_addColumn] new column added (index=3, w=380), total count=4, addColumn(x)=1592 [geKeyboard::__cb_addColumn] new column added (index=4, w=380), total count=5, addColumn(x)=1988 [geKeyboard::cb_addColumn] new column added (index=5, w=380), total count=6, addColumn(x)=2384 [1] 71069 segmentation fault giada

monocasual commented 6 years ago

[KA] No API available, nothing to do!

This is the interesting line. Basically there are no APIs available in your system: it happened because, during the compilation phase (on your machine, I mean), RtAudio didn't find any useful API. This is kind of unusual.

Now, RtAudio is a third party dependency and we have little control over it. I suggest you to try with the original code and see if you can compile and run one of their examples. If everything is OK there must be something wrong in our configure/make process.

Anyway on Giada side, I think we should better handle that missing API (even if it's a corner case), in order to fix #163 as well.

ssteinerx commented 6 years ago

@monocasual What is the next step? I'm not sure, is this a build-time problem or a run-time problem? Is there a way I can build a "universal version" like the one shipped as a pre-compiled product to see if that works?

monocasual commented 6 years ago

@ssteinerx it's a build-time problem. I suggest you to build the original RtAudio and see if you can compile it. If you can, there's something wrong in Giada and how it handles the OS X configuration. Let me know how it goes.

monocasual commented 5 years ago

No feedback on this since Jan 2018, closing.

maximilianotaverna commented 5 years ago

I have the same problem brand new macbook air running mojave 10.14.4. downloaded giada and even tried changing sound card config from the file menu and quiting but when restarting the app the config was not saved?

maximilianotaverna commented 5 years ago

do I need to open a new issue for this same bug?

monocasual commented 5 years ago

@maximilianotaverna thanks for reporting. I'm going to re-open this one.

joshgubler commented 5 years ago

I'm also seeing this on macOS Mojave 10.14.6, MacBook Pro (15-inch, 2019). Running fresh download from https://giadamusic.com/data/giada-0.15.4-osx-amd64.zip.

$ /Applications/giada.app/Contents/MacOS/giada_osx
[init] Giada 0.15.4 - Mon Sep 30 13:35:35 2019
[init] scanning midimaps directory...
[init] unable to scan midimaps directory!
[read] midimap not specified, nothing to do
[init] MIDI map read failed!
[KA] using system 0x10
[KA] Opening devices 1 (out), 0 (in), f=44100...
[KA] 4 device(s) found
  0) Apple Inc.: MacBook Pro Microphone
  1) Apple Inc.: MacBook Pro Speakers
  2) ma++ ingalls for Cycling '74: Soundflower (2ch)
  3) ma++ ingalls for Cycling '74: Soundflower (64ch)
[KA] rtSystem init error: RtApiCore::probeDeviceOpen: the device (0) does not support the requested channel count.
[Mixer::init] buffers ready - framesInSeq=88200, framesInBuffer=1024
[KM] using system 0x1
[KM] 0 output MIDI ports found
[KM] 0 input MIDI ports found
[geKeyboard::__cb_addColumn] new column added (index=0, w=380), total count=1, addColumn(x)=404
[geKeyboard::__cb_addColumn] new column added (index=1, w=380), total count=2, addColumn(x)=800
[geKeyboard::__cb_addColumn] new column added (index=2, w=380), total count=3, addColumn(x)=1196
[geKeyboard::__cb_addColumn] new column added (index=3, w=380), total count=4, addColumn(x)=1592
[geKeyboard::__cb_addColumn] new column added (index=4, w=380), total count=5, addColumn(x)=1988
[geKeyboard::__cb_addColumn] new column added (index=5, w=380), total count=6, addColumn(x)=2384
...I closed the app here...
[init] All subwindows and UI thread closed
[init] configuration saved
[init] PluginHost cleaned up
[init] Giada 0.15.4 closed

If I switch my input device to 2 or 3, I don't get the error. So there's something with the macbook's microphone device that isn't liking "channels_in": 0 in my config (I think).

worrel commented 4 years ago

I'm having the same issue with 0.16.2, including the same error message as @joshgubler (rtSystem init error: RtApiCore::probeDeviceOpen: the device ... does not support the requested channel count). In my case I'm trying to use a CEntrance Axeport Pro to connect a guitar.

Clicking on the device information button in Giada shows that the CEntrance only supports a single input channel, however the source code seems to indicate an assumption of 2 input channels always: e.g. https://github.com/monocasual/giada/blob/master/src/core/kernelAudio.cpp#L155. Could this be a problem? ~In the case of the default microphone, I do see that the device info shows 2 input channels however, so perhaps this is not actually an issue.~ Default mic appears to work fine as long as there are no single channel input devices present. I've tried 3 different guitar interfaces (Apogee Jam, Rocksmith Guitar cable & the CEntrance), they all only support a single input channel, and they all cause the same failure.

I should also add that there appears to be an issue with any config changes saving on the Mac. Even w/o problematic sound interfaces, changing setting (including whether to log debug messages) doesn't persist in giada.conf. Manually editing the conf file prior to starting Giada was the only way I could get debug logging to work, for instance.

monocasual commented 4 years ago

This problem is related to #119 and will be fixed soon. Thanks for your patience!

wi-tscher commented 4 years ago

I'm having this problem, only on Windows 10.

In the configuration panel --> Sound System --> Input device, when selecting channels 1/2 with soundcard which only has a mono channel, the setting is not saved. May be fixed by #119 (I'm using a soundcard which takes in a mono signal from a guitar).

Should I maybe open another Issue ([win10] ...)?

monocasual commented 4 years ago

@wi-tscher no worries, we already have tracked down the main issue which will be fixed in 0.16.4. Thanks for reporting :)

monocasual commented 4 years ago

(Hopefully) fixed in 75f716c0e8a64892d84d7f8de312d13d29a9ee47. Suggestions and feedback are welcome.