ArmDeveloperEcosystem / microphone-library-for-pico

Capture audio from a microphone on your Raspberry Pi Pico or any RP2040 based board. 🎤
Apache License 2.0
231 stars 47 forks source link

Device cannot start error on Windows 10 #6

Closed iovsiann closed 2 years ago

iovsiann commented 2 years ago

Hi, thank you for the sample code. I tried it on Ubuntu 18.04 and Windows. While Ubuntu 18.04 finds MicNode and shows it in Audacity, the device fails to start in Windows 10.

Any advice would be much appreciated. Thank you

iovsiann commented 2 years ago

This is issue is for https://github.com/sandeepmistry/pico-microphone project

sandeepmistry commented 2 years ago

Hi @iovsiann,

I'm having issues with my Windows 10 VM, the USB microphone device is listed in the device manager with the yellow triangle. However, I do NOT see it listed in Audacity.

A few suggestions to try while I try to figure out my setup would be:

1) Port an upstream patch over https://github.com/hathach/tinyusb/pull/1058 over, you'll need to change examples/usb_microphone/usb_descriptors.c:

replace:

TUD_CONFIG_DESCRIPTOR(1, ITF_NUM_TOTAL, 0, CONFIG_TOTAL_LEN, TUSB_DESC_CONFIG_ATT_REMOTE_WAKEUP, 100),

with:

TUD_CONFIG_DESCRIPTOR(1, ITF_NUM_TOTAL, 0, CONFIG_TOTAL_LEN, 0x00, 100),

2) Try to change Audacity to record at 16,000 Hz

3) Consider reaching out to the TinyUSB team, as the USB microphone example in this project was based on the TinyUSB audio_test device example - so they may be able to provide additional guidance or insights.

sandeepmistry commented 2 years ago

@iovsiann I think I've tracked this down.

Please try out the changes proposed in https://github.com/ArmDeveloperEcosystem/microphone-library-for-pico/pull/8 and let me know how it goes.

iovsiann commented 2 years ago

@sandeepmistry, I have checked it, it works both on my Windows laptop (Skype, Audacity) and Ubuntu desktop (Audacity) - I used your code in the pull request without any changes. Everything, including Audacity, worked "out of the box" - I didn't have to tweak Audacity mic sampling rate. Many thanks for the fix!