|
Edited by jonsmirl at 2018-7-6 21:23 \n\n
To test this, use this program to enable USB audio out on the phone:
https://github.com/gibsson/linux-adk
jonsmirl@ares:~/aosp/linux-adk$ ./linux-adk -d 0e8d:201c
Looking for device 0e8d:201c
Device supports AOA 2.0!
Sending identification to the device
sending manufacturer: Google, Inc.
sending model: DemoKit
sending description: Demo ABS2013
sending version: 2.0
sending url: https://github.com/gibsson
sending serial number: 0000000012345678
asking for audio support
Turning the device in Accessory mode
Found accessory 18d1:2d05
Device should now be recognized as valid ALSA card...
=> arecord -l
Unable to open usb device [0xfffffffd]
^CSIGINT: Closing accessory
Closing USB device
----> now the device is in USB audio output mode ----
jonsmirl@ares:~/aosp/linux-adk$ ls /proc/asound
A1PRO card0 card1 cards devices hwdep modules oss PCH pcm seq timers version
jonsmirl@ares:~/aosp/linux-adk$ ls /proc/asound -l
total 0
lrwxrwxrwx 1 root root 5 Jul 6 09:18 A1PRO -> card1
dr-xr-xr-x 8 root root 0 Jul 6 09:18 card0
dr-xr-xr-x 3 root root 0 Jul 6 09:18 card1
-r--r--r-- 1 root root 0 Jul 6 09:18 cards
-r--r--r-- 1 root root 0 Jul 6 09:18 devices
-r--r--r-- 1 root root 0 Jul 6 09:18 hwdep
-r--r--r-- 1 root root 0 Jul 6 09:18 modules
dr-xr-xr-x 2 root root 0 Jul 6 09:18 oss
lrwxrwxrwx 1 root root 5 Jul 6 09:18 PCH -> card0
-r--r--r-- 1 root root 0 Jul 6 09:18 pcm
dr-xr-xr-x 2 root root 0 Jul 6 09:18 seq
-r--r--r-- 1 root root 0 Jul 6 09:18 timers
-r--r--r-- 1 root root 0 Jul 6 09:18 version
jonsmirl@ares:~/aosp/linux-adk$ arecord -D hw:1,0 -c 2 -r 44100 -f S16_LE ~/foo.wav
Recording WAVE '/home/jonsmirl/foo.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
arecord: set_params:1363: Unable to install hw params:
ACCESS: RW_INTERLEAVED
FORMAT: S16_LE
SUBFORMAT: STD
SAMPLE_BITS: 16
FRAME_BITS: 32
CHANNELS: 2
RATE: 44100
PERIOD_TIME: (125011 125012)
PERIOD_SIZE: 5513
PERIOD_BYTES: 22052
PERIODS: (3 4)
BUFFER_TIME: 500000
BUFFER_SIZE: 22050
BUFFER_BYTES: 88200
TICK_TIME: 0
Look at dmesg and note that arecord fails because it can not set the interface.
This is the same procedure Android Audio uses to play audio, it just doesn't need a car.
Here is the correct output from my Google Pixel (also running Oreo)...
Pixel is working without problem. It is also USB-C.Also note that this works correctly on the Nokia-1 which is running Mediatek Oreo on the MT6737.
[95584.714759] usb 1-2: Product: Pixel
[95584.714765] usb 1-2: Manufacturer: Google
[95584.714771] usb 1-2: SerialNumber: FA68Z0309184
[95586.782233] usb 1-2: USB disconnect, device number 48
[95587.309479] usb 1-2: new high-speed USB device number 49 using xhci_hcd
[95587.458468] usb 1-2: New USB device found, idVendor=18d1, idProduct=2d03
[95587.458478] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[95587.458485] usb 1-2: Product: Pixel
[95587.458490] usb 1-2: Manufacturer: Google
[95587.458496] usb 1-2: SerialNumber: FA68Z0309184
[95587.459886] usb 1-2: 1:1: add audio endpoint 0x82
----> A1 pro failed here
[95587.492151] usb 1-2: setting usb interface 1:1
[95587.495659] usb 1-2: setting usb interface 1:1
[95587.502216] usb 1-2: setting usb interface 1:1
[95587.506349] usb 1-2: Starting data EP @00000000d8f304ed
[95593.402794] usb 1-2: setting usb interface 1:1
[95593.403469] usb 1-2: Starting data EP @00000000d8f304ed
jonsmirl@ares:~/aosp/linux-adk$
|
|