[hpsdr] ghpsdr on Fedora

Lars E. Pettersson lars at homer.se
Mon May 11 13:00:08 PDT 2009


On 05/11/2009 12:30 AM, Lars E. Pettersson wrote:
> I got a couple of "process_ozy_input_buffer: did not find sync" 
> (somewhat above 100), followed by a bunch of "ozy_ringbuffer_put: 
> space=1 wanted=64" (almost 200 of those). Sometimes it lasted 5-10 
> minutes before dying, sometimes it died directly after starting it.
> 
> After some reading of the code, and some simple tests, I found a 
> solution to the symptoms above, but not a cure for the illness though... 
> :-)  The quick and dirty fix was:

The proper bug fix is to move pthread_mutex_lock() to the beginning of 
ozy_ringbuffer_put(), see below.

This fixes the problem with the program dying for me, after sync errors. 
The audio drop outs etc. are still there, but the program at least 
continuous to run. Hopefully the new FPGA software will fix this, when 
it is released.

73 de Lars, sm6rpz

[lars at localhost ghpsdr]$ svn diff ozy_ringbuffer.c
Index: ozy_ringbuffer.c
===================================================================
--- ozy_ringbuffer.c	(revision 1037)
+++ ozy_ringbuffer.c	(working copy)
@@ -83,6 +83,9 @@
  */
  int ozy_ringbuffer_put(struct ozy_ringbuffer* buffer,char* f,int n) {
      int bytes;
+
+    pthread_mutex_lock(&ozy_output_buffer_mutex);
+
      bytes=n;
      if(ozy_ringbuffer_space(buffer)<=n) {
  fprintf(stderr,"ozy_ringbuffer_put: space=%d 
wanted=%d\n",ozy_ringbuffer_space(buffer),n);
@@ -90,8 +93,6 @@
      }
      ozy_put_bytes+=bytes;

-    pthread_mutex_lock(&ozy_output_buffer_mutex);
-
      if(bytes>0) {

          if((buffer->insert_index+bytes)<=buffer->size) {
[lars at localhost ghpsdr]$

-- 
Lars E. Pettersson <lars at homer.se>
http://www.sm6rpz.se/

 1242072008.0


More information about the Hpsdr mailing list