Linrad 4.07 on MAC OS X 10.11 El Capitan

799 views
Skip to first unread message

al...@4z5lv.net

unread,
Nov 26, 2015, 5:11:11 PM11/26/15
to Linrad
Hello All!
Trying to compile xlinrad64 on MAC OS X Macbook pro, ./configure seams to be OK, reporting some missing libraries including libasound for 64-bit.
But I suppose aslsa sound is not used on MAC OS.
When I try to run:

make xlinrad64, I have the next error:

bash-3.2$ make xlinrad64

gcc -D_FILE_OFFSET_BITS=64 xmain.c -I/usr/X11R6/include  -g -O2 -DOSNUM=1 -I/usr/X11R6/include -I/usr/X11R6/include -I/usr/X11/include -I/usr/X11/include  -W -Wall -DCPU=CPU_INTEL -DSHM_INSTALLED=1 -DIA64=1 -DDARWIN=1 -DSERVER=0 -Wimplicit -Wreturn-type -Wformat -m64 -Wunused -Wcomment -Wchar-subscripts -Wshadow -Wuninitialized -Wparentheses -Wstrict-prototypes -Werror -ffast-math -Wundef -fomit-frame-pointer -c -o xmain.om

gcc -D_FILE_OFFSET_BITS=64 ui.c -g -O2 -DOSNUM=1 -I/usr/X11R6/include -I/usr/X11R6/include -I/usr/X11/include -I/usr/X11/include  -W -Wall -DCPU=CPU_INTEL -DSHM_INSTALLED=1 -DIA64=1 -DDARWIN=1 -DSERVER=0 -Wimplicit -Wreturn-type -Wformat -m64 -Wunused -Wcomment -Wchar-subscripts -Wshadow -Wuninitialized -Wparentheses -Wstrict-prototypes -Werror -ffast-math -Wundef -fomit-frame-pointer -c -o ui.om

In file included from ui.c:54:

./loadalsa.h:137:5: error: '__BYTE_ORDER' is not defined, evaluates to 0 [-Werror,-Wundef]

#if __BYTE_ORDER == __LITTLE_ENDIAN

    ^

./loadalsa.h:137:21: error: '__LITTLE_ENDIAN' is not defined, evaluates to 0 [-Werror,-Wundef]

#if __BYTE_ORDER == __LITTLE_ENDIAN

                    ^

2 errors generated.

make: *** [ui.om] Error 1

bash-3.2$  

As I can understand it tries to compile alsa code, why?

Any suggestions?

73!
Alex

Leif Asbrink

unread,
Nov 26, 2015, 5:44:16 PM11/26/15
to lin...@googlegroups.com
Hello Alex,

Linrad does not try to compile alsa, it just wants to have all
the defines right in case the user decides that the alsa library
should be loaded.

I have made defines in the header file, please try it and tell me if
it works.

73

Leif







