On Thu, 2016-08-11 at 17:58 +0200, Nils Schneider wrote: > The pipe buffer is likely to be a power of 2 (e.g. 4096 bytes). This > works nicely for 16 bit stereo samples but breaks when using 24 bit > samples. > > This patch aligns the buffer using pa_frame_align(). > --- > Â src/modules/module-pipe-sink.c | 4 ++-- > Â 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/src/modules/module-pipe-sink.c b/src/modules/module-pipe-sink.c > index 0a3a4fc..0eefdf1 100644 > --- a/src/modules/module-pipe-sink.c > +++ b/src/modules/module-pipe-sink.c > @@ -123,7 +123,7 @@ static int process_render(struct userdata *u) { > Â Â Â Â Â pa_assert(u); > Â > Â Â Â Â Â if (u->memchunk.length <= 0) > -Â Â Â Â Â Â Â Â pa_sink_render(u->sink, pa_pipe_buf(u->fd), &u->memchunk); > +Â Â Â Â Â Â Â Â pa_sink_render(u->sink, pa_frame_align(pa_pipe_buf(u->fd), &u->sink->sample_spec), &u->memchunk); > Â > Â Â Â Â Â pa_assert(u->memchunk.length > 0); > Â > @@ -301,7 +301,7 @@ int pa__init(pa_module *m) { > Â > Â Â Â Â Â pa_sink_set_asyncmsgq(u->sink, u->thread_mq.inq); > Â Â Â Â Â pa_sink_set_rtpoll(u->sink, u->rtpoll); > -Â Â Â Â pa_sink_set_max_request(u->sink, pa_pipe_buf(u->fd)); > +Â Â Â Â pa_sink_set_max_request(u->sink, pa_frame_align(pa_pipe_buf(u->fd), &u->sink->sample_spec)); > Â Â Â Â Â pa_sink_set_fixed_latency(u->sink, pa_bytes_to_usec(pa_pipe_buf(u->fd), &u->sink->sample_spec)); > Â > Â Â Â Â Â u->rtpoll_item = pa_rtpoll_item_new(u->rtpoll, PA_RTPOLL_NEVER, 1); Thanks, looks otherwise good, but the pa_sink_set_fixed_latency() call needs to be updated too. I'll apply this anyway, and make a fixup patch. --Â Tanu