Glitches in playing audio with xCORE200 UAC1.0

If you have a simple question and just want an answer.
Post Reply
uthrakumar
New User
Posts: 3
Joined: Thu Jul 14, 2016 8:35 pm

Glitches in playing audio with xCORE200 UAC1.0

Post by uthrakumar »

Hi All,

We have used the example code "app_usb_aud_xk_216_mc" in the software bundle "sw_usb_audio-[sw]_6.15.2rc1" with build configuration of "1i2o2xxxxxx"

Now the device is enumerated as UAC 1.0 device and we are able to play an audio through it.

The problem we are seeing is we are seeing glitches [like missing data in the output sine wave] in the audio. When we probed further we have the below details.

1. The number of samples sent from USB is same as number of samples sent out in I2S
2. The frequency of audio sine wave played is same as what we are sending from PC
3. There is no Packet drops in USB transfer [ Monitored using device monitoring studio ]

We suspect it could be a problem with the data/pointer manipulation of the circular buffer which handles the audio data received from USB.

Please let us know if anybody had faced this issue or if you have any inputs on this.

Any help on this to resolve the issue will be helpful for us.

Thanks in advance.

Note : We had to edit the audio OUT endpoint descriptor to be able to play the audio successfully.
In file descrptors.h --> "cfgDesc_Audio1[]" Line Number:2530 to 2542

Updated Descriptor snippet
/* Standard AS Isochronous Audio Data Endpoint Descriptor 4.6.1.1 */
0x09,
0x05, /* ENDPOINT */
ENDPOINT_ADDRESS_OUT_AUDIO,
0x05, /* attributes - isochronous async */
(FS_STREAM_FORMAT_OUTPUT_1_MAXPACKETSIZE&0xff), /* 4 wMaxPacketSize (Typically 294 bytes)*/
(FS_STREAM_FORMAT_OUTPUT_1_MAXPACKETSIZE&0xff00)>>8, /* 5 wMaxPacketSize */
0x01, /* bInterval */
0x00, /* bRefresh */
0x00,


Thanks
Uthrakumar


User avatar
larry
Respected Member
Posts: 275
Joined: Fri Mar 12, 2010 6:03 pm

Post by larry »

Have you tried another host, Windows or Mac? Are class 2 configurations such as 2i10o10xxxxxx working ok? Are there any glitches in the input direction (host recording)?
User avatar
infiniteimprobability
XCore Legend
Posts: 1126
Joined: Thu May 27, 2010 10:08 am
Contact:

Post by infiniteimprobability »

The problem we are seeing is we are seeing glitches [like missing data in the output sine wave] in the audio. When we probed further we have the below details.

1. The number of samples sent from USB is same as number of samples sent out in I2S
2. The frequency of audio sine wave played is same as what we are sending from PC
3. There is no Packet drops in USB transfer [ Monitored using device monitoring studio ]
I don't 100% get this - how can there be missing data if the number of samples sent/received is the same? Do you mean zeroed data?

Sorry for even more questions - the reason for them is that the core buffering code has been stable for many years over hundreds of USB audio projects with lots of long term soak testing passes. It's possible there could be a bug in there, but I'd recommend looking elsewhere first. Ie. no known issues in the buffering.

The answers to Larry's questions will help provide some good data to get to the bottom of this.
User avatar
Ross
XCore Expert
Posts: 962
Joined: Thu Dec 10, 2009 9:20 pm
Location: Bristol, UK

Post by Ross »

If i'm reading your code correctly you seem to have set bSyncAddress to 0.

The address of the endpoint used to communicate synchronization information if required by this endpoint. Reset to zero if no synchronization pipe is used.
Seems like a bad idea to me..
ffomich
Experienced Member
Posts: 119
Joined: Mon Sep 15, 2014 1:32 pm

Post by ffomich »

Hi uthrakumar,

do you have glitches in playback audio in all device format (24bit/16bit + 44100Hz/48000Hz)?

I have self-made board based on xCORE200 and I use software reference design sw_usb_audio-[sw]_6.15.2rc1 also with some modifications.

For my board I built 2 firmware images with configuration 1i2o2xxxxxx - UAC1, Analog Out, Analog IN
1. 16bit/44100Hz, 16bit/48000Hz
2. 24bit/44100Hz, 24bit/48000Hz

For test playback audio I connect my board to PC Win7 x64 Pro. Headphones are connected to Analog outputs directly.
Mouse right-click on "Dynamics" icon, open "Playback devices" list,
mouse right-click on my device - "Properties" - tab "Additional",
select Format from list, press "Check" button.

I hear crackling in sound only in format 24/44100. In other 3 formats output sound is clear.

Can you check it on your xCORE200 board with original firmware?
ffomich
Experienced Member
Posts: 119
Joined: Mon Sep 15, 2014 1:32 pm

Post by ffomich »

Hi XCore Experts

This is interesting:
I built the same firmware images (see my previous post) for older XMOS board XR-USB-AUDIO-MC-2.0 1V2.

There is no any crackling in all formats.
Post Reply