-
-
Notifications
You must be signed in to change notification settings - Fork 213
Open
Description
Trying this example:
#include "PluggableUSBAudio.h"
USBAudio audio(true, 44100, 2, 44100, 2);
static uint8_t buf[128];
void setup() {
for (int i = 0; i<sizeof(buf); i++) {
buf[i] = 128 * sin(i);
}
}
void loop() {
audio.write(buf, sizeof(buf));
}
Compiles without error but the Pico continues to enumerate as a USB Serial device, not as Mbed Audio.
Thanks,
Bob
Metadata
Metadata
Assignees
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
facchinm commentedon Sep 5, 2022
Hi @w9ran ,
it should enumerate as a composite device with both the Serial (CDC) functionality and the USBAudio one.
On Windows, a new driver scan should be automatically started thanks to 301d69d and you should see the new audio interface without any further intervention.
If it's not the case let me know and I'll try to reproduce the issue.
w9ran commentedon Sep 6, 2022
Thanks for your reply and suggestion. I did prove that the Pico is sending audio via USB in Linux, so it's a Windows issue.
I deleted all Pico containers and attached the Pico afresh so Windows did the usual "setting up new device" routine. This resulted in three Pico entries in device manager, all identical and with the same "Code 10 - cannot start" error:
I tried updating the driver but Windows said the best driver was installed (USB Audio) - here is are the details:
I then tried disabling/re-enabling the device which produced a message "Device is enabled but still not working".
Adding a print statement to the main loop proved that during all the above the COM port remained connected and working.
I hope this helps to identify what's going on as having a composite serial/USBAudio device will be very nice.
Bob
facchinm commentedon Sep 6, 2022
This page https://docs.microsoft.com/en-us/answers/questions/549388/windows10-usb-problem-0xc0000182-audio-vcom-compos.html might be explaining the issue but no solution is provided unfortunately 😞
w9ran commentedon Sep 7, 2022
Yes, the "updates" suggested there were from 2017.
I can only add this: In Linux, the Pico presents itself as an audio device just fine, i.e. arecord -l:
card 2: Pico [RaspberryPi Pico], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0
But when I attach the Pico in /dev I see /dev/ttyACM0 rather than something like /dev/ttyUSB0 that I was expecting. Apparently this is normal and I don't see how it could be affecting USBAudio on Windows since it sees the COM Port OK, but thought I'd mention it.
Bob
MNS26 commentedon Sep 8, 2022
@w9ran have you tried using tinyusb? It also has a template for usb descriptors (aka how a OS sees the device)
i personally havent tried/looked into it with audio yet but im using it to make a gamepad with 10 axis 3 hats and a unholy amount of buttons
i used the tinyusb library from adafruit for it
MNS26 commentedon Sep 8, 2022
also /dev/ttyACM is a linux serial modem whereas /dev/ttyUSB0 is your generic usb to serial chip (from my understanding)
Gerriko commentedon Sep 13, 2022
I'm throwing this in the pot as a guess, as I suspect Windows is seeking out a parameter to inform it that you've just inserted a composite device rather than a single USB device type. I know you can define some USB settings inside code, such as vendor id etc. but no idea what can be done here.
https://docs.microsoft.com/en-us/windows-hardware/drivers/usbcon/register-a-composite-driver
je1rav commentedon May 26, 2023
The reason why not working on Windows seems to be the lack of IAD descriptor in USBAudio.cpp.
By adding the IAD descriptor, It becomes working on Windows too.
w9ran commentedon Aug 14, 2023
je1rav - that's great news! I just looked at this thread after nearly a year and was pleased to find your comment - but I'm not enough of a USB expert to know exactly how to make the change to add the IAD descriptor. Could you perhaps post a snippet or the entire modified USBAudio.cpp file?
Thanks!
Bob
je1rav commentedon Aug 17, 2023
je1rav commentedon Aug 17, 2023
Dear Bob,
The above address was wrong.
The correct address is https://github.com/je1rav/QP-7C_RP2040_CAT_Arduino
Hitoshi