I have written a new USB driver. Master I2S to USB as ADC.
Key features are:
- Low latency: 1 ms from I2S to USB. So I2S ADC and computer side buffering are biggest causes of delays
- USB audio class 1
- Pure direct: What ever the I2S is giving, it is passed to USB. No controls to accidentally break the signal.
- DAC monitor: When Samples are going to USB, they are copied to DAC through DAOSET. (-6dB level), leaving stdaudioout for user programs.
- Modest resource requirements: I 1151, X 234, Y 172 when example stats program compiled, I 964, X 126, Y 172 without stats.
- 48kHz 16 bit
I've tested this with Win 10, Linux and Mac. Seems to work.
Code: Select all
usb 3-3: new full-speed USB device number 94 using xhci_hcd
usb 3-3: New USB device found, idVendor=19fb, idProduct=eeed
usb 3-3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
usb 3-3: Product: VS1010d Low-latency USB I2S ADC
usb 3-3: Manufacturer: VLSI Solution
I left the stats code to this driver so it is easier to debug on different circuit. This is developed on VS1010 developer board.
Code: Select all
Relocked (3007)
Ready
A: 0 l: 252 z: 0 d: 1 B1: 0 B2: 0E0 1
E0 2
E0 3
A: 0 l: 252 z: 1 d: 1 B1: 0 B2: 0E0 9
E0 11
A: 0 l: 252 z: 2 d: 1 B1: 0 B2: 0E0 13
E0 16
A: 0 l: 252 z: 2 d: 3 B1: 0 B2: 0E0 18
A: 0 l: 252 z: 26 d: 5 B1: 0 B2: 0E0 21
A: 0 l: 252 z: 34 d: 6 B1: 0 B2: 0E0 22
A: 3331 l: 252 z: 37 d: 7 B1: 1666 B2: 1665E0 23
A: 3331 l: 252 z: 37 d: 7 B1: 1666 B2: 1665E0 25
E0 28
A: 3331 l: 252 z: 39 d: 7 B1: 1666 B2: 1665E0 31
E0 34
A: 3331 l: 252 z: 40 d: 7 B1: 1666 B2: 1665E0 36
E0 38
E0 40
E0 42
A: 8805 l: 108 z: 42 d: 12 B1: 4403 B2: 4402E0 43
A: 8809 l: 252 z: 44 d: 13 B1: 4405 B2: 4404E0 44
A: 21309 l: 252 z: 53 d: 17 B1: 10655 B2: 10654E0 48
A: 27546 l: 88 z: 53 d: 18 B1: 13774 B2: 13772E0 49
A: 27713 l: 252 z: 421 d: 19 B1: 13857 B2: 13856
l: Audio buffer pointer
z: count of left and right zero value samples
d: dropped I2S samples
B1 and B2: Buffer usage count.
Lines end with E0 and number. It is count of Endpoint 0 packets.