From: russ.dill@gmail.com
To: Bastien Nocera <hadess@hadess.net>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: Bluetooth audio via pulse doesn't function unless I chant the magic incantations
Date: Tue, 10 Nov 2009 23:51:43 -0700 (MST) [thread overview]
Message-ID: <g1vqglnkns6heggtgeUYAxe124vaj_firegpg@mail.gmail.com> (raw)
In-Reply-To: <1257389371.23167.155.camel@localhost.localdomain>
[-- Attachment #1: Type: text/plain, Size: 3773 bytes --]
On Wed, Nov 4, 2009 at 7:49 PM, Bastien Nocera <hadess@hadess.net> wrote:
> On Wed, 2009-11-04 at 19:13 -0700, Russ Dill wrote:
>> On Wed, Nov 4, 2009 at 6:29 AM, Bastien Nocera <hadess@hadess.net> wrote:
>> > On Wed, 2009-11-04 at 01:14 -0700, Russ Dill wrote:
>> >> I have ubuntu lucid (its just karmic+2.6.32-rc5) and I can only get
>> >> pulseaudio to detect my Sony DR-BT50 headset if I send some dbus
>> >> commands:
>> >>
>> >> addr=00:1a:80:67:63:2c
>> >> hci=$(dbus-send --print-reply --system --dest=org.bluez /
>> >> org.bluez.Manager.DefaultAdapter | tail -n 1 | cut -f 2 -d '"')
>> >> dev=$(dbus-send --print-reply --system --dest=org.bluez $hci
>> >> org.bluez.Adapter.FindDevice string:$addr | tail -n 1 | cut -f 2 -d
>> >> '"')
>> >> dbus-send --print-reply --system --dest=org.bluez $dev org.bluez.Audio.Connect
>> >>
>> >> Additionally, the device shows up under the gnome bluetooth-properties
>> >> applet under "Known devices" with the gold star and the keys. The
>> >> connected plug doesn't appear until I exec the above commands.
>> >> Clicking the plug without the above commands does nothing.
>> >
>> > You're using bluez-gnome (or possibly an old version of
>> > gnome-bluetooth). Make sure you use the latest version (2.28.3).
>> >
>> > Cheers
>> >
>>
>> Thank you for the awesomeness.
>>
>> Next question, I get events from keypresses on the headset via a
>> /dev/input/eventX file, but how do I do things with those events?
>
> If you use GNOME, the buttons should be forwarded to X11, and to the
> desktop. So the volume buttons should already work. Check the Sound and
> Keyboard shortcuts preferences.
>
I'm not sure why it wasn't working before, but it is working now. A couple of things though. It seems my headset tries to be too smart, it has a play/pause button and it alternates between play and pause. So if audio is playing, and I hit pause on the music player, the music pauses. Then I hit pause/play on my headphones and nothing happens because it sent a pause. So I need to press it again so that it will send play.
I'd assign them both to the gnome play functionality since it does both play and pause, but It doesn't seem possible to assign two keys for the same shortcut. Maybe its somehow possible to make a udev rules or somesuch file that does the reassignment of the actual keycode?
The headset also has track select buttons, but those aren't making into uinput. I can see bluetoothd reading the event, but it never writes it out to uinput.
track +
read(25, "0\21\16\0H|~\5\10\0F\0\1", 1024) = 13
write(25, "2\21\16\tH|~\5\10\0F\0\1", 13) = 13
poll([...])
read(25, "@\21\16\0H|\376\5\10\0F\0\1", 1024) = 13
write(25, "B\21\16\tH|\376\5\10\0F\0\1", 13) = 13
track -
read(25, "\240\21\16\0H|~\5\10\0F\0\2", 1024) = 13
write(25, "\242\21\16\tH|~\5\10\0F\0\2", 13) = 13
poll([...])
read(25, "\260\21\16\0H|\376\5\10\0F\0\2", 1024) = 13
write(25, "\262\21\16\tH|\376\5\10\0F\0\2", 13) = 13
where 25 is a socket
From looking at the source, it looks like the key (operand[0]) for both is 0x7e. The last byte changes between a 1 and a 2. Does 0x7e indicate some kind of vendor specific messsaging?
For comparison, here is a key that does make it:
read(25, "\340\21\16\0H|K\0", 1024) = 8
write(26, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\243\0\1\0\0\0", 24) = 24
write(26, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 24) = 24
write(25, "\342\21\16\tH|K\0", 8) = 8
poll([...])
read(25, "\360\21\16\0H|\313\0", 1024) = 8
write(26, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\243\0\0\0\0\0", 24) = 24
write(26, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 24) = 24
write(25, "\362\21\16\tH|\313\0", 8) = 8
26 is /dev/uinput
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 271 bytes --]
next prev parent reply other threads:[~2009-11-11 6:51 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-04 8:14 Bluetooth audio via pulse doesn't function unless I chant the magic incantations Russ Dill
2009-11-04 13:29 ` Bastien Nocera
2009-11-05 2:13 ` Russ Dill
2009-11-05 2:49 ` Bastien Nocera
2009-11-11 6:51 ` russ.dill [this message]
2009-11-11 6:58 ` russ.dill
2009-11-11 8:33 ` Russ Dill
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=g1vqglnkns6heggtgeUYAxe124vaj_firegpg@mail.gmail.com \
--to=russ.dill@gmail.com \
--cc=hadess@hadess.net \
--cc=linux-bluetooth@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox