public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
From: "Csillag Kristóf" <csillag.kristof@gmail.com>
To: "BlueZ users" <bluez-users@lists.sourceforge.net>
Subject: Re: [Bluez-users] Using AVRCP with current BlueZ
Date: Fri, 23 Nov 2007 13:00:40 +0100	[thread overview]
Message-ID: <9a119b3c0711230400l2885eccei3b32efb152ddec0@mail.gmail.com> (raw)
In-Reply-To: <1c9b31320711220913r1f89aafgcf88c0927bfb1c1@mail.gmail.com>

[-- 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

  parent reply	other threads:[~2007-11-23 12:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2007-11-23 12:32     ` Johan Hedberg

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=9a119b3c0711230400l2885eccei3b32efb152ddec0@mail.gmail.com \
    --to=csillag.kristof@gmail.com \
    --cc=bluez-users@lists.sourceforge.net \
    /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