diff --git a/device/alsa/alsa.go b/device/alsa/alsa.go index e372d3a2..bb1f1125 100644 --- a/device/alsa/alsa.go +++ b/device/alsa/alsa.go @@ -377,7 +377,10 @@ func (d *ALSA) input() { d.dev.Close() d.dev = nil } - d.buf.Close() + err := d.buf.Close() + if err != nil { + d.l.Log(logger.Error, "unable to close pool buffer", "error", err) + } return } @@ -418,7 +421,7 @@ func (d *ALSA) Read(p []byte) (int, error) { _, err := d.buf.Next(rbNextTimeout) if err != nil { switch err { - case nil, io.EOF: + case io.EOF: d.l.Log(logger.Debug, pkg+"EOF from Next") return 0, err case pool.ErrTimeout: @@ -435,7 +438,7 @@ func (d *ALSA) Read(p []byte) (int, error) { n, err := d.buf.Read(p) if err != nil { switch err { - case nil, io.EOF: + case io.EOF: d.l.Log(logger.Debug, pkg+"EOF from Read") return n, err default: