I found this bug was introduced by this commit I mentioned. From aplay info above, it seems if there is no plugin prior to mmap-emul, alsa lib will never send start cmd to driver.
Add some strace info, For S32_LE: ioctl(4, SNDRV_PCM_IOCTL_HW_REFINE, 0x2cbd854) = 0 ioctl(4, SNDRV_PCM_IOCTL_HW_PARAMS, 0x2cbd854) = 0 ioctl(4, SNDRV_PCM_IOCTL_SYNC_PTR, 0x2e4b718) = 0 ioctl(4, SNDRV_PCM_IOCTL_SW_PARAMS, 0x2cbd044) = 0 ioctl(4, SNDRV_PCM_IOCTL_SW_PARAMS, 0x2cbd39c) = 0 ioctl(4, SNDRV_PCM_IOCTL_SW_PARAMS, 0x2cbd718) = 0 ioctl(4, SNDRV_PCM_IOCTL_PREPARE, 0xfffff000) = 0 ioctl(4, SNDRV_PCM_IOCTL_SYNC_PTR, 0x2e4b718) = 0 ioctl(4, SNDRV_PCM_IOCTL_SYNC_PTR, 0x2e4b718) = 0 mmap2(NULL, 12288, PROT_READ|PROT_WRITE, MAP_SHARED|MAP_ANONYMOUS|0x4000000, 0, 0) = 0x2e54000 ioctl(0, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, {B57600 opost isig icanon echo ...}) = 0 fcntl(0, F_GETFL) = 0x2 (flags O_RDWR) fcntl(0, F_SETFL, O_RDWR|O_NONBLOCK) = 0 ioctl(0, SNDCTL_TMR_START or SNDRV_TIMER_IOCTL_TREAD or TCSETS, {B57600 opost isig -icanon echo ...}) = 0 ioctl(0, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, {B57600 opost isig -icanon echo ...}) = 0 rmdir("1.wav") = -1 ENOENT (No such file or directory) open("1.wav", O_WRONLY|O_CREAT|O_LARGEFILE, 0644) = 3 write(3, "RIFF$\224\21\0WAVE", 12) = 12 write(3, "fmt \20\0\0\0", 8) = 8 write(3, "\1\0\2\0\200\273\0\0\0\334\5\0\10\0 \0", 16) = 16 write(3, "data\0\224\21\0", 8) = 8 read(0, 0x2cbdb2f, 1) = -1 EAGAIN (Resource temporarily unavailable) ioctl(4, SNDRV_PCM_IOCTL_READI_FRAMES, 0x2cbdb2c) = -1 EIO (Input/output error) write(2, "arecord", 7arecord) = 7 write(2, ": ", 2: ) = 2 write(2, "pcm_read", 8pcm_read) = 8 write(2, ":", 1:) = 1 write(2, "1773", 41773) = 4 write(2, ": ", 2: ) = 2 write(2, "read error: ", 12read error: ) = 12 write(2, "Input/output error", 18Input/output error) = 18 write(2, "\n", 1
And for S16_LE: ioctl(4, SNDRV_PCM_IOCTL_HW_REFINE, 0x2cbd0d4) = 0 ioctl(4, SNDRV_PCM_IOCTL_HW_PARAMS, 0x2cbd0d4) = -1 EINVAL (Invalid argument) ioctl(4, SNDRV_PCM_IOCTL_HW_REFINE, 0x2cbd0d4) = 0 ioctl(4, SNDRV_PCM_IOCTL_HW_PARAMS, 0x2cbd0d4) = 0 ioctl(4, SNDRV_PCM_IOCTL_SYNC_PTR, 0x2e4c718) = 0 ioctl(4, SNDRV_PCM_IOCTL_SW_PARAMS, 0x2cbccdc) = 0 ioctl(4, SNDRV_PCM_IOCTL_SW_PARAMS, 0x2cbd034) = 0 mmap2(NULL, 36864, PROT_READ|PROT_WRITE, MAP_SHARED|MAP_ANONYMOUS|0x4000000, 0, 0) = 0x2e60000 ioctl(4, SNDRV_PCM_IOCTL_SW_PARAMS, 0x2cbd39c) = 0 ioctl(4, SNDRV_PCM_IOCTL_SYNC_PTR, 0x2e4c718) = 0 ioctl(4, SNDRV_PCM_IOCTL_PREPARE, 0xfffff000) = 0 ioctl(4, SNDRV_PCM_IOCTL_SYNC_PTR, 0x2e4c718) = 0 ioctl(4, SNDRV_PCM_IOCTL_SYNC_PTR, 0x2e4c718) = 0 mmap2(NULL, 8192, PROT_READ|PROT_WRITE, MAP_SHARED|MAP_ANONYMOUS|0x4000000, 0, 0) = 0x2e54000 ioctl(0, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, {B57600 opost isig icanon echo ...}) = 0 fcntl(0, F_GETFL) = 0x2 (flags O_RDWR) fcntl(0, F_SETFL, O_RDWR|O_NONBLOCK) = 0 ioctl(0, SNDCTL_TMR_START or SNDRV_TIMER_IOCTL_TREAD or TCSETS, {B57600 opost isig -icanon echo ...}) = 0 ioctl(0, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, {B57600 opost isig -icanon echo ...}) = 0 rmdir("1.wav") = -1 ENOENT (No such file or directory) open("1.wav", O_WRONLY|O_CREAT|O_LARGEFILE, 0644) = 3 write(3, "RIFF$\312\10\0WAVE", 12) = 12 write(3, "fmt \20\0\0\0", 8) = 8 write(3, "\1\0\2\0\200\273\0\0\0\356\2\0\4\0\20\0", 16) = 16 write(3, "data\0\312\10\0", 8) = 8 read(0, 0x2cbdb2f, 1) = -1 EAGAIN (Resource temporarily unavailable) ioctl(4, SNDRV_PCM_IOCTL_SYNC_PTR, 0x2e4c718) = 0 ioctl(4, SNDRV_PCM_IOCTL_SYNC_PTR, 0x2e4c718) = 0 ioctl(4, SNDRV_PCM_IOCTL_START, 0xfffff000) = 0 ioctl(4, SNDRV_PCM_IOCTL_SYNC_PTR, 0x2e4c718) = 0 ppoll([{fd=4, events=POLLIN|POLLERR|POLLNVAL}], 1, NULL, NULL, 8) = 1 ([{fd=4, revents=POLLIN}]) ioctl(4, SNDRV_PCM_IOCTL_SYNC_PTR, 0x2e4c718) = 0 ioctl(4, SNDRV_PCM_IOCTL_SYNC_PTR, 0x2e4c718) = 0 ioctl(4, SNDRV_PCM_IOCTL_SYNC_PTR, 0x2e4c718) = 0 ioctl(4, SNDRV_PCM_IOCTL_READI_FRAMES, 0x2cbd9d4) = 0 ioctl(4, SNDRV_PCM_IOCTL_SYNC_PTR, 0x2e4c718) = 0 write(3, "\352\0\352\0\352\0\352\0\352\0\352\0\352\0\352\0\352\0\352\0\352\0\352\0\352\0\352\0\352\0\352\0"..., 4096) = 4096 read(0, 0x2cbdb2f, 1) = -1 EAGAIN (Resource temporarily unavailable) ioctl(4, SNDRV_PCM_IOCTL_SYNC_PTR, 0x2e4c718) = 0 ioctl(4, SNDRV_PCM_IOCTL_SYNC_PTR, 0x2e4c718) = 0 ioctl(4, SNDRV_PCM_IOCTL_SYNC_PTR, 0x2e4c718) = 0 ioctl(4, SNDRV_PCM_IOCTL_READI_FRAMES, 0x2cbd9d4) = 0 ioctl(4, SNDRV_PCM_IOCTL_SYNC_PTR, 0x2e4c718) = 0 ioctl(4, SNDRV_PCM_IOCTL_SYNC_PTR, 0x2e4c718) = 0 ioctl(4, SNDRV_PCM_IOCTL_SYNC_PTR, 0x2e4c718) = 0 ioctl(4, SNDRV_PCM_IOCTL_SYNC_PTR, 0x2e4c718) = 0 ioctl(4, SNDRV_PCM_IOCTL_READI_FRAMES, 0x2cbd9d4) = 0
So we can see ioctl(4, SNDRV_PCM_IOCTL_START, 0xfffff000) was missed before ioctl(4, SNDRV_PCM_IOCTL_READI_FRAMES, 0x2cbd9d4) in S32_LE format test case.
Regards, Scott