UBports Robot Logo UBports Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Call for help: Testing headset buttons

    Scheduled Pinned Locked Moved OS
    28 Posts 9 Posters 4.8k Views 4 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
      Reply
      • Reply as topic
      Log in to reply
      This topic has been deleted. Only users with topic management privileges can see it.
      • ? Offline
        A Former User
        last edited by

        I'm a bit late, but here's my version of events:

        Devices:
        Cosmo Communicator
        PinePhone Rev1.2b

        Headsets:
        3 different sets of wired headsets, one with 3 buttons, one with 2 buttons, one with 1 button

        On the Cosmo, selecting:
        '/dev/input/event0: ACCDET'

        For all buttons on all headsets I get:
        type 1 (EV_KEY), code 164 (KEY_PLAYPAUSE), value 0
        -------------- SYN_REPORT ------------
        type 1 (EV_KEY), code 164 (KEY_PLAYPAUSE), value 1
        -------------- SYN_REPORT ------------

        There were 'Event code 114 (KEY_VOLUMEDOWN)' and 'Event code 115 (KEY_VOLUMEUP)' amongst other things listed in the 'Supported events' list, but I didn't see them on any button press.

        On the PinePhone, after entering 'evtest' I got no 'Available devices', after entering 'sudo evtest' I got some choices, but none gave any response.

        1 Reply Last reply Reply Quote 0
        • c4pp4C Offline
          c4pp4
          last edited by

          Device: Xiaomi Mi A2
          Wired USB earphones with three buttons: Mi Dual Driver Earphones (Type-C) (https://www.amazon.de/XIAOMI-Kopfhârer-Weiß-Audio-Stecker/dp/B07MLRXJBC)

          Available devices:
          /dev/input/event0:      qpnp_pon
          /dev/input/event1:      NVTCapacitiveTouchScreen
          /dev/input/event2:      uinput-goodix
          /dev/input/event3:      hall-switch-input
          /dev/input/event4:      gpio-keys
          /dev/input/event5:      sdm660-snd-card Headset Jack
          /dev/input/event6:      sdm660-snd-card Button Jack
          /dev/input/event7:      uinput-fpc
          Select the device event number [0-7]: 6
          Input driver version is 1.0.1
          Input device ID: bus 0x0 vendor 0x0 product 0x0 version 0x0
          Input device name: "sdm660-snd-card Button Jack"
          Supported events:
            Event type 0 (EV_SYN)
            Event type 1 (EV_KEY)
              Event code 114 (KEY_VOLUMEDOWN)
              Event code 115 (KEY_VOLUMEUP)
              Event code 226 (KEY_MEDIA)
              Event code 260 (BTN_4)
              Event code 261 (BTN_5)
              Event code 582 (KEY_VOICECOMMAND)
          Properties:
            Property type 6 (?)
          Testing ... (interrupt to exit)
          Event: time 1620770065.854970, type 1 (EV_KEY), code 115 (KEY_VOLUMEUP), value 1
          Event: time 1620770065.854970, -------------- SYN_REPORT ------------
          Event: time 1620770065.855140, type 1 (EV_KEY), code 115 (KEY_VOLUMEUP), value 0
          Event: time 1620770065.855140, -------------- SYN_REPORT ------------
          Event: time 1620770067.377695, type 1 (EV_KEY), code 226 (KEY_MEDIA), value 1
          Event: time 1620770067.377695, -------------- SYN_REPORT ------------
          Event: time 1620770067.377772, type 1 (EV_KEY), code 226 (KEY_MEDIA), value 0
          Event: time 1620770067.377772, -------------- SYN_REPORT ------------
          Event: time 1620770068.851389, type 1 (EV_KEY), code 114 (KEY_VOLUMEDOWN), value 1
          Event: time 1620770068.851389, -------------- SYN_REPORT ------------
          Event: time 1620770068.851508, type 1 (EV_KEY), code 114 (KEY_VOLUMEDOWN), value 0
          Event: time 1620770068.851508, -------------- SYN_REPORT ------------
          
          poVoqP 1 Reply Last reply Reply Quote 0
          • poVoqP Offline
            poVoq @c4pp4
            last edited by

            @c4pp4 Ah, cool, so USB headset audio is already supported? That would be nice to add to the button support as well.

            Fairphone 5 (waiting for port)

            flohackF 1 Reply Last reply Reply Quote 0
            • flohackF Offline
              flohack @poVoq
              last edited by

              @povoq Well headset audio should work for music with any headset (wired, BT) but call audio seems to be broken for BT.

              My languages: πŸ‡¦πŸ‡Ή πŸ‡©πŸ‡ͺ πŸ‡¬πŸ‡§ πŸ‡ΊπŸ‡Έ

              poVoqP 1 Reply Last reply Reply Quote 0
              • poVoqP Offline
                poVoq @flohack
                last edited by

                @flohack Well, I was surprised as "wired" as in headphone jack is completly different from USB headsets.

                Fairphone 5 (waiting for port)

                flohackF 1 Reply Last reply Reply Quote 0
                • flohackF Offline
                  flohack @poVoq
                  last edited by

                  @povoq Ohh I see. That would be new, that USB devices work πŸ˜‰

                  My languages: πŸ‡¦πŸ‡Ή πŸ‡©πŸ‡ͺ πŸ‡¬πŸ‡§ πŸ‡ΊπŸ‡Έ

                  CiberSheepC 1 Reply Last reply Reply Quote 0
                  • CiberSheepC Offline
                    CiberSheep @flohack
                    last edited by

                    Oh, I didn't understand I could test wired ones πŸ˜„
                    I have ones of those white, hard ones with 3 buttons, vol+, vol- and white button:

                    Select the device event number [0-5]: 4
                    Input driver version is 1.0.1
                    Input device ID: bus 0x19 vendor 0x0 product 0x0 version 0x0
                    Input device name: "ACCDET"
                    [...]
                    Properties:
                    Testing ... (interrupt to exit)
                    Event: time 1620815706.095935, type 1 (EV_KEY), code 164 (KEY_PLAYPAUSE), value 1
                    Event: time 1620815706.095935, type 1 (EV_KEY), code 164 (KEY_PLAYPAUSE), value 0
                    

                    Only white central button works, not the volume ones

                    Another planet, another time, another universe!

                    1 Reply Last reply Reply Quote 0
                    • rikR Offline
                      rik
                      last edited by rik

                      Nexus 5, RC Channel (2021-W18), wired headset w/ play/pause, volume +, volume - buttons:

                      phablet@ubuntu-phablet:~$ sudo evtest
                      No device specified, trying to scan all of /dev/input/event*
                      Available devices:
                      /dev/input/event0:	qpnp_pon
                      /dev/input/event1:	touch_dev
                      /dev/input/event2:	gpio-keys
                      /dev/input/event3:	hs_detect
                      /dev/input/event4:	msm8974-taiko-mtp-snd-card Button Jack
                      /dev/input/event5:	msm8974-taiko-mtp-snd-card Headset Jack
                      Select the device event number [0-5]: 3
                      Input driver version is 1.0.1
                      Input device ID: bus 0x0 vendor 0x1 product 0x1 version 0x1
                      Input device name: "hs_detect"
                      Supported events:
                        Event type 0 (EV_SYN)
                        Event type 1 (EV_KEY)
                          Event code 114 (KEY_VOLUMEDOWN)
                          Event code 115 (KEY_VOLUMEUP)
                          Event code 226 (KEY_MEDIA)
                        Event type 5 (EV_SW)
                          Event code 2 (SW_HEADPHONE_INSERT) state 1
                          Event code 4 (SW_MICROPHONE_INSERT) state 1
                      Properties:
                      Testing ... (interrupt to exit)
                      Event: time 439671.235176, type 1 (EV_KEY), code 226 (KEY_MEDIA), value 1
                      Event: time 439671.235866, -------------- SYN_REPORT ------------
                      Event: time 439671.400194, type 1 (EV_KEY), code 226 (KEY_MEDIA), value 0
                      Event: time 439671.400336, -------------- SYN_REPORT ------------
                      

                      So the volume + and volume - buttons are not detected, but the play / pause button is detected (correctly) as KEY_MEDIA. However, pressing it 1 time gives 2 events, both the value 1 and the value 0 entries above are from a single key press.

                      flohackF 1 Reply Last reply Reply Quote 0
                      • rikR Offline
                        rik @kugiigi
                        last edited by rik

                        @kugiigi this means the device you are inspecting isn't associated with your headset (or it isn't detecting any button presses). Try again with another device selected. If it is a bluetooth device and you have selected the correct device (by mac address for bluetooth) then I think that means unfortunately button detection isn't working for that device. Can you try other bluetooth devices and / or other wired headsets?

                        UPDATE: I tried with 2 bluetooth devices and got no detected events either.....

                        1 Reply Last reply Reply Quote 0
                        • flohackF Offline
                          flohack @rik
                          last edited by

                          @rik Yeah the 2 events are okay, you could have different functions for a long and a short press, so thats why it needs to send press and release.

                          My languages: πŸ‡¦πŸ‡Ή πŸ‡©πŸ‡ͺ πŸ‡¬πŸ‡§ πŸ‡ΊπŸ‡Έ

                          1 Reply Last reply Reply Quote 1
                          • rikR Offline
                            rik
                            last edited by rik

                            Nexus 5, RC Channel (2021-W18), 2 bluetooth headsets (Mpow M30 earbuds, Anker Sound Core Mini speaker): no events detected when pressing play/pause, volume buttons 😞 but sound does work to both devices πŸ™‚

                            1 Reply Last reply Reply Quote 0
                            • Z zubozrout referenced this topic on
                            • First post
                              Last post