usbaudio | Forward audio from Android devices
kandi X-RAY | usbaudio Summary
kandi X-RAY | usbaudio Summary
This tool forwards audio from an Android device to the computer over USB. It works on Linux with PulseAudio. The purpose is to enable audio forwarding while mirroring with scrcpy. However, it can be used independently, and does not require USB debugging enabled.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of usbaudio
usbaudio Key Features
usbaudio Examples and Code Snippets
Community Discussions
Trending Discussions on usbaudio
QUESTION
Overview...
I have read How to get device interface GUID for a device? and How to open a handle to a device using its Device Instance ID?, but I'm still confused about how I am to (or whether I should even) use SetupDiEnumDeviceInterfaces paired with SetupDiGetDeviceInterfaceDetail to get a DevicePath that can be opened with CreateFile to access the device when no device interface class GUID is known. My question is based on the MSDN article here and here which rely on these functions.
More details...
The high level of my problem is I've got an audio USB device I need to send control transfer commands. To do so, I want to use WinUSB's API, and to do that I need to get a handle to the device via CreateFile. Unfortunately, there is no .inf file associated with the device and so there is no known device interface class GUID. If one plugs the device in, Windows associates with it usbaudio.sys as the driver. To start talking over WinUSB, I use libwdi to install WinUSB as the device driver so that I can communicate with it via the WinUSB API. To accomplish the install of WinUSB, libwdi dynamically creates a self-signed .cat and .inf file pair, which unfortunately has no device interface class defined. In fact, the INF file has the following in it:
...ANSWER
Answered 2021-May-14 at 00:32Yes, first you need to get a device information set for devices that implement the interface via SetupDiGetClassDevs
, then pick one of the devices and read its device interface data, and use that to get the device interface detail that contains the device path.
Example:
QUESTION
For my own edification, I'm trying to read some audio data from a USB audio interface using a DriverKit System Extension.
My IOProviderClass
is IOUSBHostInterface
. I can successfully Open()
the interface, but CopyPipe()
returns kIOReturnError
(0xe00002bc
). Why can't I copy the pipe?
To be able to open the interface at all, I had to outmatch AppleUSBAudio
so my IOKitPersonalities
explicitly match the bConfigurationValue
, bInterfaceNumber
, idVendor
, idProduct
, and bcdDevice
keys. This list may not be minimal.
In ioreg
I can normally see the interfaces (sometimes only my matching one is there, although I think this is a degenerate situation). I see a AppleUserUSBHostHIDDevice
child on some of my other interfaces. Could this be the problem? Normally the device has no problem being both USBAudio and HID. I am trying unsuccessfully to out match HID too.
ANSWER
Answered 2021-Apr-10 at 20:05I was passing the wrong endpoint address to CopyPipe()
.
To find an endpoint address you need to enumerate through the IOUSBDescriptorHeader
s in the IOUSBConfigurationDescriptor
and examine the descriptors with bDescriptorType
equal to kIOUSBDescriptorTypeEndpoint
.
IOUSBGetNextDescriptor()
from USBDriverKit/AppleUSBDescriptorParsing.h
is made for this and will save you from having think about pointer manipulation.
If the endpoint is in a different alternate setting, then you need to switch the interface to that one with SelectAlternateSetting()
.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install usbaudio
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page