[pulseaudio-discuss] Question regarding usage of pa_stream_peek() and pa_stream_drop()

Tanu Kaskinen tanu.kaskinen at linux.intel.com
Tue Nov 19 00:19:57 PST 2013

On Tue, 2013-11-19 at 06:05 +0000, nimesh.chanchani at accenture.com wrote:
> Hi Tanu,
> I recorded with 8000 hz mono, to reduce the file size. its uploaded.
> http://www.filedropper.com/28_4 ( < 1 MB)

Is the sample format unsigned 8 bit? Do you get better audio quality if
you record the audio with parecord instead of your own software?

> ________________________________________
> From: Tanu Kaskinen [tanu.kaskinen at linux.intel.com]
> Sent: Monday, November 18, 2013 12:09 PM
> To: Chanchani, Nimesh
> Cc: pulseaudio-discuss at lists.freedesktop.org
> Subject: Re: [pulseaudio-discuss] Question regarding usage of pa_stream_peek() and pa_stream_drop()

> > "void PulseAudioClient::Read()" is the function to lookout for. This
> > is still a test code , so please excuse the inefficiencies.
> Read() doesn't lock the mainloop properly. You need to lock it whenever
> you access objects outside the mainloop thread. Read() accesses the
> stream object for the first time in the pa_stream_cork() call.
> Nimesh>>Thanks for pointing that out. But there is a strange thing that i notice, after I lock the mainloop before calling pa_stream_cork().
> The Flush function , doesn't receive a succede  callback , and I keep waiting in the while loop.
> , if I move the mainloop lock to its original position in the code , i get the flush succede callback.

(You are probably using Outlook as your mail client. Outlook has the
option to prefix quoted lines with ">", please turn that option on. It
makes it much much easier to read inline comments.)

While you wait in the while loop, I presume you have the mainloop
locked? When the mainloop is locked, no code runs in the mainloop
thread, so it's no wonder that nothing is happening.


More information about the pulseaudio-discuss mailing list