From: Andre Renaud <andre@bluewatersys.com>
To: linux-bluetooth@vger.kernel.org
Subject: Headset+Alsa problems (without Pulse Audio)
Date: Wed, 13 Jul 2011 16:38:30 +1200 [thread overview]
Message-ID: <4E1D2146.2050508@bluewatersys.com> (raw)
Hello,
I'm trying to get a bluetooth headset working on an embedded Linux
environment. I don't have the available resources to drag in all of
Pulse Audio, so this is being done with essentially just bluez
and the alsa-libs.
It all seems to connect & pair properly, but when I go to play audio
no sound comes out. There are no complaints, and the 'aplay' command
runs for approximately the correct amount of time before exiting
cleanly. Using hcidump, I can see that the audio data is being
transmitted.
In the process of investigating this, I found that the amixer command
was unable to talk to the bluetooth controls. I eventually tracked
this down to a bug in audio/ctl_bluetooth.c. Having fixed it,
I am now able to list the controls, but unable to change their values
(I have also made it so that it errors out if it goes to change
an integer, and the change doesn't take, rather than looping forever).
Does anyone know what I might be missing, or where I should start
looking next?
Regards,
Andre
--- a/audio/ctl_bluetooth.c 2011-07-13 15:53:11.000000000 +1200
+++ b/audio/ctl_bluetooth.c 2011-07-13 16:27:04.000000000 +1200
@@ -156,7 +156,7 @@
req->mode = mode;
req->key = key;
- ret = send(data->sock, req, BT_SUGGESTED_BUFFER_SIZE, MSG_NOSIGNAL);
+ ret = send(data->sock, req, sizeof(*req), MSG_NOSIGNAL);
if (ret <= 0) {
SYSERR("Unable to request new volume value to server");
return -errno;
@@ -225,7 +225,7 @@
struct bluetooth_data *data = ext->private_data;
char buf[BT_SUGGESTED_BUFFER_SIZE];
struct bt_control_rsp *rsp = (void *) buf;
- long current;
+ long current, new;
int ret, keyvalue;
DBG("ext %p key %ld", ext, key);
@@ -245,7 +245,16 @@
if (ret < 0)
break;
- current = keyvalue;
+ ret = bluetooth_read_integer(ext, key, &new);
+ if (ret < 0)
+ return ret;
+
+ if (new == current) {
+ SNDERR("Unable to move volume %s",
+ keyvalue == BT_CONTROL_KEY_VOL_UP ? "up" : "down");
+ return -EAGAIN;
+ }
+ current = new;
}
return ret;
next reply other threads:[~2011-07-13 4:38 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-13 4:38 Andre Renaud [this message]
2011-07-13 8:09 ` Headset+Alsa problems (without Pulse Audio) Johan Hedberg
2011-07-13 22:38 ` Andre Renaud
2011-07-13 23:04 ` Johan Hedberg
2011-07-13 23:19 ` Andre Renaud
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=4E1D2146.2050508@bluewatersys.com \
--to=andre@bluewatersys.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.