> Trying to compile xlinrad64 on MAC OS X Macbook pro, ./configure seams to
> be OK, reporting some missing libraries including libasound for 64-bit.
> But I suppose aslsa sound is not used on MAC OS.
> When I try to run:
>
> make xlinrad64, I have the next error:
>
> bash-3.2$ make xlinrad64
>
> gcc -D_FILE_OFFSET_BITS=64 xmain.c -I/usr/X11R6/include -g -O2 -DOSNUM=1
> -I/usr/X11R6/include -I/usr/X11R6/include -I/usr/X11/include
> -I/usr/X11/include -W -Wall -DCPU=CPU_INTEL -DSHM_INSTALLED=1 -DIA64=1
> -DDARWIN=1 -DSERVER=0 -Wimplicit -Wreturn-type -Wformat -m64 -Wunused
> -Wcomment -Wchar-subscripts -Wshadow -Wuninitialized -Wparentheses
> -Wstrict-prototypes -Werror -ffast-math -Wundef -fomit-frame-pointer -c -o
> xmain.om
>
> gcc -D_FILE_OFFSET_BITS=64 ui.c -g -O2 -DOSNUM=1 -I/usr/X11R6/include
> -I/usr/X11R6/include -I/usr/X11/include -I/usr/X11/include -W -Wall
> -DCPU=CPU_INTEL -DSHM_INSTALLED=1 -DIA64=1 -DDARWIN=1 -DSERVER=0 -Wimplicit
> -Wreturn-type -Wformat -m64 -Wunused -Wcomment -Wchar-subscripts -Wshadow
> -Wuninitialized -Wparentheses -Wstrict-prototypes -Werror -ffast-math
> -Wundef -fomit-frame-pointer -c -o ui.om
>
> In file included from ui.c:54:
>
> *./loadalsa.h:137:5: **error: **'__BYTE_ORDER' is not defined, evaluates to
> 0 [-Werror,-Wundef]*
>
> #if __BYTE_ORDER == __LITTLE_ENDIAN
>
> * ^*
>
> *./loadalsa.h:137:21: **error: **'__LITTLE_ENDIAN' is not defined,
> evaluates to 0 [-Werror,-Wundef]*
>
> #if __BYTE_ORDER == __LITTLE_ENDIAN
>
> * ^*
>
> 2 errors generated.
>
> make: *** [ui.om] Error 1
> bash-3.2$
>
> As I can understand it tries to compile alsa code, why?
>
> Any suggestions?
>
> 73!
> Alex
>
> --
> You received this message because you are subscribed to the Google Groups "Linrad" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to linrad+un...@googlegroups.com.
> To post to this group, send email to lin...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
loadalsa.h

al...@4z5lv.net

unread,
Nov 27, 2015, 10:10:36 AM11/27/15
to Linrad
Lejf, 
Thanks, with the new header  the first issue was solved, the second one in the next file lseatd.h

gcc -D_FILE_OFFSET_BITS=64 lsetad.c -DALSA_LIBNAME=\"libasound.dylib\" -g -O2 -DOSNUM=1 -I/usr/X11R6/include -I/usr/X11R6/include -I/usr/X11/include -I/usr/X11/include  -W -Wall -DCPU=CPU_INTEL -DSHM_INSTALLED=1 -DIA64=1 -DDARWIN=1 -DSERVER=0 -Wimplicit -Wreturn-type -Wformat -m64 -Wunused -Wcomment -Wchar-subscripts -Wshadow -Wuninitialized -Wparentheses -Wstrict-prototypes -Werror -ffast-math -Wundef -fomit-frame-pointer -c -o lsetad.om
lsetad.c:1405:20: error: use of undeclared identifier 'EBADFD'
        if(err == -EBADFD)

I edited in lsetad.c the definition  EBADFD to EBADF
So with this correction linrad continue to compile till the next problem:

gcc -D_FILE_OFFSET_BITS=64 hid.c -DUDEV_LIBNAME=\"libudev.dylib\" -g -O2 -DOSNUM=1 -I/usr/X11R6/include -I/usr/X11R6/include -I/usr/X11/include -I/usr/X11/include  -W -Wall -DCPU=CPU_INTEL -DSHM_INSTALLED=1 -DIA64=1 -DDARWIN=1 -DSERVER=0 -Wimplicit -Wreturn-type -Wformat -m64 -Wunused -Wcomment -Wchar-subscripts -Wshadow -Wuninitialized -Wparentheses -Wstrict-prototypes -Werror -ffast-math -Wundef -fomit-frame-pointer -c -o hid.om

hid.c:857:10: fatal error: 'linux/types.h' file not found

#include <linux/types.h>


I continue to look for solution, by the way for MAC OS there is special hid.c function that does not use libusb, but IOKit and CoreFoundation


73!

Alex

al...@4z5lv.net

unread,
Nov 27, 2015, 12:43:35 PM11/27/15
to Linrad
Finally, after some debugging  I have Linrad 4.07 successfully compiled and working on MAC OS X El Capitan.

1. Network connection is working fine now, 
2. USB Audio mode - no I/Q signals from AFEDRI USB, but I do not think it is Linrad issue.

I will publish here in group instructions HOW-TO later, need more time to find / try more simple and optimal algorithm.
For example usage of MAC OS native HID support cancels need to use Linux libudev library, and working fine.

 73!
