Discussion Forum

BitResolution

Next Thread | Thread List | Previous Thread Start a Thread | Settings

DetailsMessage
Author
Mike pisces
Posted
6-Jan-2012 07:40 GMT
Toolset
ARM
New! BitResolution

Hello:)

I would like to know how to change the bitresoultion to 8 bits for the keil usb audio descriptors

I have tried to change bSubFrameSize to 0x01 bBitResolution to 8 then WBVAL to 34 and I get bsod error on computer and it does not work I am running winxp.

I would like to run the usb speaker at 8bit resolution and 32000khz could you please help me make the changes to the descriptors


/* Audio Type I Format */
  AUDIO_FORMAT_TYPE_I_DESC_SZ(1),       /* bLength */
  AUDIO_INTERFACE_DESCRIPTOR_TYPE,      /* bDescriptorType */
  AUDIO_STREAMING_FORMAT_TYPE,          /* bDescriptorSubtype */
  AUDIO_FORMAT_TYPE_I,                  /* bFormatType */
  0x01,                                 /* bNrChannels */
  0x02,                                 /* bSubFrameSize */
  16,                                   /* bBitResolution */
  0x01,                                 /* bSamFreqType */
  B3VAL(32000),                         /* tSamFreq */
/* Endpoint - Standard Descriptor */
  AUDIO_STANDARD_ENDPOINT_DESC_SIZE,    /* bLength */
  USB_ENDPOINT_DESCRIPTOR_TYPE,         /* bDescriptorType */
  USB_ENDPOINT_OUT(3),                  /* bEndpointAddress */
  USB_ENDPOINT_TYPE_ISOCHRONOUS,        /* bmAttributes */
  WBVAL(64),                            /* wMaxPacketSize */
  0x01,                                 /* bInterval */
  0x00,                                 /* bRefresh */
  0x00,                                 /* bSynchAddress */
/* Audio Definitions */
#define DATA_FREQ 32000                 /* Audio Data Frequency */
#define P_S       32                    /* Packet Size */
#if USB_DMA
#define P_C       4                     /* Packet Count */
#else
#define P_C       1                     /* Packet Count */
#endif
#define B_S       (8*P_C*P_S)           /* Buffer Size */

thanks Mike pisces.

Author
Mike pisces
Posted
6-Jan-2012 22:53 GMT
Toolset
ARM
New! RE: BitResolution

I was told to do it like this 1 * 1 *(32 + 1) 34 and we made changes so any value could be enter instead of just number of power of 2 2,4,6,8,16,32,64

Author
Dan Henry
Posted
7-Jan-2012 01:30 GMT
Toolset
ARM
New! RE: BitResolution

X-posted:

http://www.microchip.com/forums/fb.ashx?m=625131

Author
Tsuneo Chinzei
Posted
7-Jan-2012 19:16 GMT
Toolset
ARM
New! RE: BitResolution

OK, we back from Microchip forum. :-)
What is your MCU, and dev board?
Also, which Keil example are you working on?

Tsuneo

Author
Mike pisces
Posted
8-Jan-2012 03:42 GMT
Toolset
ARM
New! RE: BitResolution

It's this BlueBoard-LPC1768-H but nobody posts on that forum but it is keil code and uvision is used

It's this usbaudio sample code

http://www.standardics.nxp.com/support/documents/microcontrollers/zip/code.bundle.lpc17xx.keil.zip

Do you know what is happing? why I have to change to 10bit for it to even work? am I getting Quantization error, do I need a 8bit timer?

with you saying

PCM (0x0001) means 2's complementary binary data

it made me think of bSubFrameSize or

0x02,       // bLockDelayUnits (Decoded PCM Samples)

0x00,    // wLockDelay (LSB) (512 Decoded PCM Samples)

0x02,    // wLockDelay (MSB)


anything to do with

USB_MAX_PACKET0     64--- should be 32 maybe?

it can't read the samples properly? Timer 0 is 32bit?

--------------

it's not the execution time???

Timer Counter 0 Interrupt Service Routine
 *   executed each 31.25us (32kHz frequency)

It is possible to do this right and get nice audio at 8bits?

Author
Mike pisces
Posted
8-Jan-2012 03:57 GMT
Toolset
ARM
New! RE: BitResolution

I just thought, I would of thought most audio on pc is 16bit do I need to convert to 8bits, like including a lossless compression method in my code or is that built into windows usb drivers. Because it manages to play 16bit audio so it seems strange it cannot do the same for 8bit without needing anything extra?

Author
Mike pisces
Posted
8-Jan-2012 05:51 GMT
Toolset
ARM
New! RE: BitResolution

Tsuneo Chinzei, do you have a email account So I can talk about some other stuff private with you;)

Author
Mike pisces
Posted
12-Jan-2012 08:06 GMT
Toolset
ARM
New! RE: BitResolution

It would help if you explain what needs to be done in the code to make16bit resolution then I may understand what needs to be done to 8bit. I did not write these example myself, how can you possible except me to know these things.

I am not a student I can't ask teacher.

PCM (0x0001) means 2's complementary binary data.
PCM8 (0x0002) means offset binary data.

Author
Charlie Duncan
Posted
1-Feb-2012 16:54 GMT
Toolset
ARM
New! RE: BitResolution

OK, we back from Microchip forum. :-)
What is your MCU, and dev board?
Also, which Keil example are you working on?

Tsuneo

Hi I have the MCB1700 board and would be interested in how to do this please.

Charlie

Next Thread | Thread List | Previous Thread Start a Thread | Settings