From f9a6bcc9dc858271bb4c672e4ffe1705f781d42d Mon Sep 17 00:00:00 2001 From: Trek H Date: Wed, 9 Feb 2022 16:38:10 +1030 Subject: [PATCH] alsa: return EOF from alsa.Read so that pauses can be detected and input stopped --- device/alsa/alsa.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/device/alsa/alsa.go b/device/alsa/alsa.go index ae7109b3..73a56a83 100644 --- a/device/alsa/alsa.go +++ b/device/alsa/alsa.go @@ -435,8 +435,8 @@ func (d *ALSA) Read(p []byte) (int, error) { if err != nil { switch err { case nil, io.EOF: - d.l.Log(logger.Debug, pkg+"EOF") - return n, nil + d.l.Log(logger.Debug, pkg+"EOF from Read, stopping") + return n, err default: d.l.Log(logger.Error, pkg+"unexpected error from Read", "error", err.Error()) return n, nil