Android Kitkat 버전으로 번쩍 거리는 SBC에서 작업 중입니다. (보드에는 USB 호스트가 있음). 하지만 공식 USB 오디오 네이티브 지원은 안드로이드 5.0 이후에 소개 되었기 때문에 SBC에서 USB 오디오 장치를 직접 사용할 수는 없습니다. 나는 libusb를 사용하여 그 목적을 수행하고 있습니다. 특정 끝점을 열 수 있습니다. 그러나 캡처 할 때 모든 null 데이터를 가져옵니다. libusb 호출에 어떤 오류도 발생하지 않습니다.Android에서 libusb를 사용하여 오디오를 캡처하는 경우
는 다음 단계의 간단한 의사 코드는 다음과 같습니다
libusb_init(NULL)
devId = libusb_open_device_with_vid_pid(NULL, VID, PID)
if(libusb_kernel_driver_active(devId, IFACE_NUM)->detachKernel)
libusb_claim_interface(devId, IFACE_NUM)
libusb_set_interface_alt_setting(devId, IFACE_NUM, ALT_SETTING)
Loop{libusb_alloc_transfer(numOfPackets)
libusb_fill_iso_transfer(callBack)
libusb_set_iso_packet_lengths
libusb_submit_transfer}:NumOfTransfer(10) times
Inside callback: uint8_t* data = libusb_get_iso_packet_buffer_simple()
나는 모든 데이터가 NULL 오는 데이터에 의해 지적 된 버퍼 인쇄하려합니다. 콜백 내 libusb_transfer 구조체 요소를 선택하면이 1,960 만 실제 길이와 버퍼의 길이를 제공하는 것은 내가 USB 오디오 장치로 마이크 행동을 가지고 로지텍 C310 웹캠을 사용하고 0
입니다. 나는 그것의 잘못가는 곳이
Interface Descriptor:
------------------------------
0x09 bLength
0x04 bDescriptorType
0x03 bInterfaceNumber
0x04 bAlternateSetting
0x01 bNumEndPoints
0x01 bInterfaceClass (Audio Device Class)
0x02 bInterfaceSubClass (Audio Streaming Interface)
0x00 bInterfaceProtocol
0x00 iInterface
AS Interface Descriptor:
------------------------------
0x07 bLength
0x24 bDescriptorType
0x01 bDescriptorSubtype
0x03 bTerminalLink
0x01 bDelay
0x0001 wFormatTag (PCM)
AS Format Type 1 Descriptor:
------------------------------
0x0B bLength
0x24 bDescriptorType
0x02 bDescriptorSubtype
0x01 bFormatType (FORMAT_TYPE_1)
0x01 bNrChannels (1 Channels)
0x02 bSubframeSize
0x10 bBitResolution (16 Bits/sample)
0x01 bSamFreqType (Discrete sampling frequencies)
0x00BB80 tSamFreq(1) (48000 Hz)
Endpoint Descriptor (Audio/MIDI):
------------------------------
0x09 bLength
0x05 bDescriptorType
0x86 bEndpointAddress (IN Endpoint)
0x05 bmAttributes (Transfer: Isochronous/Synch: Asynchronous/Usage: Data)
0x00C4 wMaxPacketSize (196 Bytes)
0x01 bInterval
0x00 bRefresh
0x00 bSynchAddress
내가지고 있지 않다 장치 설명의 일부가 아래에서 알 수있는 바와 같이 4 설정 인터페이스 번호 3 및 대체를 사용하고 ? 아무도 안드로이드 낮은 버전의 USB 오디오에 대한 작업 참조를 공유 할 수 있습니까?