0

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

Oren
  • 937
  • 1
  • 10
  • 34
  • This depends not only on the specific chips used, but also on how they are wired together. Anyway, the hw_params might indicate that you're just using a wrong sample format. – CL. Mar 02 '15 at 12:05
  • I'm using 16 bit sample format and I tried all sampling rates. I also tried single channel and 2 channels - no luck – Oren Mar 02 '15 at 12:07
  • See the output of `aplay --dump-hw-params`. – CL. Mar 02 '15 at 12:19
  • I'm using tinyalsa and AFAIK there is no option to dump hardware parameters.. – Oren Mar 02 '15 at 12:29
  • I found out that setting access to SNDRV_PCM_ACCESS_RW_INTERLEAVED fails. Question edited with full details – Oren Mar 02 '15 at 13:27
  • So it works if you omit that `set_mask` call? – CL. Mar 02 '15 at 13:59
  • I re-edited, I think the issue is with set params in general (the set access was just the last one before applying the hw params) – Oren Mar 02 '15 at 14:01
  • This means that some parameter is not supported by the hardware. – CL. Mar 02 '15 at 15:18
  • I found that it is related to period size and period count (details in re-edited question). when I mange to set them I get a start error message – Oren Mar 02 '15 at 15:21

0 Answers0