tinyalsa icon indicating copy to clipboard operation
tinyalsa copied to clipboard

Can not prepare channel: Invalid argument

Open fahime-ghasemi opened this issue 3 years ago • 3 comments

This section in pcm.c returns error if (ioctl(pcm->fd, SNDRV_PCM_IOCTL_PREPARE) < 0) { return oops(pcm, errno, "cannot prepare channel"); }

It says invalid argument. I've tested with channel set to 1 and 2 but both of them returns this error. I don't know if the number of channels is incorrect or something else. Could anyone help me?

fahime-ghasemi avatar Aug 09 '22 09:08 fahime-ghasemi

Did you set up the path of the playback before call the pcm_prepare? If the PCM device is a dynamic-path device, you need to setup path before prepare.

dvdli avatar Aug 09 '22 11:08 dvdli

I don't know how I can find the requirement setups. I want to test it on Qualcomm chipsets. I would be thankful If you let me know any idea about finding the setups.

fahime-ghasemi avatar Aug 28 '22 11:08 fahime-ghasemi

I want to test capture with tinycap.c. I've added tinyalsa files to my android app and wrote the following code:

frames = capture_sample(file, 0, 9, false,1, 48000, PCM_FORMAT_S16_LE, 1024, 4,3);

According to your comment I guess I should use tinymix before calling this line of code. But I don't know for record a .wav file on Qualcomm chipsets, How I can find the requirement tinymix configurations.

fahime-ghasemi avatar Aug 28 '22 12:08 fahime-ghasemi