pavels / spektrum

rtl-sdr spectrum analyzer
BSD 3-Clause "New" or "Revised" License
577 stars 91 forks source link

Hello! MasOS! #52

Open itan2105 opened 1 year ago

itan2105 commented 1 year ago

I would like to know how I can run a program on macos?

ewumnrr commented 11 months ago

You need to install Processing on the Mac first. Place the git repository under Documents/Processing/libraries, then rename the top directory to rtlspektrum. You will need to get several libraries and put them under: Documents/Processing/libraries/rtlspektrum/library The library directory should contain: bridj-0.7.0.jar dx-1.7.jar librtlpower.dylib librtlsdr.dylib rtlspektrum.jar

The libraries librtlsdr (and librtlpower) are not the original ones. The rtlspektrum project contains patched projects. Build them there. On the machine, you need to have libusb installed. If you have a Mac with ARM processor, be sure to stick with either all x86 or all arm64. For example if your libusb is x86, then everything needs to be x86. If you have an M1/M2 machine, it's better to compile everything for arm64. In particular if you build libraries, do this:

mkdir build cd build CMAKE_OSX_ARCHITECTURES=arm64 cmake ..

If libraries exist in brew, get them from there, but also get the arm64 version: instead of calling brew install xxx, enter: arch -arm64 brew install xxx

itan2105 commented 11 months ago

I'm not good at programming at all, but I tried your way, which you advised. And unfortunately it didn't work... It wouldn't be bad if someone who knows how to do all this would make an installation package for MAC OS. I think a very large number of people would be grateful...

ewumnrr commented 11 months ago

I'm not good at programming at all, but I tried your way, which you advised. And unfortunately it didn't work... It wouldn't be bad if someone who knows how to do all this would make an installation package for MAC OS. I think a very large number of people would be grateful...

What kind of Mac do you have? There are a few quirks with the spektrum Processing code: it doesn't work without a proper config file and the path to the file is bad in the code. It prepends the path with / which puts it in the root and Apple doesn't allow that. This is my config file: activeConfig,configName,startFreq,stopFreq,binStep,scaleMin,scaleMax,rfGain,minFreq,maxFreq,ifOffset,ifType,cropPrcnt 0,default1,118000000,142000000,10000,-45,-15,0,0,0,0,0,0 default2,default2,300000000," 400000000"," 20000"," -110"," 40"," 49.6"," 24000000"," 1800000000"," 0"," 0"," 0" default3,default3,300000000," 400000000"," 20000"," -110"," 40"," 49.6"," 24000000"," 1800000000"," 0"," 0"," 0" default4,default4,300000000," 400000000"," 20000"," -110"," 40"," 49.6"," 24000000"," 1800000000"," 0"," 0"," 0" default5,default5,300000000," 400000000"," 20000"," -110"," 40"," 49.6"," 24000000"," 1800000000"," 0"," 0"," 0" default6,default6,300000000," 400000000"," 20000"," -110"," 40"," 49.6"," 24000000"," 1800000000"," 0"," 0"," 0" default7,default7,300000000," 400000000"," 20000"," -110"," 40"," 49.6"," 24000000"," 1800000000"," 0"," 0"," 0" default8,default8,300000000," 400000000"," 20000"," -110"," 40"," 49.6"," 24000000"," 1800000000"," 0"," 0"," 0" default9,default9,300000000," 400000000"," 20000"," -110"," 40"," 49.6"," 24000000"," 1800000000"," 0"," 0"," 0" default10,default10,300000000," 400000000"," 20000"," -110"," 40"," 49.6"," 24000000"," 1800000000"," 0"," 0"," 0"

I put it into my home directory and changed the path in line 200 to the full path of that file, "/Users/xxx/config.csv"

itan2105 commented 11 months ago

yes, I have a mac M1. my mail aitygin@yahoo.com

jonathan-sturges commented 4 months ago

@ewumnrr can you please provide a link to the rtlspektrum project? I'm trying to build librtlpower.dylib but not having luck with the pavels/rtl-sdr project. thank you.

ewumnrr commented 4 months ago

@ewumnrr can you please provide a link to the rtlspektrum project? I'm trying to build librtlpower.dylib but not having luck with the pavels/rtl-sdr project. thank you. I did use this repository: https://github.com/pavels/rtl-sdr.git branch master (22fd16a) Documents/Processing/libraries/rtlspektrum/library: -rw-r--r-- 1 staff 942488 Oct 12 2023 bridj-0.7.0.jar -rw-r--r-- 1 staff 981817 Oct 12 2023 dx-1.7.jar -rwxr-xr-x 1 staff 69040 Oct 12 2023 librtlpower.dylib -rwxr-xr-x 1 staff 109870 Oct 12 2023 librtlsdr.dylib -rwxr-xr-x 1 staff 198527 Mar 26 17:35 libusb-1.0.dylib -rw-r--r-- 1 staff 19772 Oct 12 2023 rtlspektrum.jar I compiled everything for ARM (M1)

jonathan-sturges commented 4 months ago

I'm making progress building rtl-sdr on Mojave on x86_64. I updated the project with:

autoupdate -f
libtoolize
autoreconf

...and then it configured cleanly and tries to build. I am now getting hung up linking rtl_power:

  CC       rtl_power.o
  CCLD     rtl_power
Undefined symbols for architecture x86_64:
  "_bartlett", referenced from:
      _main in rtl_power.o
  "_blackman", referenced from:
      _main in rtl_power.o
  "_blackman_harris", referenced from:
      _main in rtl_power.o
  "_frequency_range", referenced from:
      _main in rtl_power.o
  "_generate_sine_tables", referenced from:
      _main in rtl_power.o
  "_hamming", referenced from:
      _main in rtl_power.o
  "_hann_poisson", referenced from:
      _main in rtl_power.o
  "_kaiser", referenced from:
      _main in rtl_power.o
  "_rectangle", referenced from:
      _init_misc in rtl_power.o
      _main in rtl_power.o
  "_scan_tune", referenced from:
      _scanner in rtl_power.o
      _main in rtl_power.o
  "_youssef", referenced from:
      _main in rtl_power.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [rtl_power] Error 1

Any thoughts on what's going on? Thanks.