Menu

#702 Switching to front camera when using Bluetooth remote

1.0
open
nobody
None
2020-04-29
2020-04-27
Paul Vint
No

I'm using a bluetooth remote button (this one: https://www.amazon.ca/Bluetooth-Smartphones-UBeesize-Wireless-Compatible/dp/B07FCZ8KQT), and periodically I take a bunch of pictures only to find that it had switched to the front-facing camera.

I was able to dupicate this once by turning the BT remote off and on again, then when I hit the button it switched cameras. (Cannot duplicate it reliably as yet, however).

I can sniff out what the remote is doing, and also dig into the OpenCamera code to try to sort it out, however that's going to take some time and I thought I'd post here first in case anyone has any quick thoughts.

Thanks!

Discussion

  • Paul Vint

    Paul Vint - 2020-04-28

    Just a bit more info: I set up an ESP32 device to behave like a bluetooth HID keyboard and it is behaving the same way: When the device is disconnected and reconnected (ie: by power cycling it), sometimes the camera switches from rear to front (or the converse). Also note that it seems to re-focus the camera.

    Having a bit of trouble getting ADB to work, but I'll try to get some info from the application side.

     
  • Paul Vint

    Paul Vint - 2020-04-29

    I've managed to get a bit more info, and I don't think that there's anything to be done from the config and/or code in OpenCamera - looks like it's a result of how Android handles things when the BLE keyboard is connected (also when disconnected). I had noticed that the screen seems to flash and redraw when it is connected, and the same thing happens when running any other app.

    For reference, here's what I see in adb logcat after the keyboard is connected:

    04-29 18:03:05.562  1503  1503 I InputMethodManagerService: resetBTKeyboardState : keyboardState = 0
    04-29 18:03:05.562  1503  1503 I InputMethodManagerService: [prevState : STATE_CONNECTED] mBTKeyboardCount[-] -->0keyboardState(0)
    04-29 18:03:05.567 31753 31753 I [-5]oneconnect[1.7.45-28_06][RECEIVER]: FeatureUtil.isQcSupportedMode - user: 0
    04-29 18:03:05.568 31753 31753 W [-5]oneconnect[1.7.45-28_06][RECEIVER]: QcReceiverService.handleIntent - owner mode: android.bluetooth.input.profile.action.CONNECTION_STATE_CHANGED
    04-29 18:03:05.569  1503  2623 E SensorService: BigData:Pakage) 1 already disabled.
    04-29 18:03:05.569  1503  2623 D SensorService: Calling activate off 1
    04-29 18:03:05.569   666  1985 I qti_sensors_hal: batch:sensor(android.sensor.accelerometer) handle:0 flags:0x0 period_ns 20000000
    04-29 18:03:05.569   666  1985 I qti_sensors_hal: batch: current sample rate, report rate & buffering are equal to requested (50.000000,15.151515,1)
    04-29 18:03:05.572 31128 31128 D SensorManager: unregisterListener ::
    04-29 18:03:05.572 31128 31128 D ViewRootImpl@da8983b[MainActivity]: setWindowStopped(true) old=false
    04-29 18:03:05.572 31753 31753 V [-5]oneconnect[1.7.45-28_06][RECEIVER]: QcReceiverService.handleBluetoothDeviceStateChanged - SERVICE IS ALREADY RUNNING, action:android.bluetooth.input.profile.action.CONNECTION_STATE_CHANGED
    04-29 18:03:05.572   980  4522 I ShotCommon: disablePreviewMsgBy : msg(In:0x2, Out:0x0)
    04-29 18:03:05.573 31128 31128 D SurfaceView: windowStopped(true) false net.sourceforge.opencamera.preview.camerasurface.MySurfaceView{4ec04b1 V.ED..... ........ 0,0-1920,1440} of ViewRootImpl@da8983b[MainActivity]
    04-29 18:03:05.573 31753 31753 D [-5]oneconnect[1.7.45-28_06][RECEIVER]: QcReceiverService.startService - Reason: 5
    04-29 18:03:05.573   980  4522 I ShotCommon: disableMsgType : msg(In:0x510, Out:0x80d)
    04-29 18:03:05.573 31128 31128 D SurfaceView: show() Surface(name=SurfaceView - net.sourceforge.opencamera/net.sourceforge.opencamera.MainActivity@4ec04b1@0[31128])/@0x57eea1e net.sourceforge.opencamera.preview.camerasurface.MySurfaceView{4ec04b1 V.ED..... ........ 0,0-1920,1440}
    
     

Anonymous
Anonymous

Add attachments
Cancel





MongoDB Logo MongoDB