maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Multimedia (https://talk.maemo.org/forumdisplay.php?f=32)
-   -   [ANNOUNCE] headset-control : Make the headset button actually manipulate tracks. (https://talk.maemo.org/showthread.php?t=21182)

shadowjk 2010-01-18 21:43

Re: [ANNOUNCE] headset-control : Make the headset button actually manipulate tracks.
 
my ad-54 gives audio from both earbuds for me, but obviously the buttons do nothing.

Bec 2010-01-18 21:46

Re: [ANNOUNCE] headset-control : Make the headset button actually manipulate tracks.
 
d-bus tutorial... anyone???

OVK 2010-01-19 07:34

Re: [ANNOUNCE] headset-control : Make the headset button actually manipulate tracks.
 
Quote:

Originally Posted by Bec (Post 480844)
d-bus tutorial... anyone???

I am not an expert, this is just something that I found from the Google:
http://linux.die.net/man/1/dbus-monitor

So it seems that you just need to open xterm and type dbus-monitor (and you can also give some more specific attributes to this command). Works for me (although I don't know how to exit the dbus-monitor), I just don't understand most of the output... I also don't know if it would be better to run this as root.

Unfortunately I could not find my AD-54 for testing.

Bec 2010-01-19 09:06

Re: [ANNOUNCE] headset-control : Make the headset button actually manipulate tracks.
 
I've done some tests with the music lpayer and the phone in the background:

Default headset:
Code:

                  string "group"
                  variant                      string "alarm"
              }
              struct {
                  string "limit"
                  variant                      int32 100
              }
            ]
            array [
              struct {
                  string "group"
                  variant                      string "event"
              }
              struct {
                  string "limit"
                  variant                      int32 100
              }
            ]
            array [
              struct {
                  string "group"
                  variant                      string "inputsound"
              }
              struct {
                  string "limit"
                  variant                      int32 0
              }
            ]
            array [
              struct {
                  string "group"
                  variant                      string "systemsound"
              }
              struct {
                  string "limit"
                  variant                      int32 0
              }
            ]
            array [
              struct {
                  string "group"
                  variant                      string "background"
              }
              struct {
                  string "limit"
                  variant                      int32 100
              }
            ]
            array [
              struct {
                  string "group"
                  variant                      string "idle"
              }
              struct {
                  string "limit"
                  variant                      int32 100
              }
            ]
        ]
      )
      dict entry(
        string "com.nokia.policy.context"
        array [
            array [
              struct {
                  string "variable"
                  variant                      string "call_audio_type"
              }
              struct {
                  string "value"
                  variant                      string "none"
              }
            ]
            array [
              struct {
                  string "variable"
                  variant                      string "call"
              }
              struct {
                  string "value"
                  variant                      string "inactive"
              }
            ]
            array [
              struct {
                  string "variable"
                  variant                      string "mode"
              }
              struct {
                  string "value"
                  variant                      string "media"
              }
            ]
        ]
      )
      dict entry(
        string "com.nokia.policy.audio_route"
        array [
            array [
              struct {
                  string "type"
                  variant                      string "sink"
              }
              struct {
                  string "device"
                  variant                      string "headset"
              }
              struct {
                  string "mode"
                  variant                      string "hs"
              }
              struct {
                  string "hwid"
                  variant                      string "na"
              }
            ]
            array [
              struct {
                  string "type"
                  variant                      string "source"
              }
              struct {
                  string "device"
                  variant                      string "headset"
              }
              struct {
                  string "mode"
                  variant                      string "na"
              }
              struct {
                  string "hwid"
                  variant                      string "na"
              }
            ]
        ]
      )
  ]
signal sender=:1.10 -> dest=(null destination) serial=5023 path=/org/freedesktop/Hal/Manager; interface=org.freedesktop.Hal.Manager; member=DeviceAdded
  string "/org/freedesktop/Hal/devices/computer_logicaldev_input_1"

