All of lore.kernel.org
 help / color / mirror / Atom feed
* [Bluez-devel] Comments about the Logitech/HP stereo headphones
@ 2005-04-24 12:18 Marcel Holtmann
  2005-04-24 13:47 ` Guylhem Aznar
  2005-04-24 14:04 ` Brad Midgley
  0 siblings, 2 replies; 22+ messages in thread
From: Marcel Holtmann @ 2005-04-24 12:18 UTC (permalink / raw)
  To: BlueZ Mailing List

Hi Folks,

since the progress on the A2DP support stalled and because the problems
with the Logitech/HP headphones still exists, I thought that it is time
to buy one of these by myself. I now have the Aiptek, Bluewalker and the
HP headphones at home for testing. The first two are GCT based and the
last one is Zeevo based.

All GCT based headphones are working fine and they have the nice SBC
over RFCOMM support for testing. They are not picky about any timing
related transfers and they cache the SBC stream. To deal with the Zeevo
based headphones you can only talk AVDTP and you need to get the timing
right. Otherwise the sound is messed up.

So what I have done so far is that I extended the pcm_a2dp ALSA plugin
in the utils CVS repository with the ability to cache the connection.
This is needed, because players like xmms and bmp close the PCM every
time they change the track. If we close the AVDTP channel it results
into closing the ACL link and this is not what we want. The only problem
at the moment is that this plugin only supports SBC over RFCOMM and it
doesn't care about the timing. This means that if you change a track it
can take 1 or 2 seconds before the headphones reacts, because parts are
already cached. This is a problem (or feature) of the GCT based devices.

To fully support all A2DP headphones (including Logitech/HP) this plugin
needs a AVDTP implementation. I have a hacked one on my development
system and it works fine with the GCT headphones. The code is a little
bit messy, but in general it works. It is fully event driven and so it
deprecates the idea of the AVDTP library. It is a lot easier to do it
directly inside the plugin. I need to cleanup the code and submit it to
the CVS when there is a little bit more time.

I also got first results with the HP headphone by adding an usleep(2500)
for every SBC frame. It is also needed to pack as most SBC frames into
an AVDTP frame as possible. In my case this was up to eight. So this is
all about the timing. The perfect thing now would be if we can tell ALSA
to time everything for us. Problem is that I am not an audio expert and
also not an ALSA expert. Maybe the SBC encoder should return/store the
time the SBC frame is encoded for.

Comments? Ideas?

And btw for testing the pcm_a2dp plugin you need ALSA 1.0.9-rc2 and
an .asoundrc config file like this:

	pcm.bluewalker {
	        type a2dp
	        bdaddr "00:0B:0D:xx:xx:xx"
	}

Regards

Marcel




-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 22+ messages in thread
* Re: [Bluez-devel] Comments about the Logitech/HP stereo headphones
@ 2005-04-24 15:16 Mayank Batra
  2005-04-24 15:35 ` Marcel Holtmann
  0 siblings, 1 reply; 22+ messages in thread
From: Mayank Batra @ 2005-04-24 15:16 UTC (permalink / raw)
  To: bluez-devel

> (A question first - did you add the usleep to Mayank
> code? I'll then
> take it and try to optimise it for ARM. Last time I
> just made it
> barely compile :-)

It was me who added the usleep to the a2play code.
this was after trying various parameters to the usleep
while I was testing my code with BlueSoleil. And the
number that I got is the one which gives the best
sound output for almost all music files. 
 
Mayank

________________________________________________________________________
Yahoo! India Matrimony: Find your life partner online
Go to: http://yahoo.shaadi.com/india-matrimony


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 22+ messages in thread
* Re: [Bluez-devel] Comments about the Logitech/HP stereo headphones
@ 2005-04-26 12:46 Mayank Batra
  2005-04-26 13:28 ` Marcel Holtmann
  0 siblings, 1 reply; 22+ messages in thread
