Well, here is something to try out. I'll fix something more appropriate (git-send-email, debdiff, etc) in the next few days, right now I'm a bit to tired for the formalities. But I hope these three fixes should improve the situation.
1)
+ /* Prevent accidental overrun of the fake ringbuffer */
+ if (size >= pcm->buffer_attr.tlength)
+ size = pcm->buffer_attr.tlength-1;
This cured a hang I could sometimes reproduce while recovering from an xrun.
Before prepare is called the ioplug interface resets its pointers, so we should do the same. No real difference in experience from this one, it just seems reasonable.
Well, here is something to try out. I'll fix something more appropriate (git-send-email, debdiff, etc) in the next few days, right now I'm a bit to tired for the formalities. But I hope these three fixes should improve the situation.
1) attr.tlength) attr.tlength- 1;
+ /* Prevent accidental overrun of the fake ringbuffer */
+ if (size >= pcm->buffer_
+ size = pcm->buffer_
This cured a hang I could sometimes reproduce while recovering from an xrun.
2) write(pcm- >stream, buf, writebytes, NULL, 0, 0);
+ writebytes = size * pcm->frame_size;
+ ret = pa_stream_
+ pcm->last_size -= writebytes;
This updates the hw_ptr variable correctly, which fixed some continous xruns for me as well as reduced CPU usage.
3)
+ /* Reset faked buffer */
+ pcm->last_size = 0;
+ pcm->ptr = 0;
+ update_ptr(pcm);
Before prepare is called the ioplug interface resets its pointers, so we should do the same. No real difference in experience from this one, it just seems reasonable.