HS-43
Code:

                  string "limit"
                  variant                      int32 0
              }
            ]
            array [
              struct {
                  string "group"
                  variant                      string "fmradio"
              }
              struct {
                  string "limit"
                  variant                      int32 0
              }
            ]
            array [
              struct {
                  string "group"
                  variant                      string "othermedia"
              }
              struct {
                  string "limit"
                  variant                      int32 0
              }
            ]
            array [
              struct {
                  string "group"
                  variant                      string "alarm"
              }
              struct {
                  string "limit"
                  variant                      int32 100
              }
            ]
            array [
              struct {
                  string "group"
                  variant                      string "event"
              }
              struct {
                  string "limit"
                  variant                      int32 100
              }
            ]
            array [
              struct {
                  string "group"
                  variant                      string "inputsound"
              }
              struct {
                  string "limit"
                  variant                      int32 0
              }
            ]
            array [
              struct {
                  string "group"
                  variant                      string "systemsound"
              }
              struct {
                  string "limit"
                  variant                      int32 0
              }
            ]
            array [
              struct {
                  string "group"
                  variant                      string "background"
              }
              struct {
                  string "limit"
                  variant                      int32 100
              }
            ]
            array [
              struct {
                  string "group"
                  variant                      string "idle"
              }
              struct {
                  string "limit"
                  variant                      int32 100
              }
            ]
        ]
      )
      dict entry(
        string "com.nokia.policy.context"
        array [
            array [
              struct {
                  string "variable"
                  variant                      string "call_audio_type"
              }
              struct {
                  string "value"
                  variant                      string "none"
              }
            ]
            array [
              struct {
                  string "variable"
                  variant                      string "call"
              }
              struct {
                  string "value"
                  variant                      string "inactive"
              }
            ]
            array [
              struct {
                  string "variable"
                  variant                      string "mode"
              }
              struct {
                  string "value"
                  variant                      string "media"
              }
            ]
        ]
      )
      dict entry(
        string "com.nokia.policy.audio_route"
        array [
            array [
              struct {
                  string "type"
                  variant                      string "sink"
              }
              struct {
                  string "device"
                  variant                      string "headset"
              }
              struct {
                  string "mode"
                  variant                      string "hs"
              }
              struct {
                  string "hwid"
                  variant                      string "na"
              }
            ]
            array [
              struct {
                  string "type"
                  variant                      string "source"
              }
              struct {
                  string "device"
                  variant                      string "headset"
              }
              struct {
                  string "mode"
                  variant                      string "na"
              }
              struct {
                  string "hwid"
                  variant                      string "na"
              }
            ]
        ]
      )
  ]
signal sender=:1.10 -> dest=(null destination) serial=5135 path=/org/freedesktop/Hal/Manager; interface=org.freedesktop.Hal.Manager; member=DeviceAdded
  string "/org/freedesktop/Hal/devices/computer_logicaldev_input_1"


And shutting down a call with the default headset:
Code:

signal sender=:1.9 -> dest=(null destination) serial=745 path=/com/nokia/mce/signal; interface=com.nokia.mce.signal; member=sig_call_state_ind
  string "none"
  string "normal"
signal sender=:1.16 -> dest=(null destination) serial=21 path=/com/nokia/policy/decision; interface=com.nokia.policy; member=status
  uint32 37
  uint32 1
signal sender=:1.22 -> dest=(null destination) serial=57 path=/com/nokia/policy/decision; interface=com.nokia.policy; member=status
  uint32 37
  uint32 1
signal sender=:1.10 -> dest=(null destination) serial=5234 path=/org/freedesktop/Hal/devices/bme; interface=org.freedesktop.Hal.Device; member=PropertyModified
  int32 2
  array [
      struct {
        string "battery.voltage.current"
        boolean false
        boolean false
      }
      struct {
        string "battery.reporting.current"
        boolean false
        boolean false
      }
  ]
signal sender=:1.17 -> dest=(null destination) serial=1006 path=/com/nokia/phone/net; interface=Phone.Net; member=registration_status_change
  byte 0
  uint16 1610
  uint32 1015399
  uint32 10
  uint32 226
  byte 0
  byte 3
signal sender=:1.17 -> dest=(null destination) serial=1007 path=/com/nokia/phone/net; interface=Phone.Net; member=operator_name_change
  byte 0
  string "RO ORANGE"
  string ""
  uint32 10
  uint32 226
signal sender=:1.17 -> dest=(null destination) serial=1008 path=/com/nokia/phone/net; interface=Phone.Net; member=cell_info_change
  byte 2
  uint16 1610
  uint32 1015399
  uint32 10
  uint32 226
  byte 0
  byte 0

On my previous Nokia there were two input reader programs (eg.magickey) that were allowing you to change the action of a specific key either on a global profile, for the entire device, or for certain applications, chosen by you.

However none of these programs could "sniff out" the headset input.
The only guys to almost master this function were the guys at mobifactor.ru - 4 out of 5 buttons.
CorePlayer could recognize one aswell... but those are ol' symbian times

OVK 2010-01-19 10:12

Re: [ANNOUNCE] headset-control : Make the headset button actually manipulate tracks.
 
Quote:

Originally Posted by Bec (Post 481518)
I also ran it but I had no Idea what to do once it started... didn't seem like it was reading or waiting for signals...

It does show at least some signals. Try plugging in a headset, it definatively makes an effect.

andrei1089 2010-01-19 10:18

Re: [ANNOUNCE] headset-control : Make the headset button actually manipulate tracks.
 
Quote:

Originally Posted by OVK (Post 481406)
I am not an expert, this is just something that I found from the Google:
http://linux.die.net/man/1/dbus-monitor

So it seems that you just need to open xterm and type dbus-monitor (and you can also give some more specific attributes to this command). Works for me (although I don't know how to exit the dbus-monitor), I just don't understand most of the output... I also don't know if it would be better to run this as root.

Unfortunately I could not find my AD-54 for testing.

you can exit dbus-monitor with Ctrl+C

mankir 2010-01-19 10:25

Re: [ANNOUNCE] headset-control : Make the headset button actually manipulate tracks.
 
AD-54 is recognized as a headset, when plugged in. dmesg gives a message, input: headset button as /class/input/inputX. When i plug out and in again, the Number X is increased by 1. I think this is a bug...

Would be nice to get the other buttons working!

Bec 2010-01-19 10:27

Re: [ANNOUNCE] headset-control : Make the headset button actually manipulate tracks.
 
Edited my previous post, added headset behaviors.

OVK 2010-01-19 10:56

Re: [ANNOUNCE] headset-control : Make the headset button actually manipulate tracks.
 
Quote:

Originally Posted by Bec (Post 481518)
On my previous Nokia there were two input reader programs (eg.magickey) that were allowing you to change the action of a specific key either on a global profile, for the entire device, or for certain applications, chosen by you.

However none of these programs could "sniff out" the headset input.
The only guys to almost master this function were the guys at mobifactor.ru - 4 out of 5 buttons.
CorePlayer could recognize one aswell... but those are ol' symbian times

What do you think, could it be possible to use the headphoned-app as a base for building this functionality in Maemo 5?

I mean this one: http://talk.maemo.org/showthread.php?t=33215

It sends a pause command to Mediaplayer when the headphones are unplugged. I think it could probably be useful to install the headphoned and test if/how the dbus-monitor output changes compared to your previous trials. Also the code is open so it could give a hint on how to make this type of functionality.

Bec 2010-01-19 11:57

Re: [ANNOUNCE] headset-control : Make the headset button actually manipulate tracks.
 
Honestly, no. What was working in symbian programs like "MagicKey" was probably the dependency on a dbus-like feature in symbian.

Simply expecting an input in dbus doesn't work without a special application, like in our case the phone application.

But the most authorized person on this matter, is obviously qwerty12 (see first post) so you should ask him.


All times are GMT. The time now is 00:47.

vBulletin® Version 3.8.8