2005-03-25 05:00:10

by Brad Midgley

[permalink] [raw]
Subject: [Bluez-devel] a2dp timing

Hi

We've had problems with a2dp timing that I've been ignoring.

For one, a2play crams frames into the headset just as fast as it can.
Sometimes this is too fast. So we need to clock it so things are
staggered properly. Does the SBC encoder give us a clue about timing
between frames?

Second, if the headset wanders out of range, the player stops and starts
up where it left off when the headset is back. If we're pacing things
properly, we need to drop frames instead when this happens. I'm thinking
if it results in a legal SBC stream that I'll drop entire SBC frames in
the main loop with something like:

frame_len = read_header(fd, &sbc_info);
bytes_read = read(fd, killbuffer, frame_len);

Are there other timing issues I need to think about? Does it get so
messy that I need to watch jitter? I can only vaguely remember this
stuff from my networking classes...

Brad


-------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel


2005-03-25 18:14:33

by Brad Midgley

[permalink] [raw]
Subject: btlog anyone? Re: [Bluez-devel] a2dp timing

Guylhem

I suspect this is a dead end, but maybe someone on the list has access
to btlog to sniff the traffic headed out the pocketpc:

http://66.45.42.84/Support/bTW_CE_faq.asp
http://66.45.42.84/Support/btw_ce_DK_index.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wcecomm5/html/wce50howHowToCaptureLogDataUsingBTLogTool.asp

Brad

> On Friday, 25 March 2005 at 15:26:12 (+0100), Marcel Holtmann wrote:
>
>>>However I don't have the bluesoleil stack....
>>
>>do you have the Frontline FTS4BT or the CATC Merlin II sniffer?
>
>
> Looks like it's dedicated hardware - nope. I though some software
> sniffing was possible (ala tcpdump with hcidump)
>


-------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

2005-03-25 17:31:35

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [Bluez-devel] a2dp timing

Hi Brad,

> > In the case of an ALSA plugin, we may simple use the timing of the ALSA
> > system itself. However it would be great if the SBC encoder would also
> > calculate the time of the PCM fragment.
>
> ok, I will look at the plugin again. I was discouraged before by the
> complexity and by the fact that a lot of alsa clients won't let you
> choose a userspace plugin device (and even with those that do, you have
> to remember and type in an alsa device name to reach a userspace plugin)

the flag for that is there, but the ALSA core does not use it. Seems
like I need to remind Takashi to add it.

> >> frame_len = read_header(fd, &sbc_info);
> >> bytes_read = read(fd, killbuffer, frame_len);
> >
> > And then you need to sleep some time before reading/dropping the next
> > SBC frame.
>
> of course from the plugin, these won't be read() calls, they will be
> calls into the sbc lib.

In case of the plugin you can simply drop the PCM fragment.

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
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

2005-03-25 17:28:13

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [Bluez-devel] a2dp timing

Hi Guylhem,

> > > However I don't have the bluesoleil stack....
> >
> > do you have the Frontline FTS4BT or the CATC Merlin II sniffer?
>
> Looks like it's dedicated hardware - nope. I though some software
> sniffing was possible (ala tcpdump with hcidump)

not for air sniffing and that is what you actually need in this case.

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
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

2005-03-25 17:23:38

by Guylhem Aznar

[permalink] [raw]
Subject: Re: [Bluez-devel] a2dp timing

On Friday, 25 March 2005 at 15:26:12 (+0100), Marcel Holtmann wrote:
> > However I don't have the bluesoleil stack....
>=20
> do you have the Frontline FTS4BT or the CATC Merlin II sniffer?

Looks like it's dedicated hardware - nope. I though some software
sniffing was possible (ala tcpdump with hcidump)

--=20
Bien =E0 vous - Best regards,
Guylhem P. Aznar

--=20
*@externe.net http://externe.n=
et
P=E9rim=E9/Deprecated: @oeil.qc.ca, @metalab.unc.edu, @ibiblio.org, @7=
un.org
GPG: 92EB37C1 DD11C9C9 20519D01 E8FA1B11 42975AF7 http://externe.net/pubk=
ey


-------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

2005-03-25 16:44:11

by Brad Midgley

[permalink] [raw]
Subject: Re: [Bluez-devel] a2dp timing

Marcel

> In the case of an ALSA plugin, we may simple use the timing of the ALSA
> system itself. However it would be great if the SBC encoder would also
> calculate the time of the PCM fragment.

ok, I will look at the plugin again. I was discouraged before by the
complexity and by the fact that a lot of alsa clients won't let you
choose a userspace plugin device (and even with those that do, you have
to remember and type in an alsa device name to reach a userspace plugin)

>> frame_len = read_header(fd, &sbc_info);
>> bytes_read = read(fd, killbuffer, frame_len);
>
> And then you need to sleep some time before reading/dropping the next
> SBC frame.

of course from the plugin, these won't be read() calls, they will be
calls into the sbc lib.

brad


-------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

2005-03-25 14:26:12

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [Bluez-devel] a2dp timing

Hi Guylhem,

> > it would be really great to get a FTS or CATC trace from the HP
> > headphone and the iPAQ for example.
>
> Please tell me how to do it. I will be happy to help.
> However I don't have the bluesoleil stack....

do you have the Frontline FTS4BT or the CATC Merlin II sniffer?

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
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

2005-03-25 14:22:41

by Guylhem Aznar

[permalink] [raw]
Subject: Re: [Bluez-devel] a2dp timing

On Friday, 25 March 2005 at 14:14:36 (+0100), Marcel Holtmann wrote:
> it would be really great to get a FTS or CATC trace from the HP
> headphone and the iPAQ for example.

Please tell me how to do it. I will be happy to help.
However I don't have the bluesoleil stack....

--=20
Bien =E0 vous - Best regards,
Guylhem P. Aznar

--=20
*@externe.net http://externe.n=
et
P=E9rim=E9/Deprecated: @oeil.qc.ca, @metalab.unc.edu, @ibiblio.org, @7=
un.org
GPG: 92EB37C1 DD11C9C9 20519D01 E8FA1B11 42975AF7 http://externe.net/pubk=
ey


-------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

2005-03-25 13:14:36

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [Bluez-devel] a2dp timing

Hi Brad,

> We've had problems with a2dp timing that I've been ignoring.
>
> For one, a2play crams frames into the headset just as fast as it can.
> Sometimes this is too fast. So we need to clock it so things are
> staggered properly. Does the SBC encoder give us a clue about timing
> between frames?

it would be really great to get a FTS or CATC trace from the HP
headphone and the iPAQ for example.

In the case of an ALSA plugin, we may simple use the timing of the ALSA
system itself. However it would be great if the SBC encoder would also
calculate the time of the PCM fragment.

> Second, if the headset wanders out of range, the player stops and starts
> up where it left off when the headset is back. If we're pacing things
> properly, we need to drop frames instead when this happens. I'm thinking
> if it results in a legal SBC stream that I'll drop entire SBC frames in
> the main loop with something like:
>
> frame_len = read_header(fd, &sbc_info);
> bytes_read = read(fd, killbuffer, frame_len);

And then you need to sleep some time before reading/dropping the next
SBC frame.

> Are there other timing issues I need to think about? Does it get so
> messy that I need to watch jitter? I can only vaguely remember this
> stuff from my networking classes...

I don't think that this will be needed, but we will see.

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
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

2005-04-16 20:32:49

by Henryk Plötz

[permalink] [raw]
Subject: Re: [Bluez-devel] a2dp timing

Moin,

Am Fri, 15 Apr 2005 10:41:46 +0100 (BST) schrieb Mayank Batra:

> negotiate the avdtp protocol. The connection is
> working alright. The problem is just the sound
> quality.

I'd be very interested in helping with this code, too. And I also still
have the audio dongle from my headset, so I could test with that.

--
Henryk Pl?tz
Gr??e aus Berlin
~~~~~~~ Un-CDs, nein danke! http://www.heise.de/ct/cd-register/ ~~~~~~~
~ Help Microsoft fight software piracy: Give Linux to a friend today! ~


Attachments:
(No filename) (499.00 B)
(No filename) (189.00 B)
Download all attachments

2005-04-15 09:41:46

by Mayank Batra

[permalink] [raw]
Subject: Re: [Bluez-devel] a2dp timing

Brad,

> do you have a helper app like a2play that negotiates
> the avdtp protocol?

Yes I am using a2play application as well as a Windows
application BlueSoleil by IVT Corporation to
negotiate the avdtp protocol. The connection is
working alright. The problem is just the sound
quality.


> i would like to, yes. if you're willing to make it
> GPL, can you send the
> source to me directly and i'll put it in cvs?

I am not sure right now about the GPL part.
Will tell you in a few days.


> are you using a2play or one of the dongles to test
> your sink? i don't
> have access to a dongle any more.

I am using dongles. :-(



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
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

2005-04-14 08:17:22

by Brad Midgley

[permalink] [raw]
Subject: Re: [Bluez-devel] a2dp timing

Mayank,

do you have a helper app like a2play that negotiates the avdtp protocol?

i would like to, yes. if you're willing to make it GPL, can you send the
source to me directly and i'll put it in cvs?

are you using a2play or one of the dongles to test your sink? i don't
have access to a dongle any more.

brad

Mayank Batra wrote:
> Hi Brad,
>
>
>>I suppose we could implement a2dp sink as well, but
>>I don't think
>>connections can be initiated by a sink--it has to
>>listen for the source
>>to make the connection.
>
>
> I am working on the A2DP sink. Ofcourse the connection
> has to be initiated by the source.
> Right now the sound quality is not good.
> Can you help me out in improving the sound quality ?
>
> 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
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/bluez-devel


-------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

2005-04-14 08:04:51

by Mayank Batra

[permalink] [raw]
Subject: Re: [Bluez-devel] a2dp timing

Hi Brad,

> I suppose we could implement a2dp sink as well, but
> I don't think
> connections can be initiated by a sink--it has to
> listen for the source
> to make the connection.

I am working on the A2DP sink. Ofcourse the connection
has to be initiated by the source.
Right now the sound quality is not good.
Can you help me out in improving the sound quality ?

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
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

2005-04-05 15:12:42

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [Bluez-devel] a2dp timing

Hi Brad,

> FYI, I found alsa-lib post-1.0.8 has fixed up the plugin api so plugins
> really can be built standalone. The plugins were moved to a different
> cvs project "alsa-plugins" and the api changed in the process.

I know and actually the utils CVS already contains a plugin for SBC over
RFCOMM. Was a simple proof-of-concept thing.

> On a more pragmatic note, I sold my bluetake to a friend so it won't be
> as easy to try things on it. I bought one of the iTech sets so hopefully
> development can go well with the new headset.

I think we really need the Logitech/HP headphone for further development
and so if anyone wants to support this, do a PayPal donation and then I
will buy one for Brad and me.

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
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

2005-04-04 17:14:17

by Brad Midgley

[permalink] [raw]
Subject: Re: [Bluez-devel] a2dp timing

Marcel

FYI, I found alsa-lib post-1.0.8 has fixed up the plugin api so plugins
really can be built standalone. The plugins were moved to a different
cvs project "alsa-plugins" and the api changed in the process.

I changed our reference plugin to be based on the new oss plugin. I will
work on the a2dp source side of things here. It looks much more
straightforward now.

I suppose we could implement a2dp sink as well, but I don't think
connections can be initiated by a sink--it has to listen for the source
to make the connection.

I'm keeping the cvs code up to date in case anyone wants to look (in
btsco/bt)

On a more pragmatic note, I sold my bluetake to a friend so it won't be
as easy to try things on it. I bought one of the iTech sets so hopefully
development can go well with the new headset.

Brad


-------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel