UltraStar-Deluxe / USDX

The free and open source karaoke singing game UltraStar Deluxe, inspired by Sony SingStar™
https://usdx.eu
GNU General Public License v2.0
847 stars 161 forks source link

No Microphone Settings on Mac OS X Mojave (10.14) #389

Closed pawel1892 closed 5 years ago

pawel1892 commented 5 years ago

After the update from Mac OS X 10.13 to 10.14 it is not possible make microphone settings. The screen under options -> record remains empty: bildschirmfoto 2018-10-25 um 18 48 35

As expected it is not possible to sing, because no microphones are aonfigurated fpr player 1.

s09bQ5 commented 5 years ago

Version 1.1 is ancient. Please try the latest release. If possible, rebuild the current git version from source.

pawel1892 commented 5 years ago

Hi and thanks for the quick answer. I tried the Version 1.3 (Beta 5) from usdx.eu and there is still the exact same problem. No micropone settings, only the back button.

So I made my own build from from the current source code. Unfortunatelly the screen remains black after I start the app. But I can hear the backgroundmusic sound.

To build my own build I followed this instructions: https://github.com/UltraStar-Deluxe/USDX#compiling-on-linuxbsd-using-make I only changed the configure line to: PKG_CONFIG_PATH=/usr/local/Cellar/ffmpeg@2.8/2.8.15_1/lib/pkgconfig ./configure.

Any ideas?

basisbit commented 5 years ago

please provide the debug.log and also check if the themes folder was created correctly.

ghost commented 5 years ago

Issue remains the same for me. I just downloaded the code on Mac 10.14 (Mojave). Applications remains black, but it is simple to fix. If you have multiple screens you move the window from one screen to another and voilà! Content appears.

No microphones are detected.

Log file: ERROR: Device "Built-in Microphone" does not work [TAudioInput_Portaudio.EnumDevices] ERROR: Device "USBMIC Serial# 082120042 " does not work [TAudioInput_Portaudio.EnumDevices]

(USBMIC is the PS Singstar microphones which works perfectly on previous versions). Error.log

s09bQ5 commented 5 years ago

I have just pushed a commit to the master branch that logs more details when an audio device "does not work".

As for the black screen, that should be fixed with the next SDL release: https://bugzilla.libsdl.org/show_bug.cgi?id=4272

basisbit commented 5 years ago

Just as a reminder: Apple deprecated OpenGL support on Mac OS, thus it slowly "falls apart". Eventually we will have to drop Mac OS support, unless we find a OpenGL->Metal wrapper or similar workaround. Same statement is valid for Vocaluxe and Performous.

Because of so many people relying on OpenGL, I kind of expect that there are already people working on an OpenGL wrapper for Mac OS, or at least I hope so :smile:

ghost commented 5 years ago

Ok, I was not able to get additional information. I checked the log file... no additional info. However, it looks like something related to my audio drivers - yep, unexpected but it looks possible know on a MBP.

I found that probably there is some issues with Zoom Audio Device - that is a kind of virtual device for Zoom meetings. I tried and failed to remove it, so now, my plan is to install Mojave from Scratch.

HOWEVER. I tried the USDX build with my headset (the one I use for the calls) and it worked FLAWLESSLY!

Keep you posted, reset my MBP will take a few days.

s09bQ5 commented 5 years ago

Are you sure there is no additional output right before each "Device ... does not work" line? AFAICS TAudioInput_Portaudio.EnumDevices will log these lines only if TAudioCore_Portaudio.TestDevice fails. And I have added a log message to every code path in TAudioCore_Portaudio.TestDevice that leads to a failure. Does git show list the log messages that I added two days ago?

ghost commented 5 years ago

I double checked, no additional info. But as I explained before, it also ran and allow me to select the USB Mics (Singstar) but didn't register any voice or sound (mics did not moved the bars). However, I will try again removing the ZoomAudioDevice.

I noticed that when Skype or any other "mic/cam" app is open, error will be thrown.

Give me a couple days.

ghost commented 5 years ago

