I'm attempting a barebones program to use tinyalsa, but pcm_start always fails, returning -1 and setting errno to 9 (EBADF, i.e. bad file number). The call to pcm_open before this returns a non-null pointer, but it sets errno to 22.
There appears to be no documentation for tinyalsa, so I'm having trouble understanding what I'm supposed to do. I based my program on an example from alsa (not tinyalsa), and I've read the header files for tinyalsa. Can anyone provide guidance?
I'm attempting a barebones program to use tinyalsa, but
pcm_start
always fails, returning -1 and settingerrno
to 9 (EBADF
, i.e. bad file number). The call topcm_open
before this returns a non-null pointer, but it setserrno
to 22.There appears to be no documentation for tinyalsa, so I'm having trouble understanding what I'm supposed to do. I based my program on an example from alsa (not tinyalsa), and I've read the header files for tinyalsa. Can anyone provide guidance?
(Full code available on pastebin.)
I infer the values for the first two arguments of
pcm_open
fromaplay --list-devices
, which outputs: