alsa-utils icon indicating copy to clipboard operation
alsa-utils copied to clipboard

[Enhancement] axfer: survive system suspend/resume while streaming

Open aiChaoSONG opened this issue 3 years ago • 0 comments

If we suspend the system while axfer is doing playback/capture, after system resumed, axfer stopped playbak/capture with:

Fail to process frames: Streams pipe error
PLAYBACK: Expected 4611686018427387903frames, Actual 143392frames
snd_pcm_drain(): File descriptor in bad state
snd_pcm_hw_free(): File descriptor in bad state

You can get the failure by playing in a terminal with axfer transfer playback -Dhw:0,0 -f dat -i -vvv -c 2 /dev/zero, and run sudo rtcwake -m mem -s 5 in another terminal.

axfer should survive system suspend/resume, just like aplay.

@takaswie FYI, thank you for creating this tool. here is how aplay handle this: https://github.com/alsa-project/alsa-utils/blob/a566f8a0ed6d7ca5fd6ae2d224f3f28654a2f3be/aplay/aplay.c#L1738

aiChaoSONG avatar Jul 14 '22 02:07 aiChaoSONG