On Sun, 11 Jan 2026, Mark Hills wrote:
I've written an ALSA plugin (ioplug) of the form below.
My plugin offers only S16, 48000Hz.
I expected a "plug" device would take the application's request and resample to 48000Hz, but instead it fails:
$ aplay -D plug:mytest cd-audio.wav Playing WAVE 'cd-audio.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo aplay: set_params:1456: Unable to install hw params: ACCESS: RW_INTERLEAVED FORMAT: S16_LE SUBFORMAT: STD
[...]
Modify the plugin 48000Hz to be 44100Hz and negotiation passes, so it suggests the rate is the problem (not some other parameter like period size)
Following up my own mail to help the others looking at these archives:
The root cause seems to be my plugin not offering SND_PCM_ACCESS_MMAP_INTERLEAVED, which I assume is required by the "plug" to do rate resampling and feed into it.
I couldn't find this in any documentation, searching or AI chat, and the ALSA code for negotiating the plug is non-trivial so perhaps someone has an explanation or rationale if it could fall into this for some other reason.
Here's the culprit code:
SND_PCM_PLUGIN_DEFINE_FUNC(mytest) { struct state *s; snd_pcm_ioplug_t *io; unsigned access = SND_PCM_ACCESS_RW_INTERLEAVED;
[...]
snd_pcm_ioplug_set_param_list(io, SND_PCM_IOPLUG_HW_ACCESS, 1, &access);
Many thanks,