]> git.alsa-project.org Git - alsa-utils.git/commit
aplay: avoid any further PCM writing if in abort
authorAndreas Pape <apape@de.adit-jv.com>
Fri, 19 Mar 2021 10:57:13 +0000 (11:57 +0100)
committerJaroslav Kysela <perex@perex.cz>
Fri, 19 Mar 2021 11:53:39 +0000 (12:53 +0100)
commitc9e9a79c6cfef3212bdb5f9be4f6ea1d2a5e8670
treeff4f6ef7473f78e2bd9545e66afd2351ff0b4938
parent00be486131129a6d209de62202d2a4974638127f
aplay: avoid any further PCM writing if in abort

Terminating stream with CTRL-C will set in_aborting flag which is used to leave any
write/read loop on the ALSA device.
After ending the read/write loop aplay tries to drain the stream which is not required and can also lead to malfunctions:
-If user interrupts a blocked/non responsive PCM (e.g. usb uac2 gadget which does not consume data
due to stream stopped by host) it will successfully terminate the write loop but will hang again in drain call.
This would require to hit CTRL-C again to unblock which should be avoided.
Aplay currently anyhow allows signal handler to get invoked only once.

Signed-off-by: Andreas Pape <apape@de.adit-jv.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
aplay/aplay.c