Repository navigation
usb.host.audio: say when a hub has no bus time left for a stream - #747
Merged
Merged
Conversation
A full-speed audio device behind a high-speed hub shares the hub's
transaction translator with every other periodic stream on it. When the
host refuses a stream that wouldn't fit (ENOSPC), Speaker and Microphone
now raise that errno with a message saying so, rather than the generic
claim-refused advice to start the host with classes=("uac",).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When a full-speed audio device sits behind a high-speed hub, every periodic stream on that hub shares the hub's transaction translator. A host that budgets the translator refuses a stream that wouldn't fit with ENOSPC. Until now
Speaker.start()andMicrophone.start()turned that into the generic "the interface claim was refused" message, with advice aboutclasses=("uac",)that doesn't apply. They now raiseOSErrorwith errno 28 and say the hub has no bus time left, and what to try: stop another stream on that hub, or pick a lower rate or fewer channels.Checked with the fake host in
tests/test_usb_host_streams.py: a new test has the claim refused with ENOSPC and checks the errno and message, and the file's 46 tests pass. Not run on a board; the firmware side that raises ENOSPC is in PyDevices/omnipython-builds#627.