Alex

On Friday, November 27, 2015 at 12:11:11 AM UTC+2, al...@4z5lv.net wrote:

Leif Asbrink

unread,
Nov 27, 2015, 6:49:30 PM11/27/15
to lin...@googlegroups.com
Hello Alex,

Excellent:-)

Can you please pull the current development version from
the repo:
svn checkout https://svn.code.sf.net/p/linrad/code/trunk linrad

The ENDIAN and EBADFD problems should be fixed already in that
version. Please do the remaining changes needed and send the
files you have changed to me. I will check that they compile
un my systems and then incorporate them and upload on the repo.

If you want to make improvements for MAC OS X like native HID,
please use:
#if DARWIN == 0
.
linux code
.
#endif

or
#if DARWIN == 1
.
MAX OSX code
.
#endif

For USB audio I think Portaudio should work.

73

Leif
> > *./loadalsa.h:137:5: **error: **'__BYTE_ORDER' is not defined, evaluates
> > to 0 [-Werror,-Wundef]*
> >
> > #if __BYTE_ORDER == __LITTLE_ENDIAN
> >
> > * ^*
> >
> > *./loadalsa.h:137:21: **error: **'__LITTLE_ENDIAN' is not defined,
> > evaluates to 0 [-Werror,-Wundef]*
> >
> > #if __BYTE_ORDER == __LITTLE_ENDIAN
> >
> > * ^*
> >
> > 2 errors generated.
> >
> > make: *** [ui.om] Error 1
> > bash-3.2$
> >
> > As I can understand it tries to compile alsa code, why?
> >
> > Any suggestions?
> >
> > 73!
> > Alex
> >
>

al...@4z5lv.net

unread,
Nov 28, 2015, 2:26:04 PM11/28/15
to Linrad
Below you can find changes that have to be applied to linrad-04.07 sourc code to be
compiled under MAC OS X El Capitan, affcted files list:
    loadalsa.h
    lsetad.c
    hidmac.c (new file)
    Makefile.in
    afedri.c
    fcdpp.c
    configure.in
1. According Leif's example:
Before the first meet of __BYTE_ORDER (at line number 136)
Insert into loadalsa.h next definitions:

    #ifndef __BYTE_ORDER
    #define __BYTE_ORDER 1234
    #endif

    #ifndef __LITTLE_ENDIAN
    #define __LITTLE_ENDIAN 1234
    #endif

2. In file lsetad.c insert next definitions (on line number 50):
   #ifndef EBADFD
    #define EBADFD EBADF
   #endif

3.  Copy to linrad directory hidmac.c file
4.
  Edit Makefile.in
  Add next text to line 46:

  ifneq ($(OS),Windows_NT)
      OS=$(shell uname)
  endif
  ifeq ($(OS), Darwin)
      LIBMACOSX   = -framework IOKit -framework CoreFoundation
  endif

replace on line 190 text:
  HID=hid.c hidapi.h

  by new tet:
  ifeq ($(OS), Darwin)
  HID=hidmac.c hidapi.h
  else
  HID=hid.c hidapi.h
  endif

replace on line 1966:

  -lpthread @LIBRT@ -lm -ldl $(LIBMACOSX)

replace on line 2168 text:
  hid.om: $(HID)
          $(LCC) hid.c -DUDEV_LIBNAME=\"@LIBUDEV_64_LD@\" $(CFL64) hid.om

  by the new text:
  ifeq ($(OS), Darwin)
  hid.om: $(HID)
          $(LCC) hidmac.c $(CFL64) hid.om -Wno-unused-parameter
  else
  hid.om: $(HID)
          $(LCC) hid.c -DUDEV_LIBNAME=\"@LIBUDEV_64_LD@\" $(CFL64) hid.om
  endif

5. Edit file fcdpp.c and change every #if line before line containing the function load_udev_library()
   to next text (lines: 201, 222, 245, 726):
   #if OSNUM == OSNUM_LINUX && defined(__linux__)

6. Edit file afedri.c  and change every #if line before line containing the function load_udev_library()
    to next text (lines: 306, 440, 553):
    #if OSNUM == OSNUM_LINUX && defined(__linux__)

