Motorola HT820 audio fidelity
Hi all!
I just got a pair of Motorola HT820 bluetooth headphones, which support A2DP and work with a2play. However, the audio fidelity could definitely be a lot better. I'm no audiophile, but it sounds to me as though the higher frequency bands ("higher" as in, I'd guestimate, ~10 kHz and above) are seriously distorted (I can't put a better word on it than that they are completely transformed into "chirping"). All the lower bands are completely unaffected as far as I can hear, though.
A friend told me that they work perfectly fine with his BT-enabled cell phone. I haven't tried myself, though, since my phone doesn't support A2DP.
I don't know A2DP very well -- could this be the result of bad transmission? I'd guess not, since when I move away, the audio tends to break up rather than lose quality.
I found this little tidbit on Wikipedia:
Most bluetooth stacks implement the SCMS-T copyright protection. In these cases it is not possible to connect the A2DP headphones for high quality audio. E.g. the Motorola HT820 can be used for high quality audio only with certain versions of the Toshiba bluetooth stack. (From <http://en.wikipedia.org/wiki/Bluetooth>)
I don't know if that is related to this, but I thought I should at least mention it.
Does anyone know what could be at fault?
Fredrik Tolf
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel
Fredrik
Quoted 7 lines
I just got a pair of Motorola HT820 bluetooth headphones, which support A2DP and work with a2play. However, the audio fidelity could definitely be a lot better. I'm no audiophile, but it sounds to me as though the higher frequency bands ("higher" as in, I'd guestimate, ~10 kHz and above) are seriously distorted (I can't put a better word on it than that they are completely transformed into "chirping"). All the lower bands are completely unaffected as far as I can hear, though.
I noticed some quality loss at high frequencies, such as high notes on a violin, possibly when using fixed point to build libsbc. It is subtle. On the other hand, if you hear an unexpected "pop" using fixed point, it's definitely an overflow error in the encoder. There's still a problem in there I didn't hunt down.
Steven Singer suggested we to track the error "K" after an encode-decode. K is derived from the root-mean-square error. We could use this to rule out a misbehaving codec.
It doesn't help that we're typically decoding mp3 and reencoding in sbc. Loss is really compounded. Try to test with something in a lossless format or with a high-quality first-generation mp3 or ogg.
Brad
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel
Quoted 2 lines · Brad Midgley
It doesn't help that we're typically decoding mp3 and reencoding in sbc. Loss is really compounded.
Indeed, that seems to be the problem. I was always under the (uninformed) impression that SBC was lossless, but I just tried re-encoding an MP3 to SBC and playing that SBC with sbcenc and sbcdec, and the exact same audio artifacts are showing themselves when I play back to my normal speaker system as through the headphones.
So, at least it's not a hardware or BT stack problem. Is this an inherent problem in SBC, or is there a way to tune the encoder to compensate? Is it possibly so that a better encoder could be written altogether?
Fredrik Tolf
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel
Fredrik
Quoted 9 lines
Quoted 2 lines
It doesn't help that we're typically decoding mp3 and reencoding in sbc. Loss is really compounded.
Indeed, that seems to be the problem. I was always under the (uninformed) impression that SBC was lossless, but I just tried re-encoding an MP3 to SBC and playing that SBC with sbcenc and sbcdec, and the exact same audio artifacts are showing themselves when I play back to my normal speaker system as through the headphones.
You haven't ruled out our implementation of sbc however. We could have problems still. Also, there are also some defaults for encoding that although set fairly high are not at the max iirc.
There is/was a reference SBC encoder that is a windows executable somewhere at bluetooth.org. Testing with it would let us rule out (or implicate) our implementation.
Quoted 4 lines
So, at least it's not a hardware or BT stack problem. Is this an inherent problem in SBC, or is there a way to tune the encoder to compensate? Is it possibly so that a better encoder could be written altogether?
The spec allows us to negotiate a different codec with the headset. SBC is the only required codec. fwiw, I've never seen a headset that accepts mp3 or others. I should modify a2play to flag these so they would be easier to spot.
Brad
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel
Brad,
Have a look at the following headset (Sonorix):
http://www.assisttechnology.co.uk/documents/Sonorix_Bluetooth_Headset-Pamphlet.pdf
It supports both SBC and MP3 codecs.
And it is BT1.2 compliant.
Mayank
Quoted 45 lines · Brad Midgley
Fredrik
Quoted 9 lines
Quoted 2 lines
It doesn't help that we're typically decoding mp3 and reencoding in sbc. Loss is really compounded.
Indeed, that seems to be the problem. I was always under the (uninformed) impression that SBC was lossless, but I just tried re-encoding an MP3 to SBC and playing that SBC with sbcenc and sbcdec, and the exact same audio artifacts are showing themselves when I play back to my normal speaker system as through the headphones.
You haven't ruled out our implementation of sbc however. We could have problems still. Also, there are also some defaults for encoding that although set fairly high are not at the max iirc.
There is/was a reference SBC encoder that is a windows executable somewhere at bluetooth.org. Testing with it would let us rule out (or implicate) our implementation.
Quoted 4 lines
So, at least it's not a hardware or BT stack problem. Is this an inherent problem in SBC, or is there a way to tune the encoder to compensate? Is it possibly so that a better encoder could be written altogether?
The spec allows us to negotiate a different codec with the headset. SBC is the only required codec. fwiw, I've never seen a headset that accepts mp3 or others. I should modify a2play to flag these so they would be easier to spot.
Brad
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel
Mayank
Nice find.
It brings up an interesting challenge. When using this headset, the driver should have access to the encoded audio so it can choose whether it's appropriate to decode the stream and then encode it in sbc or if it can pass the stream as-is to the set. I'll bet a gst bin could be constructed that would configure its elements accordingly for the input type and the headset caps.
iirc, a2play assumes the first codec reported from the set is sbc. we should test it with the sonorix if somebody here has it to make sure we handle multiple codec capabilities properly.
A bit of good news. It takes a couple of tries to get gxine to talk to my a2dp headset via the newly working plugin, but once it works the audio is very close to being in sync with the video and it is pretty solid for the duration of playing some video.
Brad
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel
Brad,
The simplest approach would be to analyse all SEPs from the sink and if we find an MP3 SEP, we can very well send the mp3 we receive from mpg123, otherwise use the SBC codec.
Actually somewhere in the command line arguments we can take an input from the user which codec does he prefer.
So if he writes something like:
a2play -c mp3
(Where -c is for the codec)
This should first try searching mp3 on the sink.
If not found, it should try SBC (which is of course mandatory and should be found)
Whereas if he writes something like:
a2play -c sbc
This will straight away connect on SBC SEP.
Mayank
Quoted 38 lines · Brad Midgley
Mayank
Quoted 1 line
http://www.assisttechnology.co.uk/documents/Sonorix_Bluetooth_Headset-Pamphlet.pdf
Nice find.
It brings up an interesting challenge. When using this headset, the driver should have access to the encoded audio so it can choose whether it's appropriate to decode the stream and then encode it in sbc or if it can pass the stream as-is to the set. I'll bet a gst bin could be constructed that would configure its elements accordingly for the input type and the headset caps.
iirc, a2play assumes the first codec reported from the set is sbc. we should test it with the sonorix if somebody here has it to make sure we handle multiple codec capabilities properly.
A bit of good news. It takes a couple of tries to get gxine to talk to my a2dp headset via the newly working plugin, but once it works the audio is very close to being in sync with the video and it is pretty solid for the duration of playing some video.
Brad
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel
Quoted 6 lines · Brad Midgley
It brings up an interesting challenge. When using this headset, the driver should have access to the encoded audio so it can choose whether it's appropriate to decode the stream and then encode it in sbc or if it can pass the stream as-is to the set. I'll bet a gst bin could be constructed that would configure its elements accordingly for the input type and the headset caps.
What about the plan to support A2DP via ALSA?
Maybe there needs to be a new kind of sound device (/dev/sound/play or something) which for typical sound hardware, does the decoding, and for A2DP can either decode or send the packets across, depending on whether it can negotiate a compatible decoder on the device. Having it work only with one library/toolkit like gstreamer is kindof limiting. And some day, I bet there will be A2DP support for even more codecs. FLAC would be awesome (but you'd need EDR I suppose).=20 So say if the device supports SBC, MP3 and FLAC, you could send MP3 directly, and encode everything else as FLAC. A player program would only need to open the /dev file and write MP3/Ogg/whatever packets to the device, after stripping off any metadata.
The ALSA A2DP driver was supposed to be in userspace anyway, right?
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel
Shawn
Quoted 6 lines
Maybe there needs to be a new kind of sound device (
/dev/sound/playor something) which for typical sound hardware, does the decoding, and for A2DP can either decode or send the packets across, depending on whether it can negotiate a compatible decoder on the device. Having it work only with one library/toolkit like gstreamer is kindof limiting.
alsa doesn't transparently provide an api like this. it's either something on top of alsa or approximated by writing a plugin for each type of codec. alsa plugins are only supposed to know about some very simple encoding audio schemes though.
ironic that you are making the case for gstreamer at the same time you say it's limiting. :)
Quoted 1 line
The ALSA A2DP driver was supposed to be in userspace anyway, right?
We have the alsa plugin mostly working now. We haven't abandoned that idea. alsa plugins are relatively simple in what they expose to the client.
i plan to keep improving the alsa plugin and get into gstreamer to get some of the more advanced stuff. i have a little picture illustrating how we tear btsco into two projects that go into these two camps.
http://bluetooth-alsa.sourceforge.net/wavez.png
Brad
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel
Quoted 12 lines · Brad Midgley
Fredrik
Quoted 9 lines
Quoted 2 lines
It doesn't help that we're typically decoding mp3 and reencoding in sbc. Loss is really compounded.
Indeed, that seems to be the problem. I was always under the (uninformed) impression that SBC was lossless, but I just tried re-encoding an MP3 to SBC and playing that SBC with sbcenc and sbcdec, and the exact same audio artifacts are showing themselves when I play back to my normal speaker system as through the headphones.
Quoted 7 lines
You haven't ruled out our implementation of sbc however. We could have problems still. Also, there are also some defaults for encoding that although set fairly high are not at the max iirc.
There is/was a reference SBC encoder that is a windows executable somewhere at bluetooth.org. Testing with it would let us rule out (or implicate) our implementation.
I have Windows in a VMware exactly for things like these, so I could test that. However, I could find no such thing on bluetooth.org. In fact, googling for "sbc site:bluetooth.org" only yielded two insignificant results, so I'm beginning to wonder if I'm doing something wrong (whatever that'd be...). Any pointers?
Quoted 4 lines
The spec allows us to negotiate a different codec with the headset. SBC is the only required codec. fwiw, I've never seen a headset that accepts mp3 or others. I should modify a2play to flag these so they would be easier to spot.
Unfortunately, that seems to be no relief in this case. a2play gets only one acp_seid_info from the headset, so I guess that means that it only supports SBC, correct?
Fredrik Tolf
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel
Fredrik
Quoted 5 lines
I have Windows in a VMware exactly for things like these, so I could test that. However, I could find no such thing on bluetooth.org. In fact, googling for "sbc site:bluetooth.org" only yielded two insignificant results, so I'm beginning to wonder if I'm doing something wrong (whatever that'd be...). Any pointers?
You can get it but you probably need to be logged into a (free) account:
https://www.bluetooth.org/foundry/adopters/document/A2DP_Bitstream/en/1/A2DP_Bitstream.zip
we can also compare with our floating point implementation which we have more faith in.
Quoted 3 lines
Unfortunately, that seems to be no relief in this case. a2play gets only one
acp_seid_infofrom the headset, so I guess that means that it only supports SBC, correct?
It wouldn't be hard to add mp3 support. We might have to know just a bit of mp3 smarts like how to break up a stream into packets appropriately. I don't think we'd ever want to encode mp3 on the fly so it's not as complex as sbc support.
Brad
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel
Quoted 11 lines · Brad Midgley
Fredrik
Quoted 5 lines
I have Windows in a VMware exactly for things like these, so I could test that. However, I could find no such thing on bluetooth.org. In fact, googling for "sbc site:bluetooth.org" only yielded two insignificant results, so I'm beginning to wonder if I'm doing something wrong (whatever that'd be...). Any pointers?
You can get it but you probably need to be logged into a (free) account:
https://www.bluetooth.org/foundry/adopters/document/A2DP_Bitstream/en/1/A2DP_Bitstream.zip
I could get it without an account. I find it rather weird that google didn't find it, but oh well.
Anyway, I tried it, and it was an *enormous* difference. It is true that the file encoded by the encoder from bluetooth.org is almost twice as large as that encoded by sbcenc as well, but nonetheless, the difference in audio quality was huge.
Quoted 2 lines
we can also compare with our floating point implementation which we have more faith in.
Is this in the CVS tree? I can't seem to find any other encoder than sbcenc. (Speaking of which, what's the difference between the "sbc" and "sbc32" directories?)
Fredrik Tolf
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel
Fredrik
Quoted 11 lines
Quoted 8 lines
Quoted 5 lines
I have Windows in a VMware exactly for things like these, so I could test that. However, I could find no such thing on bluetooth.org. In fact, googling for "sbc site:bluetooth.org" only yielded two insignificant results, so I'm beginning to wonder if I'm doing something wrong (whatever that'd be...). Any pointers?
You can get it but you probably need to be logged into a (free) account:
https://www.bluetooth.org/foundry/adopters/document/A2DP_Bitstream/en/1/A2DP_Bitstream.zip
I could get it without an account. I find it rather weird that google didn't find it, but oh well.
google won't necessarily "deep link" into sites like bluetooth.org
Quoted 4 lines
Anyway, I tried it, and it was an *enormous* difference. It is true that the file encoded by the encoder from bluetooth.org is almost twice as large as that encoded by sbcenc as well, but nonetheless, the difference in audio quality was huge.
twice as large? could be they're using 4 subbands.
maybe our defaults are too lossy. after calling sbc_init, you can change sbc.subbands (default 8), sbc.blocks (default 16), sbc.bitpool (default 32). subbands can be 4,8. blocks can be 4,8,12,16. i need to check the spec on bitpool ranges.
Quoted 6 lines
Quoted 2 lines
we can also compare with our floating point implementation which we have more faith in.
Is this in the CVS tree? I can't seem to find any other encoder than sbcenc. (Speaking of which, what's the difference between the "sbc" and "sbc32" directories?)
a lot of this will change, but for now, "sbc" has floating, 64-bit fixed, and 32-bit fixed and chooses one at compile time. you'll get floating point implementation if you configure without --enable-fixed. (heh, maybe that's what you're getting even now)
sbc32 was the precursor to separating out the library and has only the 32-bit implementation. it probably isn't even being built.
a2play "sort of" has a flag for choosing encoder settings (-t for thrifty) but it is pretty rough.
brad
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel
Hi,
Quoted 7 lines
maybe our defaults are too lossy. after calling
sbc_init, you can change
sbc.subbands (default 8), sbc.blocks (default 16), sbc.bitpool (default
32). subbands can be 4,8. blocks can be 4,8,12,16. i need to check the
spec on bitpool ranges.
I tried to change bitpool to 53 (that is reccomended value in a2dp specs for 8 subbands and 16 blocks) in pcm_a2dp. i did not hear any difference. but maybe my HP headphones are not good. The traffic did increase by some amount.
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel
Quoted 6 lines · Brad Midgley
Quoted 4 lines
Anyway, I tried it, and it was an *enormous* difference. It is true that the file encoded by the encoder from bluetooth.org is almost twice as large as that encoded by sbcenc as well, but nonetheless, the difference in audio quality was huge.
twice as large? could be they're using 4 subbands.
I don't entirely remember, but I really think it was using 8 subbands (when checking with sbcinfo).
Quoted 4 lines
maybe our defaults are too lossy. after calling
sbc_init, you can change sbc.subbands (default 8), sbc.blocks (default 16), sbc.bitpool (default 32). subbands can be 4,8. blocks can be 4,8,12,16. i need to check the spec on bitpool ranges.
Except the bitpool value, doesn't that mean that it's already using the best possible values? Or do lower values of sbc.subbands or sbc.blocks increase quality?
Quoted 1 line
(heh, maybe that's what you're getting even now)
Indeed. :)
Quoted 2 lines
a2play "sort of" has a flag for choosing encoder settings (-t for thrifty) but it is pretty rough.
Again, wouldn't that make the audio quality worse (given how the thrifty value only decreases the given values)?
Fredrik Tolf
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel
Fredrik
Quoted 3 lines
Except the bitpool value, doesn't that mean that it's already using the best possible values? Or do lower values of sbc.subbands or sbc.blocks increase quality?
iirc, changing subbands to 4 will increase the traffic and it looks computationally simpler. try it out with your problematic audio. also it isn't clear what allocation method does in terms of quality.
this is interesting at http://www.otolith.com/otolith/olt/sbc.html
"Most SBC encoders use a structure like this. First, a time-frequency mapping (a filter bank, or FFT, or something else) decomposes the input signal into subbands. The psychoacoustic model looks at these subbands as well as the original signal, and determines masking thresholds using psychoacoustic information."
We are just trying to follow the spec for our codec, so anything optional like analyzing the psychoacoustic model might as well be rocket science.
brad
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel