public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* Using AVRCP with current BlueZ
@ 2007-11-22 16:26 Csillag Kristóf
  2007-11-22 17:13 ` [Bluez-users] " Johan Hedberg
  0 siblings, 1 reply; 5+ messages in thread
From: Csillag Kristóf @ 2007-11-22 16:26 UTC (permalink / raw)
  To: bluez-users; +Cc: marcel

Hi there!

The wiki page at http://wiki.bluez.org/wiki/HOWTO/AudioDevices says that
I no longer not need bluetooth-alsa, plugz, btsco or the like for audio
to work - they are now obsolete.

My question is, how can I use AVRCP now? bluetooth-alsa used to contain
some support for it, but now I guess it's gone. Browsing the source
code of bluez-utils, I see some dbus interface, but I can not find
any example demonstrating how to use this.

Could you please point me to the right documentation (if it exists)?

Thank you for your help:

   Kristof Csillag

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Bluez-users] Using AVRCP with current BlueZ
  2007-11-22 16:26 Using AVRCP with current BlueZ Csillag Kristóf
@ 2007-11-22 17:13 ` Johan Hedberg
  2007-11-23  2:36   ` \x11
  2007-11-23 12:00   ` Csillag Kristóf
  0 siblings, 2 replies; 5+ messages in thread
From: Johan Hedberg @ 2007-11-22 17:13 UTC (permalink / raw)
  To: BlueZ users

Hi Kristof,

On Nov 22, 2007 6:26 PM, Csillag Krist=F3f <csillag.kristof@gmail.com> wrot=
e:
> My question is, how can I use AVRCP now? bluetooth-alsa used to contain
> some support for it, but now I guess it's gone. Browsing the source
> code of bluez-utils, I see some dbus interface, but I can not find
> any example demonstrating how to use this.
>
> Could you please point me to the right documentation (if it exists)?

I don't think there is any proper documentation yet. bluez-utils-3.22
has some preliminary AVRCP support but by default it's disabled. You
need to add a line "Enable=3DControl" to the General section in
/etc/bluetooth/audio.conf to enable it. Currently no D-Bus signals or
or methods are supported. Instead, the audio service uses the kernel
uinput interface (you need to have the uinput module loaded) to inject
keypress events to the kernel input subsystem. You can see what kind
of AVRCP->keycode mappings are used by looking in the audio/control.c
file from bluez-utils.