7.
  In configure.in file find text (line 630):
  ST="-no_pie "
and replace it by
  ST="-Wl,-no_pie"

8.  Now you can try to compile Linrad
  ./autoconf
  ./configure
  make xlinrad64

You can download full linrad-04.07-mac archive that ready to compile and for reference here: http://afedri-sdr.com/index.php/downloads/category/24-source-code-directory?download=232:linrad-4-07-adopted-for-mac-os-x-el-capitan

al...@4z5lv.net

unread,
Nov 28, 2015, 2:37:36 PM11/28/15
to Linrad
Leif,
My apologies that I am working on some obsolete version, but I suppose it can help in any case.

By the way when tested linrad 4.07 on Windows I have found that there is compilation error in help.c file.
when I compile it on Windows 7 64-bit with MinGW 32 bit, next line gives error (and I agree with it):

ipa=(int*)(void*)&fptr_pa;
ipa[0]=(int)FileInformation.nFileSizeLow;
ipa[1]=(int)FileInformation.nFileSizeHigh;


I replaced it by next code:
ipa=(int*)(void*)&fptr_pa;
fptr_pa = (uint64_t)FileInformation.nFileSizeLow | ((uint64_t)FileInformation.nFileSizeHigh) <<32;

--------------------------------------------------------------------------------------------------------------------------
73!


al...@4z5lv.net

unread,
Nov 28, 2015, 2:50:53 PM11/28/15
to Linrad
In connection to USB Audio connection - no problem with compilation, but I have no success to get data ("sound") from sound card on MAC OS X El Capitan, there is some warning message:

This application, or a library it uses, is using the deprecated Carbon Component Manager for hosting Audio Units. Support for this will be removed in a future release. Also, this makes the host incompatible with version 3 audio units. Please transition to the API's in AudioComponent.h.

al...@4z5lv.net

unread,
Nov 28, 2015, 3:17:46 PM11/28/15
to Linrad
Leif,
I've just tested your latest code from repository,  so can give you some more actual report:
paragraphs 1 and 2 is solved in your current code, stil have to be somehow implemented all other paragraphs, next files have to be modified for compilation:
    hidmac.c (new file)
    Makefile.in
    afedri.c
    fcdpp.c
    configure.in

My previous description beginning paragraph 3 have to be implemented somehow.

USB Audio - still no data - I suppose it is portaudio problem because Apple  changed Audio API in the new OS.

73!
Alex

Leif Asbrink

unread,
Nov 28, 2015, 6:52:55 PM11/28/15
to lin...@googlegroups.com
Hi Alex,

I do not know what is wrong with the original code, but I have adapted your
suggestion and also remover ipa which is no longer needed.

I am surprised you did not report more errors of this kind because
I think I have used similar "tricks" at several other places.

73

Leif

Leif Asbrink

unread,
Nov 28, 2015, 7:00:51 PM11/28/15
to lin...@googlegroups.com
Hi Alex,

This can not be a Linrad problem, it must be something with Portaudio.

I have no idea how complicated it might be to add code for using the
native sound system of OS X. Probably not worth the trouble....

73

Leif

Leif Asbrink

unread,
Nov 28, 2015, 8:16:45 PM11/28/15
to lin...@googlegroups.com
Hello Alex,

> compiled under MAC OS X El Capitan, affcted files list:
>
> loadalsa.h
>
> lsetad.c
>
> hidmac.c (new file)
OK.

> Makefile.in
The header files rusage.h thrdef.h are needed in SI570 under Linux.
I have put them back. In case they create a problem, an if statement
would be needed.

The header file conf.h is needed in WCW if there is a problem under OS X
an if statement would be needed.

Your modifications are for xlinrad64 only. I have added the corresponding
modifications for the other 5 Linux versions.

> afedri.c
OK. (reset UDP bits to 16 as default)

> fcdpp.c
OK.

> configure.in
Restored changes on 04.07 for ELAD.


Please pull the latest from the repo. I have made the above changes
and verified compilation on 32 and 64 bit linux as well as windows.
(Yes, 64 bit windows works now, but several dll files are missing.)

