mistweaverco / bananas

Bananas🍌, Cross-Platform screen πŸ–₯️ sharing πŸ“‘ made simple ⚑.
https://getbananas.net
MIT License
2.17k stars 43 forks source link

Bug: Keeps asking for microphone permission (macOS) #6

Closed sgrgrsn closed 1 day ago

sgrgrsn commented 4 days ago

When I try to host (or join) a new session, the app keeps asking me for microphone permission +10 times (even though I say "Allow").

macOS 14.6.1 (23G93) Bananas: 0.0.9

Here's a video showing it. https://github.com/user-attachments/assets/5effa941-372a-448a-860d-6e1763f6aa13

gorillamoe commented 4 days ago

My best friend already confirmed this "bug". I'm not really seasoned in MacOS and don't have a mac with me atm.

Can you try to run Bananas from the CLI with sudo, so we can make sure it's not some weird permissions thing in MacOS?

sgrgrsn commented 4 days ago

Can you try to run Bananas from the CLI with sudo, so we can make sure it's not some weird permissions thing in MacOS?

I have just tried. It's the same outcome.

gorillamoe commented 4 days ago

Can you try the v0.0.10 release?

eauw commented 4 days ago

Can you try the v0.0.10 release?

Same issue for me on v0.0.10.

gorillamoe commented 4 days ago

Strange. #5 mentions that it works on MacOS 15, so either it's really related to MacOS 14 or some other Settings Voodoo in MacOS :thinking:

gorillamoe commented 4 days ago

Probably an issue due to the app being unsigned:

See also: https://github.com/jitsi/jitsi-meet-electron/issues/611

This might be a temporary fix: codesign --force --deep --sign - /Applications/Bananas.app until I implement signing in the CI.

dheeth commented 3 days ago

@gorillamoe I just run the command you shared above, Now it keeps popping up for Screen Recording permission again and again which is already allowed

dheeth commented 3 days ago

Tried executing using sudo, error is pasted below:

sudo "/Applications/bananas.app/Contents/MacOS/bananas"
[52104:1129/120433.728953:ERROR:vt_video_encode_accelerator_mac.mm(965)] Call NotifyErrorStatus(): code=7, message=VTCompressionSessionCreate failed: Error Domain=NSOSStatusErrorDomain Code=-12902 "(null)"
(node:52101) UnhandledPromiseRejectionWarning: Failed to get sources.
(Use `bananas --trace-warnings ...` to show where the warning was created)
(node:52101) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:52101) PromiseRejectionHandledWarning: Promise rejection was handled asynchronously (rejection id: 1)
(node:52101) UnhandledPromiseRejectionWarning: Failed to get sources.
(node:52101) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
vihu commented 3 days ago

More verbose trace from my MBP (M3 max, 15.1.1 (24B91)):

sudo "/Applications/bananas.app/Contents/MacOS/bananas" --trace-warnings
[55401:1129/124126.685381:ERROR:vt_video_encode_accelerator_mac.mm(965)] Call NotifyErrorStatus(): code=7, message=VTCompressionSessionCreate failed: Error Domain=NSOSStatusErrorDomain Code=-12908 "(null)"
2024-11-29 12:41:26.909 bananas Helper (Plugin)[55405:1453056] WARNING: AVCaptureDeviceTypeExternal is deprecated for Continuity Cameras. Please use AVCaptureDeviceTypeContinuityCamera and add NSCameraUseContinuityCameraDeviceType to your Info.plist.
(node:55400) UnhandledPromiseRejectionWarning: Failed to get sources.
    at emitUnhandledRejectionWarning (node:internal/process/promises:300:15)
    at warnWithErrorCodeUnhandledRejectionsMode (node:internal/process/promises:406:5)
    at processPromiseRejections (node:internal/process/promises:470:17)
    at process.processTicksAndRejections (node:internal/process/task_queues:96:32)
    at node:electron/js2c/browser_init:2:19031
    at new Promise (<anonymous>)
    at Object.getSources (node:electron/js2c/browser_init:2:18708)
    at Function.<anonymous> (/Applications/bananas.app/Contents/Resources/app.asar/out/main/index.js:197:30)
(node:55400) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:55400) PromiseRejectionHandledWarning: Promise rejection was handled asynchronously (rejection id: 1)
    at handledRejection (node:internal/process/promises:280:23)
    at promiseRejectHandler (node:internal/process/promises:190:7)
(node:55400) UnhandledPromiseRejectionWarning: Failed to get sources.
    at emitUnhandledRejectionWarning (node:internal/process/promises:300:15)
    at warnWithErrorCodeUnhandledRejectionsMode (node:internal/process/promises:406:5)
    at processPromiseRejections (node:internal/process/promises:470:17)
    at process.processTicksAndRejections (node:internal/process/task_queues:96:32)
(node:55400) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)

I am not a mac developer but looks like entitlements.mac.plist needs more perms? Maybe these?

    <key>com.apple.security.screen-capture</key>
    <true/>
    <key>com.apple.security.temporary-exception.screen-capture</key>
    <true/>
    <key>NSCameraUseContinuityCameraDeviceType</key>
    <true/>
    <key>com.apple.security.cs.disable-library-validation</key>
    <true/>
gorillamoe commented 3 days ago

Have you also tried this?

https://github.com/mistweaverco/bananas/discussions/11#discussioncomment-11410375

Seems to work for some users.

It's really cumbersome and irritating, but seems to be related to the app not being signed and notarized.

I'll try to set up the CI so that it gets signed and notarized, but in the meantime you can try the above method?

gorillamoe commented 3 days ago

I tried to Google that and it seems that Bananas tries to read from a Continuity Camera, which might be a connected iPhone.

You're right, Bananas' plist does not have the requirements to read from your iPhone and it shouldn't.

I need to figure out if this is really the case and if so, how to exclude this kind of devices.

vihu commented 3 days ago

Have you also tried this?

#11 (comment)

Seems to work for some users.

It's really cumbersome and irritating, but seems to be related to the app not being signed and notarized.

I'll try to set up the CI so that it gets signed and notarized, but in the meantime you can try the above method?

I did, yes, the app does open up okay but continues to ask for perms (despite enabling those in settings > privacy & security). I don't think the continuity camera perms (or any camera perms) should be necessary (unless you want to support video chats?). Arguably the only perms required should be limited to:

gorillamoe commented 3 days ago

I don't think the continuity camera perms (or any camera perms) should be necessary (unless you want to support video chats?)

That's definitely planned, but optional, therefore I added this in advance πŸ™ˆ did not think it would cause this much trouble 😞

vihu commented 3 days ago

I don't think the continuity camera perms (or any camera perms) should be necessary (unless you want to support video chats?)

That's definitely planned, but optional, therefore I added this in advance πŸ™ˆ did not think it would cause this much trouble 😞

It's all good, we are all devs here and understand deployment pains :)

Just my $0.02, don't even bother with video support until like semver 2.0.0 lol. Make the core functionality rock solid for v1.0.0 (when you get there) and then think about video (or other fancy features).

gorillamoe commented 3 days ago

Just my $0.02, don't even bother with video support until like semver 2.0.0 lol. Make the core functionality rock solid for v1.0.0 (when you get there) and then think about video (or other fancy features).

New version v0.0.11 rolling, removed the camera permissions on macos. Hopefully this fixes the issue.

Snouzy commented 3 days ago

Hello @gorillamoe just tried 10min ago, the app keeps asking me for microphone permission exactly 10 times (and not working at the end) on a macbook pro 2021 on Sonoma 14.4.1 (23E224)

gorillamoe commented 2 days ago

I've successfully set up the CI so that new release will get signed a notarized by Apple.

Only Problem seems to be, that notarizing the application takes a really long time at the moment. I read about people having similar problems with that process taking up to 3 days...

So I'll try a new release tomorrow during the day.

This process might fix the issue with some people having these issues with continuous permission requests, even if already allowed. At least that is what also happened to the Jitsi project and they also seem to have fixed it by signing and notarizing their app.

Snouzy commented 2 days ago

Good luck πŸ€

bobbymannino commented 1 day ago

this has been fixed in v0.0.12

gorillamoe commented 1 day ago

this has been fixed in v0.0.12

Yes, should be, I've added a webhook for validating once Apple has approved the notarizing process, but not yet live, have to make anohter release so we can see if Apple really approves the app.

gorillamoe commented 1 day ago

Tester already confirmed it working now.