From: Mayank Batra @ 2005-04-26 12:46 UTC (permalink / raw)
  To: bluez-devel

Marcel,

> I haven't noticed that you also played with adding
> usleep(). I only
> tried a2play once on a Logitech headphone and it was
> terrible. However
> this can be the final solution and we need an exact
> timing source for
> proper A2DP support.


But, this is not a very good approach. Also, it will
depend on the kind of sink. for example some sinks
have buffers. Also we do not know what the buffer size
is.

But this may just be the solution since we can always
leave some buffer space of the sink empty, but we
can't afford to overflow it, else the speed
automatically increases about 5 times !

And will the parameter to usleep be a constant ?

Another point that i wanted to share is that before
adding the sbc encoding in the a2play code i had to
put  usleep(10000).
But once i included the sbc encoding, it came down to
usleep(30).
So, as Henryk said, sbc encoding should be there in
the a2play code rather than as a separate application.

Mayank 

Mayank Batra


Whether you think you can or whether you think you can't, you are right. -Henry Ford.

________________________________________________________________________
Yahoo! India Matrimony: Find your life partner online
Go to: http://yahoo.shaadi.com/india-matrimony


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 22+ messages in thread
* Re: [Bluez-devel] Comments about the Logitech/HP stereo headphones
@ 2005-04-28 12:10 Mayank Batra
  2005-04-29  9:51 ` Marcel Holtmann
  0 siblings, 1 reply; 22+ messages in thread
From: Mayank Batra @ 2005-04-28 12:10 UTC (permalink / raw)
  To: bluez-devel

Marcel,

> Maybe we should change the SBC encoding routines so
> that it times how
> long it needed to encode the resulting SBC frame.
> Together with the
> known time of the PCM data the SBC frame is encoded
> for, we can
> calculate the actual time for the usleep() in
> a2play.

I think this is the best idea. But again some timing
mismatch is bound to take place because of different
CPU speeds. For instance the CPU on which we calculate
the time taken for the encoding, may be different on
which we are running our a2play application...


Mayank

________________________________________________________________________
Yahoo! India Matrimony: Find your life partner online
Go to: http://yahoo.shaadi.com/india-matrimony


-------------------------------------------------------
SF.Net email is sponsored by: Tell us your software development plans!
Take this survey and enter to win a one-year sub to SourceForge.net
Plus IDC's 2005 look-ahead and a copy of this survey
Click here to start!  http://www.idcswdc.com/cgi-bin/survey?id=105hix
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

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

end of thread, other threads:[~2005-04-29  9:51 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-04-24 12:18 [Bluez-devel] Comments about the Logitech/HP stereo headphones Marcel Holtmann
2005-04-24 13:47 ` Guylhem Aznar
2005-04-24 14:28   ` Brad Midgley
2005-04-24 15:23     ` Marcel Holtmann
2005-04-24 15:16   ` Marcel Holtmann
2005-04-24 17:11     ` Guylhem Aznar
2005-04-24 18:09       ` Marcel Holtmann
2005-04-24 20:28       ` Brad Midgley
2005-04-24 16:19   ` Henryk Plötz
2005-04-24 16:48     ` Guylhem Aznar
2005-04-24 18:15       ` Marcel Holtmann
2005-04-24 18:12     ` Marcel Holtmann
2005-04-24 14:04 ` Brad Midgley
2005-04-24 14:34   ` Brad Midgley
2005-04-24 15:30   ` Marcel Holtmann
2005-04-25 17:39     ` Brad Midgley
  -- strict thread matches above, loose matches on Subject: below --
2005-04-24 15:16 Mayank Batra
2005-04-24 15:35 ` Marcel Holtmann
2005-04-26 12:46 Mayank Batra
2005-04-26 13:28 ` Marcel Holtmann
2005-04-28 12:10 Mayank Batra
2005-04-29  9:51 ` Marcel Holtmann

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.