73

Leif

al...@4z5lv.net

unread,
Nov 29, 2015, 4:33:35 PM11/29/15
to Linrad
Hello Leif,
I've just tested latest source from repository, there is only one problem - hidmac.c file is missed in your source :-)

 Everything else seams to be OK, no error during compilation (excluding hidmac.c absence).


 Still no data input  from sound card, not from USB Audio AFEDRI, nor from embedded sound card.
I can suppose it is the problem of some changes inside El Capitan, Apple likes to make non pleasant changes to API.
And information is not so available as for Linux.

73!
Alex

al...@4z5lv.net

unread,
Nov 29, 2015, 4:55:50 PM11/29/15
to Linrad
By the way to run port on my MAC I am using Homebrew package instead of Macports.

Leif Asbrink

unread,
Nov 29, 2015, 6:33:59 PM11/29/15
to lin...@googlegroups.com
Hello Alex,

> I've just tested latest source from repository, there is only one problem -
> hidmac.c file is missed in your source :-)
Oooh! forgot I had to run "svn add" before "svn commit"
Should be OK now.

> Still no data input from sound card, not from USB Audio AFEDRI, nor from
> embedded sound card.
> I can suppose it is the problem of some changes inside El Capitan, Apple
> likes to make non pleasant changes to API.
> And information is not so available as for Linux.

This seems to be a known problem:
https://www.assembla.com/spaces/portaudio/tickets/243-portaudio-support-for-os-x-10-11-el-capitan/details#

73

Leif

al...@4z5lv.net

unread,
Nov 30, 2015, 8:26:41 AM11/30/15
to Linrad


I will try to study this problem more carefully, but no promise any results.
I am beginner in MAC OS X, in addition suppose there is not much interest from users to Apple product in this area,

al...@4z5lv.net

unread,
Dec 1, 2015, 12:47:53 PM12/1/15
to Linrad
Leif,
I've just tested your last repository - have not found any problem, all compilation process is OK.
Thanks for the support!

P.S. I suppose, that soon Apple will decide to change little bit something in it's API or XCode and the new problem will be created.

73!
Alex 


On Monday, November 30, 2015 at 1:33:59 AM UTC+2, SM5BSZ wrote:

al...@4z5lv.net

unread,
Dec 1, 2015, 5:36:07 PM12/1/15
to Linrad
Leif,
I tested portaudio interface with AFEDRI using one of examples from portaudio package and it seams that,
despite warning message about API that will be deprecated in the future,  I can get Audio data stream from SDR on MAC OS X El Capitan and successfully decode it.
So I suppose   the no data from sound card problem sitting somewhere inside Linrad code.
Please advice where in your source tree I can check sound card input procedures and how received data transferred further for processing.

May be there is some memory access conflict in MAC OS?

73!
Alex

On Monday, November 30, 2015 at 1:33:59 AM UTC+2, SM5BSZ wrote:

Leif Asbrink

unread,
Dec 1, 2015, 8:47:37 PM12/1/15
to lin...@googlegroups.com
Hi Alex,

> I tested portaudio interface with AFEDRI using one of examples from
> portaudio package and it seams that,
> despite warning message about API that will be deprecated in the future, I
> can get Audio data stream from SDR on MAC OS X El Capitan and successfully
> decode it.
> So I suppose the no data from sound card problem sitting somewhere inside
> Linrad code.
OK.

> Please advice where in your source tree I can check sound card input
> procedures and how received data transferred further for processing.
How far do you get? Can you do the setup and select portaudio?
Does the Afedri show up correctly on the list of audio devices?

When you then exit to the main menu and save and after that go
to a processing menu, do you see "no input" in the lower left corner
of the screen or is perhaps the data zero in which case you would see
the correct speed when pressing 'T'

> May be there is some memory access conflict in MAC OS?
I do not think so. Maybe Linrad uses functions that are not
supported under MAC OS?

Portaudio is in pa.c and functions in there are called from
lsetad.c during setup and from menu.c before entering a receive
mode.

I suggest you enable DUMPFILE in options.h and then send
the files 'dmp' and 'soundboard_rx_init.log to me.

73

Leif

al...@4z5lv.net

unread,
Dec 2, 2015, 11:35:38 AM12/2/15
to Linrad
Lief,
Sound card configuration is working OK, no any problem.
Problem appears when I entering to RX mode (for example FM) pressing "E" key (or other for other demodulation mode).
There is no data on waterfall and No input with number that counts up message in the bottom left part of screen.
I am attaching to this message the two screenshots , dump and log file you requested.

73!
Alex
Screen Shot 2015-12-02 at 18.21.29.png
SDRConsole (V2).desktop
dmp
soundboard_rx_init.log

al...@4z5lv.net

unread,
Dec 2, 2015, 12:25:44 PM12/2/15
to Linrad
Sorry, one attached image is wrong  - script to start SDR Console using wine.
Here is correct image.

73!
Alex
Screen Shot 2015-12-02 at 18.27.07.png

al...@4z5lv.net

unread,
Dec 3, 2015, 9:16:29 AM12/3/15
to Linrad
Leif,
Short report of my researches - why there is no Sound card input on MAC.
I maid next steps (all inside pa.c file):
1. In function rxadCallback(....)
    I insert command that sends input data to stdout: fwrite(inputBuffer,4, framesToProcess, stdout);fflush(stdout);
    So I can store input sound card data and analyse it.
    The result is next - linrad receives sound card data in this callback function. If I send stdout to file, I can successfully decode stored in this raw data   using external decoder. 
    But Linrad still shows no waterfall and prints No input message
2. I put additional "patch" into rxadCallback(....)
if(snd[RXAD].open_flag != CALLBACK_CMD_ACTIVE)
  {
  if(snd[RXAD].open_flag == CALLBACK_CMD_START)
    {
    snd[RXAD].open_flag=CALLBACK_ANSWER_AWAKE;
    }
  if(snd[RXAD].open_flag == CALLBACK_ANSWER_AWAKE)
    {
    return paContinue;
    }
  snd[RXAD].open_flag=CALLBACK_ANSWER_CLOSED;
  return paAbort;
  }
   printf("rxad->%lu ",framesToProcess);fflush(stdout);
  Linrad - has never came to this point.

al...@4z5lv.net

unread,
Dec 3, 2015, 9:19:07 AM12/3/15
to Linrad
I forgot to add that input data dump function was put in the beginning of Callback function rxadCallback(....)

fwrite(inputBuffer,4, framesToProcess, stdout);fflush(stdout);
if(snd[RXAD].open_flag != CALLBACK_CMD_ACTIVE)
  {
  if(snd[RXAD].open_flag == CALLBACK_CMD_START)
    {
    snd[RXAD].open_flag=CALLBACK_ANSWER_AWAKE;
    }
  if(snd[RXAD].open_flag == CALLBACK_ANSWER_AWAKE)
    {
    return paContinue;
    }
  snd[RXAD].open_flag=CALLBACK_ANSWER_CLOSED;
  return paAbort;
  }
  printf("rxad->%lu ",framesToProcess);fflush(stdout);
  Linrad - has never came to this point.

Leif Asbrink

unread,
Dec 3, 2015, 11:01:41 AM12/3/15
to lin...@googlegroups.com
Hi Alex,

What is the value of snd[RXAD].open_flag ?

globdef.h:#define CALLBACK_CMD_START 3
globdef.h:#define CALLBACK_ANSWER_AWAKE 2
globdef.h:#define CALLBACK_CMD_ACTIVE 1
globdef.h:#define CALLBACK_CMD_CLOSE 0
globdef.h:#define CALLBACK_ANSWER_CLOSED -1
globdef.h:#define CALLBACK_ERROR -2

- leif -



>
> I forgot to add that input data dump function was put in the beginning of Callback function *rxadCallback*(....)
>
>
> *fwrite(inputBuffer,4, framesToProcess, stdout);fflush(stdout);*
>
> if(snd[RXAD].open_flag != CALLBACK_CMD_ACTIVE)
>
> {
>
> if(snd[RXAD].open_flag == CALLBACK_CMD_START)
>
> {
>
> snd[RXAD].open_flag=CALLBACK_ANSWER_AWAKE;
>
> }
>
> if(snd[RXAD].open_flag == CALLBACK_ANSWER_AWAKE)
>
> {
>
> return paContinue;
>
> }
>
> snd[RXAD].open_flag=CALLBACK_ANSWER_CLOSED;
>
> return paAbort;
>
> }
>
> *printf("rxad->%lu ",framesToProcess);fflush(stdout);*
>
> * Linrad - has never came to this point.*
>
>
> On Thursday, December 3, 2015 at 4:16:29 PM UTC+2, al...@4z5lv.net wrote:
> >
> > Leif,
> > Short report of my researches - why there is no Sound card input on MAC.
> > I maid next steps (all inside pa.c file):
> > 1. In function *rxadCallback*(....)
> > I insert command that sends input data to stdout: *fwrite(inputBuffer,4,
> > framesToProcess, stdout);fflush(stdout);*
> > So I can store input sound card data and analyse it.
> > The result is next - linrad receives sound card data in this callback
> > function. If I send stdout to file, I can successfully decode stored in
> > this raw data using external decoder.
> > But Linrad still shows no waterfall and prints *No input* message
> > 2. I put additional "patch" into rxadCallback(....)
> >
> > if(snd[RXAD].open_flag != CALLBACK_CMD_ACTIVE)
> >
> > {
> >
> > if(snd[RXAD].open_flag == CALLBACK_CMD_START)
> >
> > {
> >
> > snd[RXAD].open_flag=CALLBACK_ANSWER_AWAKE;
> >
> > }
> >
> > if(snd[RXAD].open_flag == CALLBACK_ANSWER_AWAKE)
> >
> > {
> >
> > return paContinue;
> >
> > }
> >
> > snd[RXAD].open_flag=CALLBACK_ANSWER_CLOSED;
> >
> > return paAbort;
> >
> > }
> >
> > * printf("rxad->%lu ",framesToProcess);fflush(stdout);*
> >
> > * Linrad - has never came to this point.*

al...@4z5lv.net

unread,
Dec 3, 2015, 11:22:09 AM12/3/15
to Linrad
Hi Lef,
After initial changes It hangs in CALLBACK_ANSWER_AWAKE state
73!

Leif Asbrink

unread,
Dec 3, 2015, 1:32:54 PM12/3/15
to lin...@googlegroups.com
Hi Alex,

> After initial changes It hangs in CALLBACK_ANSWER_AWAKE state

