Selfie stick not supported

Bug #1451724 reported by Michael Zanetti
34
This bug affects 7 people
Affects Status Importance Assigned to Milestone
Canonical System Image
In Progress
Medium
Bill Filler
camera-app (Ubuntu)
In Progress
Medium
Ugo Riboni

Bug Description

I had a chance to play with a selfie stick: http://bit.ly/1KIYkBc

Working fine on iOS it didn't do anything on Ubuntu. I had enough time to check out what what keycode it sends when pressing the shutter button: Qt.Key_MediaTogglePlayPause

So I guess all it takes is to add a Keys.onPressed handler to the camera app and trigger the photo shutter or start/stop recording when in video mode.

Tags: system-apps

Related branches

Changed in camera-app:
status: New → Confirmed
importance: Undecided → Medium
Bill Filler (bfiller)
Changed in camera-app (Ubuntu):
importance: Undecided → Medium
assignee: nobody → Ugo Riboni (uriboni)
status: New → Confirmed
Changed in canonical-devices-system-image:
milestone: none → ww02-2016
assignee: nobody → Bill Filler (bfiller)
importance: Undecided → Medium
status: New → Confirmed
no longer affects: camera-app
Ugo Riboni (uriboni)
Changed in camera-app (Ubuntu):
status: Confirmed → In Progress
Revision history for this message
Ugo Riboni (uriboni) wrote :

Michael Zanetti said he would test the attached branch with an actual selfie stick and report back next week.

Bill Filler (bfiller)
Changed in canonical-devices-system-image:
status: Confirmed → In Progress
Revision history for this message
Michael Zanetti (mzanetti) wrote :

Hey Ugo, Bill,

I have tested the linked branch. 2 issues:

* My BQ is running out of space and produces the "Low disk space" warning when the camera app starts up. That seems to steal focus which forces me to first swipe to the foto roll and back to the viewfinder in order to fix the focus things.

* Second, don't ask me why, but that exact same selfie stick I tried half a year ago, now seems to produce this keycode: 0x1008FF16 which isn't listed in the Qt namespace. However, it is listed in xkbcommon-keysyms.h and is mapped to XKB_KEY_XF86AudioPrev. To make things even weirder, I have to add that this is on krillin. Last time I tested it on flo. However, I retested it on flo right now and believe it or not, it's XKB_KEY_XF86AudioMedia (0x1008FF32) now. I've also tested that same stick on an iPhone, it will increase the sound volume when the camera app was not focused. So this means that the generated keycode depends on the hardware drivers, in our case the Android HAL. Different devices and versions of the Android image can change the produced keycode.

This makes me believe that we should just handle all common multimedia keys in the camera app to trigger the shutter. If we add those keys, I guess we should support most of the cases:

0x1008FF14 (XKB_KEY_XF86AudioPlay)
0x1008FF15 (XKB_KEY_XF86AudioStop)
0x1008FF16 (XKB_KEY_XF86AudioPrev)
0x1008FF17 (XKB_KEY_XF86AudioNext)
0x1008FF31 (XKB_KEY_XF86AudioPause)
0x1008FF32 (XKB_KEY_XF86AudioMedia)

Qt::Key_MediaPlay 0x01000080
Qt::Key_MediaStop 0x01000081
Qt::Key_MediaPrevious 0x01000082
Qt::Key_MediaNext 0x01000083
Qt::Key_MediaRecord 0x01000084
Qt::Key_MediaPause 0x1000085
Qt::Key_MediaTogglePlayPause 0x1000086

Revision history for this message
Ken VanDine (ken-vandine) wrote :

I tried #TheSelfie on my arale, it increases the volume. I didn't look to see what keycode is being generated, but what ever it is raises notify-osd showing the volume increase.

Revision history for this message
Ugo Riboni (uriboni) wrote : Re: [Bug 1451724] Re: Selfie stick not supported

We can try to handle the media keycodes, I will update the patch in that
sense. Thanks for the research Michael.

However the volume keys are going to be more complicated: the app receieves
them just fine, but they are the same keys that are generated by the
hardware volume buttons on the phone (Qt.Key_VolumeDown, Qt.Key_VolumeUp).

The system intercepts them regardless of what the app does with them (I
tried to mark them as handled in Qt), and raises/lowers the volume.
I think it will be very confusing to shoot a picture AND raise/lower the
volume.

I guess we will have to live with the fact that some selfie sticks +
hardware combinations which generate volume keypresses won't be supported,
though that's going to be rather confusing for the user too.

On Mon, Jan 4, 2016 at 4:33 PM, Ken VanDine <email address hidden>
wrote:

> I tried #TheSelfie on my arale, it increases the volume. I didn't look
> to see what keycode is being generated, but what ever it is raises
> notify-osd showing the volume increase.
>
> --
> You received this bug notification because you are a bug assignee.
> https://bugs.launchpad.net/bugs/1451724
>
> Title:
> Selfie stick not supported
>
> Status in Canonical System Image:
> In Progress
> Status in camera-app package in Ubuntu:
> In Progress
>
> Bug description:
> I had a chance to play with a selfie stick: http://bit.ly/1KIYkBc
>
> Working fine on iOS it didn't do anything on Ubuntu. I had enough
> time to check out what what keycode it sends when pressing the shutter
> button: Qt.Key_MediaTogglePlayPause
>
> So I guess all it takes is to add a Keys.onPressed handler to the
> camera app and trigger the photo shutter or start/stop recording when
> in video mode.
>
> To manage notifications about this bug go to:
>
> https://bugs.launchpad.net/canonical-devices-system-image/+bug/1451724/+subscriptions
>

Revision history for this message
Ugo Riboni (uriboni) wrote :

The patch has been updated to handle all keys listed my Michael, plus XKB_KEY_XF86AudioLowerVolume and XKB_KEY_XF86AudioRaiseVolume, which might be emitted by some sticks as Ken suggests, and are not used by our system.

More testing welcome.

Changed in canonical-devices-system-image:
milestone: ww02-2016 → ww08-2016
Revision history for this message
Alan Pope 🍺🐧🐱 🦄 (popey) wrote :

For what it's worth I have a selfie device which I picked up at SCaLE. It's not a stick but just a bluetooth button on a keyring.

Kinda like this thing:- http://shopping.rediff.com/product/bluetooth-remote-shutter-portable-selfie-clicker-for-iphone-ipad-android-sa/12547946

You'll note it has two buttons.

Using xev on my desktop I discovered that the "iOS" button presses Vol+. The "Android" button presses Enter.

Android button press:-

KeyPress event, serial 39, synthetic NO, window 0x4800001,
    root 0xc4, subw 0x0, time 695348996, (867,621), root:(916,673),
    state 0x0, keycode 36 (keysym 0xff0d, Return), same_screen YES,
" XLookupString gives 1 bytes: (0d) "
" XmbLookupString gives 1 bytes: (0d) "
    XFilterEvent returns: False

KeyRelease event, serial 39, synthetic NO, window 0x4800001,
    root 0xc4, subw 0x0, time 695349027, (867,621), root:(916,673),
    state 0x0, keycode 36 (keysym 0xff0d, Return), same_screen YES,
" XLookupString gives 1 bytes: (0d) "
    XFilterEvent returns: False

iOS button press:-

KeyPress event, serial 40, synthetic NO, window 0x4800001,
    root 0xc4, subw 0x0, time 695365945, (867,621), root:(916,673),
    state 0x0, keycode 36 (keysym 0xff0d, Return), same_screen YES,
" XLookupString gives 1 bytes: (0d) "
" XmbLookupString gives 1 bytes: (0d) "
    XFilterEvent returns: False

KeyRelease event, serial 40, synthetic NO, window 0x4800001,
    root 0xc4, subw 0x0, time 695366065, (867,621), root:(916,673),
    state 0x0, keycode 36 (keysym 0xff0d, Return), same_screen YES,
" XLookupString gives 1 bytes: (0d) "
    XFilterEvent returns: False

FocusOut event, serial 40, synthetic NO, window 0x4800001,
    mode NotifyGrab, detail NotifyAncestor

FocusIn event, serial 40, synthetic NO, window 0x4800001,
    mode NotifyUngrab, detail NotifyAncestor

KeymapNotify event, serial 40, synthetic NO, window 0x0,
    keys: 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 8
           0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

KeyRelease event, serial 40, synthetic NO, window 0x4800001,
    root 0xc4, subw 0x0, time 695367625, (867,621), root:(916,673),
    state 0x0, keycode 123 (keysym 0x1008ff13, XF86AudioRaiseVolume), same_screen YES,
    XLookupString gives 0 bytes:
    XFilterEvent returns: False

MappingNotify event, serial 40, synthetic NO, window 0x0,
    request MappingKeyboard, first_keycode 8, count 248

KeyPress event, serial 40, synthetic NO, window 0x4800001,
    root 0xc4, subw 0x0, time 695373503, (666,490), root:(715,542),
    state 0x0, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

Bill Filler (bfiller)
Changed in canonical-devices-system-image:
milestone: ww08-2016 → 11
Bill Filler (bfiller)
Changed in canonical-devices-system-image:
milestone: 11 → backlog
tags: added: system-apps
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.