Johan

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Bluez-users] Using AVRCP with current BlueZ
  2007-11-22 17:13 ` [Bluez-users] " Johan Hedberg
@ 2007-11-23  2:36   ` \x11
  2007-11-23 12:00   ` Csillag Kristóf
  1 sibling, 0 replies; 5+ messages in thread
From: \x11 @ 2007-11-23  2:36 UTC (permalink / raw)
  To: BlueZ users


Thanks,Johan.
im also wondering how i can do avrcp and now here's the answer.



semiyd




> Date: Thu, 22 Nov 2007 19:13:55 +0200
> From: johan.hedberg@gmail.com
> To: bluez-users@lists.sourceforge.net
> Subject: Re: [Bluez-users] Using AVRCP with current BlueZ
>
> Hi Kristof,
>
> On Nov 22, 2007 6:26 PM, Csillag Krist=F3f  wrote:
>> My question is, how can I use AVRCP now? bluetooth-alsa used to contain
>> some support for it, but now I guess it's gone. Browsing the source
>> code of bluez-utils, I see some dbus interface, but I can not find
>> any example demonstrating how to use this.
>>
>> Could you please point me to the right documentation (if it exists)?
>
> I don't think there is any proper documentation yet. bluez-utils-3.22
> has some preliminary AVRCP support but by default it's disabled. You
> need to add a line "Enable=3DControl" to the General section in
> /etc/bluetooth/audio.conf to enable it. Currently no D-Bus signals or
> or methods are supported. Instead, the audio service uses the kernel
> uinput interface (you need to have the uinput module loaded) to inject
> keypress events to the kernel input subsystem. You can see what kind
> of AVRCP->keycode mappings are used by looking in the audio/control.c
> file from bluez-utils.
>
> Johan
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2005.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Bluez-users mailing list
> Bluez-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bluez-users

_________________________________________________________________
Connect to the next generation of MSN Messenger=A0
http://imagine-msn.com/messenger/launch80/default.aspx?locale=3Den-us&sourc=
e=3Dwlmailtagline
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Bluez-users] Using AVRCP with current BlueZ
  2007-11-22 17:13 ` [Bluez-users] " Johan Hedberg
  2007-11-23  2:36   ` \x11
@ 2007-11-23 12:00   ` Csillag Kristóf
  2007-11-23 12:32     ` Johan Hedberg
  1 sibling, 1 reply; 5+ messages in thread
From: Csillag Kristóf @ 2007-11-23 12:00 UTC (permalink / raw)
  To: BlueZ users

[-- Attachment #1: Type: text/plain, Size: 1329 bytes --]

Hi Johan,

2007/11/22, Johan Hedberg <johan.hedberg@gmail.com>:
> I don't think there is any proper documentation yet. bluez-utils-3.22
> has some preliminary AVRCP support but by default it's disabled. You
> need to add a line "Enable=Control" to the General section in
> /etc/bluetooth/audio.conf to enable it. Currently no D-Bus signals or
> or methods are supported. Instead, the audio service uses the kernel
> uinput interface (you need to have the uinput module loaded) to inject
> keypress events to the kernel input subsystem. You can see what kind
> of AVRCP->keycode mappings are used by looking in the audio/control.c
> file from bluez-utils.

Thanks, now it works great!

One more question: what was the reason to use

KEY_NEXT and KEY_PREVIOUS, instead of
KEY_NEXTSONG and KEY_PREVIOUSSONG?

The latter are below-256 keycodes (like KEY_PLAYPAUSE,
which is used by BlueZ for pause) handled nicely by
all applications (like keytouch), where the former, which
are currently used, are extended codes, mostly unsupported
in user-space.

As far as I am interested, I changed the codes in my local
BlueZ installation so that I do not have to change keytouch.

Now it works nice with keytouch and hence audacious.

Thank you:

    Kristóf

ps. Here is a patch, if anybody is interested.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: keycode_change.patch --]
[-- Type: text/x-diff; name=keycode_change.patch, Size: 1804 bytes --]

--- control.c~	2007-10-26 01:09:15.000000000 +0200
+++ control.c	2007-11-23 12:34:52.000000000 +0100
@@ -447,8 +447,8 @@
 
 	ioctl(fd, UI_SET_KEYBIT, KEY_PLAYPAUSE);
 	ioctl(fd, UI_SET_KEYBIT, KEY_STOP);
-	ioctl(fd, UI_SET_KEYBIT, KEY_NEXT);
-	ioctl(fd, UI_SET_KEYBIT, KEY_PREVIOUS);
+	ioctl(fd, UI_SET_KEYBIT, KEY_NEXTSONG);
+	ioctl(fd, UI_SET_KEYBIT, KEY_PREVIOUSSONG);
 	ioctl(fd, UI_SET_KEYBIT, KEY_REWIND);
 	ioctl(fd, UI_SET_KEYBIT, KEY_FORWARD);
 
@@ -560,11 +560,11 @@
 		break;
 	case NEXT_OP:
 		debug("AVRCP: NEXT %s", status);
-		send_key(session->uinput, KEY_NEXT, pressed);
+		send_key(session->uinput, KEY_NEXTSONG, pressed);
 		break;
 	case PREV_OP:
 		debug("AVRCP: PREV %s", status);
-		send_key(session->uinput, KEY_PREVIOUS, pressed);
+		send_key(session->uinput, KEY_PREVIOUSSONG, pressed);
 		break;
 	case REWIND_OP:
 		debug("AVRCP: REWIND %s", status);
--- bluez-utils-3.22/audio/control.c~	2007-10-26 01:09:15.000000000 +0200
+++ bluez-utils-3.22/audio/control.c	2007-11-23 12:34:52.000000000 +0100
@@ -447,8 +447,8 @@
 
 	ioctl(fd, UI_SET_KEYBIT, KEY_PLAYPAUSE);
 	ioctl(fd, UI_SET_KEYBIT, KEY_STOP);
-	ioctl(fd, UI_SET_KEYBIT, KEY_NEXT);
-	ioctl(fd, UI_SET_KEYBIT, KEY_PREVIOUS);
+	ioctl(fd, UI_SET_KEYBIT, KEY_NEXTSONG);
+	ioctl(fd, UI_SET_KEYBIT, KEY_PREVIOUSSONG);
 	ioctl(fd, UI_SET_KEYBIT, KEY_REWIND);
 	ioctl(fd, UI_SET_KEYBIT, KEY_FORWARD);
 
@@ -560,11 +560,11 @@
 		break;
 	case NEXT_OP:
 		debug("AVRCP: NEXT %s", status);
-		send_key(session->uinput, KEY_NEXT, pressed);
+		send_key(session->uinput, KEY_NEXTSONG, pressed);
 		break;
 	case PREV_OP:
 		debug("AVRCP: PREV %s", status);
-		send_key(session->uinput, KEY_PREVIOUS, pressed);
+		send_key(session->uinput, KEY_PREVIOUSSONG, pressed);
 		break;
 	case REWIND_OP:
 		debug("AVRCP: REWIND %s", status);

[-- Attachment #3: Type: text/plain, Size: 228 bytes --]

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

[-- Attachment #4: Type: text/plain, Size: 164 bytes --]

_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Bluez-users] Using AVRCP with current BlueZ
  2007-11-23 12:00   ` Csillag Kristóf
@ 2007-11-23 12:32     ` Johan Hedberg
  0 siblings, 0 replies; 5+ messages in thread
From: Johan Hedberg @ 2007-11-23 12:32 UTC (permalink / raw)
  To: BlueZ users

On Nov 23, 2007, at 14:00, Csillag Krist=F3f wrote:
> One more question: what was the reason to use
>
> KEY_NEXT and KEY_PREVIOUS, instead of
> KEY_NEXTSONG and KEY_PREVIOUSSONG?

No special reason, except that the names of the key codes matched more  =

precisely the AVRCP spec.

> The latter are below-256 keycodes (like KEY_PLAYPAUSE,
> which is used by BlueZ for pause) handled nicely by
> all applications (like keytouch), where the former, which
> are currently used, are extended codes, mostly unsupported
> in user-space.

If this improves interoperability with existing applications then it's  =

probably a good idea to apply your patch. I'll commit it to CVS later  =

today unless somebody has a good reason why it shouldn't be done.

Johan
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Bluez-users mailing list
Bluez-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-users

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-11-23 12:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-22 16:26 Using AVRCP with current BlueZ Csillag Kristóf
2007-11-22 17:13 ` [Bluez-users] " Johan Hedberg
2007-11-23  2:36   ` \x11
2007-11-23 12:00   ` Csillag Kristóf
2007-11-23 12:32     ` Johan Hedberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox