We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
alsa/device.go
Line 256 in d079056
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 ?
The text was updated successfully, but these errors were encountered:
Great report! That makes sense. I was hoping it would block until it was able to write as many frames as requested. I'll make a PR for this sometime.
Sorry, something went wrong.
No branches or pull requests
alsa/device.go
Line 256 in d079056
Hi,
sometimes write method write less number of frames, here is how i fixed this:
i not going to send PR, please update from this issue,
Regards
PS
May be Read can also read less that requested frames ?
The text was updated successfully, but these errors were encountered: