wtsnz / obs-ios-camera-source

Use your iPhone camera as a video source in OBS Studio and stream high quality video from your iPhone's camera over USB
https://obs.camera/
GNU General Public License v2.0
344 stars 60 forks source link

OBS cannot start when a iOS device is connected to mac #59

Closed wookayin closed 2 years ago

wookayin commented 3 years ago

When there is a iOS camera source added to the scene and a iOS device is connected to mac via a lightning-USB cable, OBS cannot start. The UI window does not show up.

The device that is connected to mac could be a different iOS device referred by the iOS camera source, or the same device but not OBS camera app running.

Logs from stdout:

info: ==== Startup complete ===============================================
info: All scene data cleared
info: ------------------------------------------------
info: coreaudio: device '...' initialized
info: [Loaded global audio device]: 'Mic/Aux'
info: [obs-ios-camera-plugin] Creating instance of plugin!
usbmuxd_listen: pollling
usbmuxd_listen_poll:
usbmuxd_listen: done polling
info: [obs-ios-camera-plugin] Loaded Settings: Connecting to device
info: [obs-ios-camera-plugin] Connecting to device
usbmuxd_connect: Reading connect result...
info: [obs-ios-camera-plugin] Updated device list
info: [obs-ios-camera-plugin] Connecting to device
usbmuxd_connect: Reading connect result...
usbmuxd_connect: Connect failed, Error code=3
usbmuxd_connect: Reading connect result...
usbmuxd_connect: Connect failed, Error code=3
...

and thousands of lines about reconnection will flood.

Now we plug off the cable. Then with the following log

info: [obs-ios-camera-plugin] Updated device list
warning: iPad: Device with unique ID '(some UUID)' disconnected

the application window starts.

It happens on OBS 26.0.2, 26.1 with all type of iOS devices.

wookayin commented 3 years ago

Relevant code lines: https://github.com/wtsnz/obs-ios-camera-source/blob/9238d58/deps/portal/src/Device.cpp#L82

I have no idea what value is assigned to connectTimeoutMs, but this seems to be not working. The log message (connect failed) happens only once inside usbmuxd_connect(...).

wtsnz commented 3 years ago

Hey @wookayin

Thanks for the issue. I noticed this issue yesterday while in the project. I've got an idea why this is happening, and a fix in the works.

Are you using Windows? I ask because in my testing, this issue appears to only effect the Windows version of the plugin. (Just read the title, will investigate - the fix I have in mind will fix this however)

wookayin commented 3 years ago

Hi, do you have any updates on this?

wtsnz commented 3 years ago

Hey,

Yes, I've fixed it in #60, but I have a couple more things to do on the branch before releasing it. I'm just taking a few days off over Christmas, however it's the first thing I plan to do when I'm back at my desk :)

Best, Will

On Sat, 26 Dec 2020 at 09:54, Jongwook Choi notifications@github.com wrote:

Hi, do you have any updates on this?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/wtsnz/obs-ios-camera-source/issues/59#issuecomment-751379934, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFCSPCRTFKG554BERZ66ODSWYPPFANCNFSM4VAOJPLA .

-- Will Townsend

will.townsend.io @wtsnz https://twitter.com/wtsnz

wookayin commented 3 years ago

Thank you Will. I was just impatient for the fix, so I tried building #60 and it seems working fine. At least the UI does not freeze!

~One feedback: However, on the console (stdout) log the following log lines are still flooding while iOS camera app is not running.~

usbmuxd_connect: Reading connect result...       
usbmuxd_connect: Connect failed, Error code=3    
usbmuxd_connect: Reading connect result...       
usbmuxd_connect: Connect failed, Error code=3    

UPDATE: NVM, had some glitches. After a clean build these log messages are gone.

wtsnz commented 3 years ago

Sweet!

Yes this is on my list of things to tidy up when I get back to it :)

Best, Will

On Sat, 26 Dec 2020 at 12:05, Jongwook Choi notifications@github.com wrote:

Thank you Will. I was just impatient for the fix, so I tried building #60 https://github.com/wtsnz/obs-ios-camera-source/pull/60 and it seems working fine. At least the UI does not freeze!

One feedback: However, on the console (stdout) log the following log lines are still flooding while iOS camera app is not running.

usbmuxd_connect: Reading connect result... usbmuxd_connect: Connect failed, Error code=3 usbmuxd_connect: Reading connect result... usbmuxd_connect: Connect failed, Error code=3

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/wtsnz/obs-ios-camera-source/issues/59#issuecomment-751391243, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFCSPAR6NN3CSL5NUZFP4DSWY6YBANCNFSM4VAOJPLA .

-- Will Townsend

will.townsend.io @wtsnz https://twitter.com/wtsnz