Re: [Bluez-devel] AVDTP socket?

Marcel Holtmann
2004-11-17T20:01:56Z

Hi Brad,

> > struct sbc_frame_header {
> > uint8_t syncword:8; /* Sync word */
> > uint8_t subbands:1; /* Subbands */
> > uint8_t allocation_method:1; /* Allocation method */
> > uint8_t channel_mode:2; /* Channel mode */
> > uint8_t blocks:2; /* Blocks */
> > uint8_t sampling_frequency:2; /* Sampling frequency */
> > uint8_t bitpool:8; /* Bitpool */
> > uint8_t crc_check:8; /* CRC check */
> > } __attribute__ ((packed));
>
> I tried reading this from the header but I get nonsensical results like
> "3" for frequency. Only one bit is supposed to be specified in fields
> like frequency, so the headset (rightly) rejects the set_config.

I think you have to convert it first. I don't know why the SBC example
files have this header. From my sniffs of the AVDTP media channel I
haven't seen this header data anywhere. So it is somekind of SBC file
format. Try this conversion:

static char *sf2str(uint8_t sf)
{
switch (sf) {
case 0:
return "16 kHz";
case 1:
return "32 kHz";
case 2:
return "44.1 kHz";
case 3:
return "48 kHz";
}
}

static char *cm2str(uint8_t cm)
{
switch (cm) {
case 0:
return "Mono";
case 1:
return "Dual channel";
case 2:
return "Stereo";
case 3:
return "Joint stereo";
}
}

Regards