Ok. Didn't work - fresh new Mojave (fixed a lot of performance problems) but didn't work. No additional log information. Find file attached. Error.log

s09bQ5 commented 5 years ago

There are additional log messages in line 133 and 135. If you install Audacity, are you able to record from the microphone from there?

PieterHartzer commented 5 years ago

For what it's worth, I had the same problem. I removed USDX, tested my mics worked in Preferences, then reinstalled the app. It then allowed me to select the mic. I did uncheck and recheck the mic permissions in preferences for USDX too. I cannot say which of these resolved the issue for me.

I am running Mojave 10.14.1 too.

bohning commented 5 years ago

Maybe somewhat related: I have the problem that I do see the microphone settings and can select e.g. the built-in microphone, but it doesn't register any sounds from the microphone (both in USDX settings - screenshot 1 - as well as in the sing screen - screenshot 2), but obviously the built-in mic is working (e.g. verified in the system settings - screenshot 3).

bildschirmfoto 2018-12-25 um 22 53 03 bildschirmfoto 2018-12-25 um 22 53 50 bildschirmfoto 2018-12-25 um 22 57 43

Presumably relevant parts of the error.log are: STATUS: Opened audio device [TAudioPlayback_SDL.InitializeAudioPlaybackEngine] STATUS: InputDevice "Built-in Microphone"@2x44100Hz (0.1sec) [Portaudio.EnumDevices] STATUS: #Input-Devices: 1 [Portaudio] ... STATUS: Main Loop [Initialization] STATUS: Open Built-in Microphone [Portaudio] STATUS: Latency of Built-in Microphone: 0.0131065759637188 [Portaudio]

As a positive side note, I don't seem to have #419 anymore. However, not having working mics is a show-stopper 👎

ePirat commented 5 years ago

The issue is that in 10.14 apps need permission to access the microphone. USDX does not ask for such permission properly (or well, the abstraction USDX uses to access these devices) and gets no devices back.

UPDATE: Just checked again and for me USDX at least asked once. So maybe check in System Preferences > Security

micsec
bohning commented 5 years ago

@ePirat: I just checked and there is a check mark for UltraStarDeluxe in System > Preferences > Security > Datenschutz > Microphone. I do see the microphones in USDX settings, however, I do not get any input from them (while they do work in system settings).

ePirat commented 5 years ago

@bohning That's weird. If this is a security related thing you should not see the devices at all. Eventually whatever USDX uses still relies on old QTSound stuff, I'll check.

ePirat commented 5 years ago

Ok so portaudio uses CoreAudio APIs which as far as I know were not changed for 10.14 so should all still work completely fine.

bohning commented 5 years ago

Hmm, so is there anything I can test? I can verify that the mic (internal or USB) is working in the system settings, and I can verify that it does not work in USDX, neither in the Record section (no feedback) nor in the sing screen (flat oscilloscope).

mithrendal commented 5 years ago

On opening usdx it asked me for microphone access. I enabled it. but still no mics available in usdx version 1.1 on 10.14. thats pretty sad. Have to make a partition for sierra for the sole reason of running usdx I guess...

ePirat commented 5 years ago

On first launch (when it shows the permission dialog) it would not list the microphones, after restarting though it lists them as expected and I get input from them.

ePirat commented 5 years ago

@bohning Please check the configured sample rate in the Audio- & MIDI Settings.

bohning commented 5 years ago

@ePirat Oh, took me a while to find the settings in Applications > Utilities > Audio-MIDI-Setup (I believe this is what you mean?). These are my current settings, never touched them, has worked for years - so I wonder: are the settings wrong? If so, what do I need to change? And what could have changed them?

bildschirmfoto 2019-01-03 um 22 58 09
ePirat commented 5 years ago

Those look alright. In the meantime I managed to sometimes reproduce the problem… It just randomly works sometimes but not other times. I will investigate.

bohning commented 5 years ago

Strange that it works for you sometimes and sometimes not. For me, the problem is relatively new, but it consistently does not work anymore. USDX finds the microphones (both internal and USB), so it does not seem to be a permission problem, but they stay silent (both in USDX settings as well as in the sing screen -> flat oscilloscope). Thanks for your further investigation - highly appreciated!

PieterHartzer commented 5 years ago

I am not sure whether this will help, but I also tried to recreate it.

The above seems pretty consistent although I have only tried it a few times.

If I can do any more to recreate/debug, please let me know.

bohning commented 5 years ago

I am also not sure if this helps, but I have also played around a little.

  1. I deleted UltraStarDeluxe.app from my program folder, built it anew from source and moved it again to the program folder (I did not delete the corresponding folder in Application Support, if that is somehow important).
  2. I then started the newly built USDX only to find the complaint that no microphone is set for player one, bringing me to an empty (!) USDX record settings screen (I was not asked to give USDX permission to use the microphone on first startup).
  3. Since I learned that the record settings screen is empty if there is a permission problem, I went to the system security settings only to find that USDX does indeed already have the check mark to allow it to use the microphone (obviously, this permission does not get deleted from system settings even after I deleted the USDX app). Then I unchecked it (locked the settings again) and out of curiosity started USDX only to find that it now finds and shows the internal microphone in the record settings (even though permission to use the microphone was still unchecked).
  4. Then I closed USDX, gave USDX back the permission to use the microphone and restarted USDX, which again offers me the internal microphone (so checking/unchecking had an effect once that USDX went from empty screen to showing the internal microphone, but that might just be coincidence, and after that does not seem to have an effect on the availability of the attached microphones in USDX record settings).
  5. The issue remains unchanged, I can then select the internal microphone for player 1 and 2 but do not get any input from it (in the game).

I have a vague/odd feeling that only the instance of UltraStarDeluxe.app gets to retrieve the microphone signal that asks the user for microphone permission on first startup. Other/later instances of UltraStarDeluxe.app (copies or replacements) do pick up the permission to be able to list the microphone devices, but are somehow unable to get their actual input (I don't even know if that makes some sense).

Maybe this helps somehow in finding the issue here. Let me know if I can do anything to help.

mithrendal commented 5 years ago

I created an additional volume and installed high sierra on it. Now usdx 1.1 works again and probably will work there forever. BTW: Is the latest usdx release a 64 Bit version ? I mean if not then the next major macOS release will break all 32 Bit apps anyway right ?

ePirat commented 5 years ago

Yes it is.

ePirat commented 5 years ago

Thanks buggy Github UI…

jesperalmstrom commented 5 years ago

Just adding that I have the same experience with internal and SingStar mics. Sometimes it works when starting USDX but mostly it doesn't. Have not been able to see any consistent behaviour. 🙁

CRP commented 5 years ago

I just compiled version 1.3 from github. My experience is that if I start the app from the Finder, then I am not asked authorization to use the microphone, and it does not work. If instead I start the app from Terminal then the os ask for authorization to let terminal use the mic, and it works correctly.

bohning commented 5 years ago

I just compiled version 1.3 from github. My experience is that if I start the app from the Finder, then I am not asked authorization to use the microphone, and it does not work. If instead I start the app from Terminal then the os ask for authorization to let terminal use the mic, and it works correctly.

Hmm, unfortunately I cannot confirm this. Do you start USDX by open UltraStardeluxe.app/? This brings up the mic access authorization dialog for you?

jesperalmstrom commented 5 years ago

Recompiled latest code from GitHub and opened from console as @bohing mentioned. Did not work.

CRP commented 5 years ago

No, opening via "open /Applications/UltraStarDeluxe.app" will not trigger the authorisation request, while opening it via " /Applications/UltraStarDeluxe.app/Contents/MacOS/ultrastardx" does, and that is the only way for me to get the game working.

bohning commented 5 years ago

@CRP yes, indeed! Awesome, finally a workaround for this showstopper. Does anyone know of how to make usdx properly ask for mic access? @ePirat maybe? It would be great if this could be fixed, but at least I can finally play usdx on my Mac again!

jesperalmstrom commented 5 years ago

Without knowing much about MacOs development i found this while googling: https://forums.developer.apple.com/thread/109759 https://developer.apple.com/documentation/avfoundation/avcapturedevice/1624584-requestaccessformediatype

CRP commented 5 years ago

I can't try it right now, but apparently all that is necessary is adding a key called NSMicrophoneUsageDescription to Info.plist (which is in src/macosx), and then it should work.

CRP commented 5 years ago

I can now confirm this. I just added the following two lines to Info.plist:

<key>NSMicrophoneUsageDescription</key>
<string>1</string>

the second line is probably optional. After doing this, upon restarting I am asked to authorize mic access, but USDX won't show any microphones. Closing and restarting the application fixes things once and for all ;) So somebody just needs to amend the plist on github...

ePirat commented 5 years ago

Whoops indeed, never realized we miss the usage description…

ePirat commented 5 years ago

@bohning Please provide a actual meaningful usage description.

jesperalmstrom commented 5 years ago

Not sure what I am doing wrong, but I dont get any mic settings when entering Record.

  1. Did a git pull and rebuilt.
  2. Checked that the new plist entry was present in the app.
  3. Opened the app and got the question about allowing mic.
  4. Got message in USDX to enter Record to set the mic.
  5. Entered Record setting and it is still empty.

Log:

STATUS: Opened audio device [TAudioPlayback_SDL.InitializeAudioPlaybackEngine]
ERROR:  Error: Audio callback is not called [TAudioCore_Portaudio.TestDevice]
ERROR:  Device "Built-in Microphone" does not work [TAudioInput_Portaudio.EnumDevices]
STATUS: #Input-Devices: 0 [Portaudio]
bohning commented 5 years ago

Did you try to close and then restart?

jesperalmstrom commented 5 years ago

Yes. In desperate times I also try reboot....

dexwolfram commented 5 years ago

@jesperalmstrom @bohning I can confirm, still having the same problem as jesperalmstrom. You are not by chance using a mac (such as my mac mini) which has no built in mic? What's wierd, is that if I plug a headset into microphone port and go into settings (can only do when turning off mic access in OsX privacy as described at bottom), Ultrastar record preferences show the mic as "Built in mic" (which my computer does not have) whereas OSX preferences recognize it as "External microphone."

Anyway, I can confirm same behavior as you using Mac mini / MacOS Mojave 10.14.5:

  1. Did a git pull yesterday and built.
  2. Checked that the new plist entry was present in the app:

    \<key>NSMicrophoneUsageDescription\</key> \<string>Need microphone access for pitch analysis of the singer's voice.\</string>

  3. Opened the app and got the message "Error", "Player 1 is not assigned to a microphone. Please check your record options"
  4. Automatically went into Record settings and the record settings were empty. Log:

    STATUS: Opened audio device [TAudioPlayback_SDL.InitializeAudioPlaybackEngine] ERROR: Error: Audio callback is not called [TAudioCore_Portaudio.TestDevice] ERROR: Device "Built-in Microphone" does not work [TAudioInput_Portaudio.EnumDevices] STATUS: #Input-Devices: 0 [Portaudio]

    Note: Error states "Built-in Microphone" does not work, but my Mac mini HAS NO built in microphone. Could this be the issue? Could Ultrastar be assuming there is a built-in mic on startup, then throwing an error and choking when it does not find one?

I can also re-confirm that behavior reported above @ " bohning commented Jan 3, 2019" still occurs with rebuild from yesterday:

  1. If I go into MacOS System Preferences > Security & Privacy > Microphone
  2. Uncheck UltrastarDeluxe so it no longer has access to microphone (privacy, microphone off).
  3. Then open the Ultrastar Deluxe.
  4. App opens without error, can set microphone settings and select players per each channel.
  5. Previously mentioned errors in log are gone, now:

    STATUS: Opened audio device [TAudioPlayback_SDL.InitializeAudioPlaybackEngine] STATUS: InputDevice "Built-in Microphone"@2x44100Hz (0.1sec) [Portaudio.EnumDevices] STATUS: InputDevice "Steinberg UR22mkII "@2x44100Hz (0.1sec) [Portaudio.EnumDevices] STATUS: #Input-Devices: 2 [Portaudio]

  6. HOWEVER, I get no microphone input when I play the game in Ultrastar Deluxe.
  7. If I quit Ultrastar.
  8. Then go back to MacOS System Preferences > Security & Privacy > Microphone .
  9. Recheck UltrastarDeluxe so once again has access to microphone (privacy, microphone on).
  10. Restarting UltraStar, I'm back to getting "Error", "Player 1 is not assigned to a microphone. Please check your record options" and Ultrastar again automatically opens to Microphone settings, but the settings to not show as in the beginning of this post.

I'm wondering: are many of us using computers which have no built-in mic?

jesperalmstrom commented 5 years ago

@dexwolfram I use a Macbook Pro with mic. Still no success to get it to work. I have tried many options and the only way for me to get it to work is to start ~/dev/USDX/UltraStarDeluxe.app/Contents/MacOS/ultrastardx

CRP commented 5 years ago

FWIW, I am using a Mac Mini as well. My MIC is a pair of USB Sony Singstar mics. The only weirdness I registered is that after starting USDX the first time, when I am asked for permissions, then the application shows no microphones connected. If I restart the app (no other changes), then it works fine. So I think you can remove the mac mini from your diagnostic checklist ;)

dexwolfram commented 5 years ago

Thx everyone, I feel like I have narrowed down the problem. For my mac mini, it's also the MacOS preferences OUTPUT setting that makes the difference, not (or not only) the input setting -- even though the error messages seem only to relate to the mic settings.

I have a Mac mini, which has a built-in sound card, but I've also a USB-connected Steinberg UR22mkII sound interface hooked up to a mic (but not hooked up to a speaker).

(1) If I set MacOS preferences to use the Steinberg for BOTH input and output, Ultrastar works fine.

(2) If I set MacOS preferences to use the Steinberg for input, but the Mac Mini built-in speaker for output, I get the microphone error / non-working Record / microphone settings page. Odd behavior, particularly since the only change in settings between (1) and (2) relates to sound output, not input (and the output by the way works fine in UltraStar here).

(3) If I set MacOS preferences to use the Steinberg for input, but the Mac mini headset jack for output, I also get the microphone error / non-working Record / microphone settings page. Again, weird.

(4) If I set MacOS preferences to use the Mac mini headset jack for both input and output, I also get the microphone error / non-working Record / microphone settings page.

(5) If I set MacOS preferences to use the Mac mini headphone jack for input, but the Steinberg for output, well then the error does not appear. But strangely, I am not able to select the Mac mini headset jack as input in UltraStar Record / microphone settings. The only option for input in UltraStar is the Steinberg. Also weird.

It basically seems like to me, that if I use the mac mini sound card for output, I get the UltraStar microphone error. A bit counter-intuitive, since the errors thrown all relate to the microphone settings, not the output settings. Also, I have no output hooked up to my Steinberg, and when I get the UltraStar error, output from the internal mini sound card is actually working fine (I get the background music) so it never occurred to me to fiddle with the output settings.

My best presumption is that this will all work fine once I hook up the Steinberg to an external speaker system and use if for both output and input.

But still, it a appears that I get UltraStar microphone input errors whenever MacOS Preferences are set to use the mini internal sound card for output. Not sure if the MacOS preferences setting for input really matters, though it appears I would have trouble using the internal card for UltraStar input. Anyone else seeing anything like this?

dexwolfram commented 5 years ago

@jesperalmstrom Did you try fooling with output settings to a different output card as per my last post?

jesperalmstrom commented 5 years ago

@dexwolfram I dont have a different output card on my Macbook. @ePirat or @bohning Could you share a new MacOs build that I could try? Because I am not able to get this to work. At my current MacBook the build does not even get passed a black startup screen and then it just dies without any error in the log file.

dexwolfram commented 5 years ago

Hm. If you have another Apple device, maybe you could try output to the other device by Airplay, just for kicks.