Here are the messages of tinypcminfo:
hikey960:/ # tinypcminfo -D 0 -d 0
Info for card 0, device 0:
PCM out:
Access: 0x000009
Format[0]: 0x000004
Format[1]: 00000000
Format Name: S16_LE
Subformat: 0x000001
Rate: min=8000Hz max=8000Hz
Channels: min=1 max=2
Sample bits: min=16 max=16
Period size: min=256 max=2048
Period count: min=4 max=128
PCM in:
Access: 0x000009
Format[0]: 0x000004
Format[1]: 00000000
Format Name: S16_LE
Subformat: 0x000001
Rate: min=8000Hz max=8000Hz
Channels: min=1 max=2
Sample bits: min=16 max=16
Period size: min=256 max=2048
Period count: min=4 max=128
hikey960:/ # tinypcminfo -D 1 -d 0
Info for card 1, device 0:
PCM out:
Access: 0x000009
Format[0]: 0x000004
Format[1]: 00000000
Format Name: S16_LE
Subformat: 0x000001
Rate: min=44100Hz max=44100Hz
Channels: min=2 max=2
Sample bits: min=16 max=16
Period size: min=45 max=131072
Period count: min=2 max=1024
PCM in:
Access: 0x000009
Format[0]: 0x000004
Format[1]: 00000000
Format Name: S16_LE
Subformat: 0x000001
Rate: min=44100Hz max=44100Hz
Channels: min=2 max=2
Sample bits: min=16 max=16
Period size: min=45 max=131072
Period count: min=2 max=1024
“logcat | grep usbaudio” shows the following:
hikey960:/ # logcat | grep usbaudio
01-23 09:20:15.659 2216 2237 D modules.usbaudio_hal.hikey: adev_set_parameters: kvpairs: card=1;connect=67108864;device=0
01-23 09:20:15.934 2216 2237 D modules.usbaudio_hal.hikey: adev_set_parameters: kvpairs: card=1;connect=-2113929216;device=0
01-23 09:44:02.277 2216 9130 D modules.usbaudio_hal.hikey: adev_set_parameters: kvpairs: hfp_enable=false
01-23 09:44:37.851 2216 2216 D modules.usbaudio_hal.hikey: adev_set_parameters: kvpairs: hfp_set_sampling_rate=8000
01-23 09:44:37.851 2216 2216 D modules.usbaudio_hal.hikey: adev_set_parameters: kvpairs: hfp_enable=true
01-23 09:44:37.851 2216 13794 D modules.usbaudio_hal.hikey: runsco: USBCARD: 1, BTCARD: 0
01-23 09:44:37.852 2216 2216 D modules.usbaudio_hal.hikey: adev_set_parameters: kvpairs: hfp_volume=11
01-23 09:44:37.852 2216 13794 D modules.usbaudio_hal.hikey: runsco: failed to open PCM near/in
01-23 09:44:46.293 2216 2216 D modules.usbaudio_hal.hikey: adev_set_parameters: kvpairs: hfp_enable=false
If I setup usb_config as:
struct pcm_config usb_config = {
.channels = 2,
.rate = 44100,
.format = PCM_FORMAT_S16_LE,
.period_size = 1024,
.period_count = 2,
.start_threshold = 0,
.silence_threshold = 0,
.stop_threshold = 0,
};
I got the following messages:
01-23 09:56:37.998 2213 9013 D modules.usbaudio_hal.hikey: adev_set_parameters: kvpairs: hfp_enable=true
01-23 09:56:37.998 2213 13860 D modules.usbaudio_hal.hikey: runsco: USBCARD: 1, BTCARD: 0
01-23 09:56:37.999 2213 9013 D modules.usbaudio_hal.hikey: adev_set_parameters: kvpairs: hfp_volume=11
01-23 09:56:38.014 2213 13860 D modules.usbaudio_hal.hikey: runsco: failed to open PCM near/out
01-23 09:56:44.574 2213 9013 D modules.usbaudio_hal.hikey: adev_set_parameters: kvpairs: hfp_enable=false