That means that this code was never executed:
void open_portaudio_rxad(void)
{
PaStreamParameters rxadParameters;
const PaStreamInfo *streamInfo;
PaError pa_err;
#if (OSNUM == OSNUM_WINDOWS)
const PaDeviceInfo *deviceInfo;
int i;
PaWasapiStreamInfo LinradWasapiStreaminfo;
CoInitialize(NULL);
#endif
snd[RXAD].open_flag=CALLBACK_CMD_START;

Please verify this. It would mean that open_portaudio_rxad was
never called from lsetad.c

Presumably open_rx_sndin() is never called, check for that in lsetad.c

The reason is probably that thread_rx_adinput in lsetad.c is hanging
on something so it never reaches sys_func(THRFLAG_OPEN_RX_SNDIN);
which generates a call to open_rx_sndin()

Probably the screen thread is hanging on something.

The call to fix_prio (get higher thread priority) does
nothing unless you have asked for elevated priority in the
first setup. Make sure you have Process priority [0] in par_userint.

73

Leif
> > an email to linrad+un...@googlegroups.com <javascript:>.
> > > To post to this group, send email to lin...@googlegroups.com
> > <javascript:>.

al...@4z5lv.net

unread,
Dec 3, 2015, 2:29:53 PM12/3/15
to Linrad
Leif,
the problem that 
open_rx_sndin()  as well as open_portaudio_rxad() both called.
Once after I choose modulation (FM in my case) i.e. press "E" from main menu.
 
Process priority [0] is 0 in par_userint

Any idea?

73!
Alex

al...@4z5lv.net

unread,
Dec 3, 2015, 3:44:34 PM12/3/15
to Linrad
By the way, I see that status:
snd[RXAD].open_flag=CALLBACK_CMD_START; 

also defined in test_rxad() function, so question is when it is called in linrad?

al...@4z5lv.net

unread,
Dec 3, 2015, 3:59:02 PM12/3/15
to Linrad
Sorry I meant:

that status:
snd[RXAD].open_flag=CALLBACK_CMD_ACTIVE;

appears only in test_txad() function

Leif Asbrink

unread,
Dec 5, 2015, 5:20:50 PM12/5/15
to lin...@googlegroups.com
Hi Alex,

> Sorry I meant:
>
> that status:
> snd[RXAD].open_flag=CALLBACK_CMD_ACTIVE;
>
> appears only in test_txad() function
Yes. That flag is used while setting up the Tx. The idea is to
have the input running so the user can not select the same
input for microphone and if he selects the same sounccard for
Tx output, the sampling rate may be locked to whatever speed
the input is running at.

73

Leif





>
>
>
> On Thursday, December 3, 2015 at 10:44:34 PM UTC+2, al...@4z5lv.net wrote:
> >
> > By the way, I see that status:
> > snd[RXAD].open_flag=CALLBACK_CMD_START;
> >
>
>

al...@4z5lv.net

unread,
Dec 5, 2015, 5:45:31 PM12/5/15
to Linrad
Leif,
I need your idea where to look for the problem, portaudio successfully get I/Q data from sound card, but Linrad is hanging up in No Input state.

By the way it was my misprint, I wanted to ask about 

snd[RXAD].open_flag=CALLBACK_CMD_ACTIVE; 
appears only in test_rxad() function 

I lost any understanding what is the first step what is the second and where which functions are called... :-(

73!
Alex

Leif Asbrink

unread,
Dec 5, 2015, 6:44:58 PM12/5/15
to lin...@googlegroups.com
Hi Alex,

> the problem that
> open_rx_sndin() as well as open_portaudio_rxad() both called.
> Once after I choose modulation (FM in my case) i.e. press "E" from main
> menu.
>
> Process priority [0] is 0 in par_userint

Oooh!! You have detected a bug. Portaudio did not work under linux.
Seems I had some problem under windows and added some waiting but forgot
to set the flag under linux.

Please try the latest on the repo.

73

Leif

al...@4z5lv.net

unread,
Dec 6, 2015, 3:45:46 AM12/6/15
to Linrad
Hello Leif,
I've just compiled your last repository code - everything is OK now with USB connection too.
Linrad is compiled and working fine now under MAC OS X El Capitan.

It seams that bug was solved.
Many thanks for the support.

73!
Alex

Tamir Rosenberg

unread,
Oct 16, 2016, 2:53:07 PM10/16/16
to Linrad
Hi,

Is the any place that i can find the guidance on how to install/make the Linrad on Mac OS El Capitan?
I downloaded the latest linrad-04.07.mac.zip and tried to "make" it.
I got an error that fb.h is missing. even when i added it manually, i'm still getting other errors.
I'm using a USB RTL-SDR v3.
Thanks in advanced for any help.
73,
Tamir
N1UQ

Leif Asbrink

unread,
Oct 16, 2016, 8:13:41 PM10/16/16
to lin...@googlegroups.com
Hello Tamir,

linrad-04.07 is very old. The latest released version 04.10 also.

Get the latest version from the repo with this command:
svn checkout https://svn.code.sf.net/p/linrad/code/trunk linrad
(will create subdirectory linrad with the latest version in it.)

Run ./configure --with_help. Cut and paste commands to install
X11
alsa
libusb-1.0
librtlsdr.so

You can ignore other missing packages. (I think.)

As you will see, there are no specific instructions for MAC OS X.
If you find that something else is needed, perhaps you need
portaudio to get a sound system?

Others on this list know - but I do not have any MAC computer
so I do not.

I could add specific things for MAC to the configure script if
I were told what to add...

73

Leif
Reply all
Reply to author
Forward
0 new messages