diff --git a/device/alsa/alsa.go b/device/alsa/alsa.go index 73a56a83..ededc6c1 100644 --- a/device/alsa/alsa.go +++ b/device/alsa/alsa.go @@ -377,6 +377,7 @@ func (d *ALSA) input() { d.dev.Close() d.dev = nil } + d.buf.Close() return } @@ -418,8 +419,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 0, nil + d.l.Log(logger.Debug, pkg+"EOF from Next") + return 0, err case pool.ErrTimeout: d.l.Log(logger.Debug, pkg+"pool buffer timeout") return 0, nil @@ -435,7 +436,7 @@ func (d *ALSA) Read(p []byte) (int, error) { if err != nil { switch err { case nil, io.EOF: - d.l.Log(logger.Debug, pkg+"EOF from Read, stopping") + d.l.Log(logger.Debug, pkg+"EOF from Read") return n, err default: d.l.Log(logger.Error, pkg+"unexpected error from Read", "error", err.Error())