-
Notifications
You must be signed in to change notification settings - Fork 20
Open
Description
Line 256 in d079056
| func (device *Device) Write(buf []byte, frames int) error { |
Hi,
sometimes write method write less number of frames, here is how i fixed this:
func (device *Device) write1(buf []byte, frames int) (int, error) {
x := pcm.XferI{
Buf: uintptr(unsafe.Pointer(&buf[0])),
Frames: alsatype.Uframes(frames),
}
err := ioctl(device.fh.Fd(), ioctl_encode_ptr(cmdWrite, &x, cmdPCMWriteIFrames), &x)
written := alsatype.Uframes(frames)
if err == syscall.EAGAIN {
return written, nil
}
return written, err
}
func (device *Device) Write(buf []byte, framesize int) error {
for len(buf) > 0 {
w, err := dev.write1(buf, len(buf)/framesize)
if err != nil {
return err
}
buf = buf[w*framesize:]
}
}i not going to send PR, please update from this issue,
Regards
PS
May be Read can also read less that requested frames ?
Metadata
Metadata
Assignees
Labels
No labels