Re: Bluetooth audio via pulse doesn't function unless I chant the magic incantations

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On Wed, Nov 4, 2009 at 7:49 PM, Bastien Nocera <hadess@xxxxxxxxxx> 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@xxxxxxxxxx> 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: signature.asc
Description: OpenPGP digital signature


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux