APQ8064 alsa recording

543 Views Asked by At

I have a Nexus 4 device (msm8960 with APQ8064 sound card).
I'm trying to record audio from the primary device (pcmC0P0c) using tinyalsa tinycap utility but I encounter the following issues:

  • If I do not modify any mixer control, I get an "Unable to open PCM device - device not found error"
  • When I set one of Multimedia1 switches to on (e.g. MultiMedia1 Mixer SLIM_4_TX) I get an error saying setting hw params failed.

So, my question is: how do I know which controls to set to On (and / or what to set other controls) in order to capture audio successfully?

Edit:
After some digging I found that the in pcm_open setting pcm params fails in the following call:

 if (ioctl(pcm->fd, SNDRV_PCM_IOCTL_HW_PARAMS, &params)) {
    oops(pcm, errno, "cannot set hw params");
    goto fail_close;
}

How can I set params correctly so that pcm_open will succeed? I couldn't see any issue with the parameters (which BTW work on other devices)

Edit 2:
I see the issue is with period size and period count - I can't set to above 150 and 2 respectively. When I change them pcm_open succeeds but pcm_read fails with "start error" message

Thanks for the helpers

0

There are 0 best solutions below