-
Notifications
You must be signed in to change notification settings - Fork 1.3k
USB disconnect or reset mutes sound on the computer #1609
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This is on Ubuntu, right? We should test on other OS's. |
I've been plugging/unplugging, resetting etc. ad nauseam the last few days with master+ and haven't noticed anything getting muted on my Mac (Mojave) |
Yes, more precisely Linux Mint with XFCE4. It doesn't happen on Fedora 28, also with XFCE4. |
I think that it is not keyboard — I disabled keyboard shortcuts for volume control, and it still happens. |
are they regular keyboard shortcuts or Consumer Control shortcuts? |
How do I tell? I just checked that it doesn't happen with 4.0.0-alpha.5 but does with beta.0 |
Looks like commit b5e40f5 is the problem. |
Thanks for the bisect or equivalent. That's a big commit: USB MIDI and a lot of tinyusb changes. I'll put a sniffer on the USB traffic and see what's up. |
Another thing that may be relevant: the board shows up in alsamixer in the list of sound cards. My current working theory is that Ubuntu does something weird when a sound card is disconnected — perhaps the same mechanism that switches volume when headphones are connected/disconnected. |
I wonder how hard it would be for the board not to appear as a MIDI device when |
Then it's the MIDI. USB MIDI is a subclass of audio device (from https://github.com/adafruit/circuitpython/blob/master/tools/gen_usb_descriptor.py)
We have an open issue (#1015) for dynamic USB descriptors. We could possibly conditionalize the static descriptor in the file above for now. |
I found the CPX didn't work as a keyboard when I plugged it into a school's computer. It made me wonder if there was something about the other usb devices that it was showing up as which made it block the port. It's alluded to in https://forums.adafruit.com/viewtopic.php?f=48&t=146648#p725650 I'd tweaked the CPX dice project (https://github.com/kevinjwalters/circuitpython-examples/blob/master/cpx/cpx-dice-typer.py) and it was supposed to type the numbers. Worked at home but not at the school I was volunteering at. I didn't have time to delve deeper. I might be able to revisit this but I suspect they'll be a lack of expertise on site. If there was a way to stop the CPX from ever pretending to be the other USB devices I didn't need that would have been a useful quick debugging step and potentially a solution for that environment. Maybe. |
I think this is now fixed on the system side, and we can close it. |
@deshipu What do you mean, was this a bug on the linux side of things? |
Yes, Ubuntu and derivatives would reset the sound level to zero when a new MIDI device was connected. CircuitPython devices happen to be MIDI devices. |
For some reason with the 4.0 code, even with
CIRCUITPYTHON_USB_HID=0
andCIRCUITPYTHON_USB_MIDI=0
, disconnecting or hard-resetting the board results in my sound getting muted. I tested that initially with PewPew (which is pretty much a Trinket M0), but confirmed it now with a Hallowing M0 Express.Interestingly enough, nothing is appearing in
xev
when that happens.The text was updated successfully, but these errors were encountered: