[hpsdr] Audio resampler

Bryan Rambo bryanr at bometals.com
Sat Jun 10 09:51:58 PDT 2017


Hi Alan,
 
Very interesting all!  I agree with your comment about getting in trouble if your requested PortAudio buffer size happens to be different from the sound-device driver's buffer size.  That forces PA to adapt between the two buffer sizes causing the aperiodic behavior you mentioned below.  It's easy for a VAC1 user to get himself into that mess by choosing the wrong value in the "Buffer Size" comboBox and making things sound bad.  Passing paFramesPerBufferUnspecified to PA (as in Thetis) solves that problem but potentially creates another one by allowing PA to vary the buffer size from callback-to-callback.
 
I recently found an interesting post in the PortAudio list archives where Ross Bencina himself admitted to not using paFramesPerBufferUnspecified when running pro-audio live sound gigs.  He just makes damn sure his buffer sizes match :-)
 
Thanks for your post -  lots of food for thought there.
 
73, Bryan W4WMT

  _____  

From: Hpsdr [mailto:hpsdr-bounces at lists.openhpsdr.org] On Behalf Of Alan Hopper
Sent: Saturday, June 10, 2017 9:35 AM
To: hpsdr at openhpsdr.org
Subject: [hpsdr] Audio resampler



Hi List

 <SNIP> 


One pit I fell into was requesting a buffer size from portaudio audio different to its preferred size, if the buffer requested is smaller than the actual audio buffer size the portaudio callback is called in bursts, this can cause a subtle error in reading the audio clock rate as the thread producing the audio will statistically capture a clock reading more often between bursts which will cause the filtered frequency to read high.�� Letting Portaudio choose the buffer size fixed this.




Before I solved this issue I had tried a number of ways of filtering the very jittery clock data you get packet by packet including iir filters, delay locked loop, Kalman, moving linear regression and moving average, I suspect they all would have worked but as I happened to be using the moving average at the point I fixed the above problem and it all started working, I stuck with it.�� I���m currently moving this code from c# to c++ and shall go back and re try the other options.

< SNIP> 





73 Alan M0NNB

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openhpsdr.org/pipermail/hpsdr-openhpsdr.org/attachments/20170610/77f7d51a/attachment.htm>


More information about the Hpsdr mailing list