Investigating usb lost packets on XS1-L1
I want to investigate if any usb packets are lost while playing audio, using a USB Audio 2.0 (2-channel) Ref. Design.
Raspberry Pi is an example platform where packet loss occurred during playback due to usb problems. Others report bad cables to be a cause of concern.
Is there a way to identify&count packet loss from the xmos side?
I was looking in
Audiostream.xc and usb_buffer.xc
But I’m not sure how to do the trick
Something like:
if (next packet is not crc correct) , packet is dropped, increment lost_packet count.
If (did not receive a packet in X time while playing audio), increment lost_packet
Or something different:
If (1 i2s_packet TO 100 i2s_packets) are not transmitted
Count it as packet loss
Else we may be paused/muted.
Feeling I’m lost looking at lots of code, so any ideas welcome :-)
Any other ideas? How would you implement an audio packet loss counter?
Seems to me a good idea to be able to count such events, which result in audio quality issues.
Investigating usb lost packets on XS1-L1
-
- Junior Member
- Posts: 5
- Joined: Sat Jun 21, 2014 10:15 am
-
Verified
- XCore Legend
- Posts: 1163
- Joined: Thu Dec 10, 2009 9:20 pm
- Location: Bristol, UK
Assuming a good hardware platform (you are using an XMOS board so this should not be an issue!) I would rarely expect to see a USB issue. The XMOS design actually doesn't check the CRC of the audio packets - we made the decision that is better to play a single bit error that to drop a whole packet (24 samples @ 192kHz)