Capturing line-in audio via tiny cap on Hikey960 board



I recently got a Hikey960 board on which I have installed AOSP master branch along with the standard supplied hikey-kernel.
I Added the tiny cap as a product_package in the hikey/ and was trying to capture
line-in audio while I was playing some vide via the browser.
The wav file created by the tiny cap is completely ‘silent’.
The hexdump shows all ‘ff’ in the data section of the wav file .

Can anyone please help here? Is there some change required in the linux kernel to get this running?
Would appreciate any help on this.



That’s not how tinycap works. Tinycap connects to an alsa input device, i.e., a “sound card”. If you want to capture sound you play through a web browser with tinycap, you will have to rig up an alsa loopback device and modify the audio hal to play to it. There are much better, easier, smarter ways to accomplish that.


Thanks for the pointer doitright. After installing the Alsa loop driver, I can record audio with tiny cap but cannot hear the audio via cdmi out!

Heres the output of ‘cards’ in proc file

adb shell ‘cat /proc/asound/cards’
0 [Loopback ]: Loopback - Loopback
Loopback 1
1 [hikeysndcard ]: hikey-sndcard - hikey-sndcard
Any clue on how to get packets entering loop to also reach the hikeysndcard?



Pretty sure I told you that you would have to modify your audio hal.

It was blind luck that you were able to capture the intended audio stream as you did with nothing besides enabling loopback. You know why? Because the kernel did NOT have to enumerate the two “cards” in the order they did. The HAL will send audio exclusively to card 0.


yes, saw the CARD hard coded to ‘0’ in the Hal. Modified HAL to output to both the cards and now capture and play are both good. Thanks again.