Linux - SDRplay - sdr-ip emulation

Add useful snippets of code or links to entire SDR projects.
jazzkutya
Posts: 26
Joined: Wed Sep 23, 2015 8:50 pm

Linux - SDRplay - sdr-ip emulation

Postby jazzkutya » Mon Oct 05, 2015 12:25 am

Hi linux folks,

I have whipped up a perl program that uses SDR-Play (with the published linux api) and emulates an rfscape sdr-ip device on localhost.

Here, on github: https://github.com/jazzkutya/sdrplay-sdripserver-perl
Last edited by jazzkutya on Thu Jan 01, 1970 12:00 am, edited 0 times in total.
Reason: No reason

dc1rdb
Posts: 19
Joined: Mon Jul 27, 2015 5:57 am

Re: Linux - SDRplay - sdr-ip emulation

Postby dc1rdb » Mon Oct 05, 2015 5:25 am

Thats great news - thanks! Any chance for an OS X version? This would help supporting the SDRPlay on SdrDx.
Last edited by dc1rdb on Thu Jan 01, 1970 12:00 am, edited 0 times in total.
Reason: No reason

jazzkutya
Posts: 26
Joined: Wed Sep 23, 2015 8:50 pm

Re: Linux - SDRplay - sdr-ip emulation

Postby jazzkutya » Mon Oct 05, 2015 1:52 pm

I think it can work on OSX with minimal changes, but someone else has to do those changes (preferably someone with an OSX).
Look in K/SDRPlay.pm and change this line (the -lmirsdrapi-rsp part):

use Inline C=>'DATA',name=>'K::SDRPlay',libs=>'-lmirsdrapi-rsp',cc=>'c99';

according to the sdr api on osx, and try it.
If the .so library file is in a non-system path you also have to provide the directory which has it:
libs=>'-L/path/to/lib -lmirsdrapi-rsp'
it seems on osx the api library is called libmir_sdr.so and the include file also has a different name, so the above line probably will look this:

use Inline C=>'DATA',name=>'K::SDRPlay',libs=>'-L/path/to/lib -lmir_sdr',cc=>'c99';
don't forget to change the path to the library directory (which has the libmir_sdr.so file)
Also the header file is named differently, so find this line:
#include <mirsdrapi-rsp.h>
and change it to:
#include <mir_sdr.h>

The api on OSX is outdated, sdrplay should update it.
Last edited by jazzkutya on Thu Jan 01, 1970 12:00 am, edited 0 times in total.
Reason: No reason

IW2DHW
Posts: 58
Joined: Wed Sep 23, 2015 7:33 pm

Re: Linux - SDRplay - sdr-ip emulation

Postby IW2DHW » Mon Oct 05, 2015 7:12 pm

Tested with SDR# and Mono 4.0.4 under Ubuntu 14.04
Is working with 600 kHz of sample rate and my I5 CPU 2.8 GHz x 4

Have you seen simple server program of SDR-J suite? It is a TCP own protocol but it is all in C
You can get it at http://www.sdr-j.tk/index.html

Regards
Franco Spinelli
Last edited by IW2DHW on Thu Jan 01, 1970 12:00 am, edited 0 times in total.
Reason: No reason

dc1rdb
Posts: 19
Joined: Mon Jul 27, 2015 5:57 am

Re: Linux - SDRplay - sdr-ip emulation

Postby dc1rdb » Tue Oct 06, 2015 5:17 am

jazzkutya wrote:I think it can work on OSX with minimal changes, but someone else has to do those changes (preferably someone with an OSX).
Look in K/SDRPlay.pm and change this line (the -lmirsdrapi-rsp part):

use Inline C=>'DATA',name=>'K::SDRPlay',libs=>'-lmirsdrapi-rsp',cc=>'c99';

according to the sdr api on osx, and try it.
If the .so library file is in a non-system path you also have to provide the directory which has it:
libs=>'-L/path/to/lib -lmirsdrapi-rsp'
it seems on osx the api library is called libmir_sdr.so and the include file also has a different name, so the above line probably will look this:

use Inline C=>'DATA',name=>'K::SDRPlay',libs=>'-L/path/to/lib -lmir_sdr',cc=>'c99';
don't forget to change the path to the library directory (which has the libmir_sdr.so file)
Also the header file is named differently, so find this line:
#include <mirsdrapi-rsp.h>
and change it to:
#include <mir_sdr.h>

The api on OSX is outdated, sdrplay should update it.


Thanks - will give it a try!
Regarding the outdated OS X API, I've already placed a request here. No response yet.
Last edited by dc1rdb on Thu Jan 01, 1970 12:00 am, edited 0 times in total.
Reason: No reason

jazzkutya
Posts: 26
Joined: Wed Sep 23, 2015 8:50 pm

Re: Linux - SDRplay - sdr-ip emulation

Postby jazzkutya » Tue Oct 06, 2015 8:24 pm

dc1rdb wrote:
jazzkutya wrote:Regarding the outdated OS X API, I've already placed a request here. No response yet.


The OSX API is updated, can be downloaded now. The filenames are still different from the linux version so you still need the modifications described.
I'm eager to hear about your results on OSX.
Last edited by jazzkutya on Thu Jan 01, 1970 12:00 am, edited 0 times in total.
Reason: No reason

dc1rdb
Posts: 19
Joined: Mon Jul 27, 2015 5:57 am

Re: Linux - SDRplay - sdr-ip emulation

Postby dc1rdb » Thu Oct 08, 2015 10:22 am

The OSX API is updated, can be downloaded now. The filenames are still different from the linux version so you still need the modifications described.
I'm eager to hear about your results on OSX.


The latest release of the OS X API uses the same filenames as the linux version and the files are now located in /usr/local/lib/ and /usr/local/include/.
So in theory, the source code should be now usable without modifications.
However, I'm still struggling building the software because I have no experience with perl at all and cannot get the required perl modules to work on my Mac...
Last edited by dc1rdb on Thu Jan 01, 1970 12:00 am, edited 0 times in total.
Reason: No reason

jazzkutya
Posts: 26
Joined: Wed Sep 23, 2015 8:50 pm

Re: Linux - SDRplay - sdr-ip emulation

Postby jazzkutya » Sat Oct 10, 2015 8:16 pm

I have updated the perl code so it's compatible with older Inline::C perl modules.
This actually means on Ubuntu 14.04 (and probably later) you don't need to install anything that's not in ubuntu itself.

Just install libinline-perl package of Ubuntu.

This may make life easier on OSX too, but i don't know.

dc1rdb, did you got my PM?
Last edited by jazzkutya on Thu Jan 01, 1970 12:00 am, edited 0 times in total.
Reason: No reason

jazzkutya
Posts: 26
Joined: Wed Sep 23, 2015 8:50 pm

Re: Linux - SDRplay - sdr-ip emulation

Postby jazzkutya » Tue Oct 13, 2015 9:36 am

I have deleted the github repository and I am no more distributing this code due to RFSPACE not giving permission to use their protocol.

I will find another way to make linrad and extio supporting apps that can be run with wine be usable with SDRPlay on linux.
Probably I will extend the opensource rtl_tcp protocol to support 16bit.
Also I could just extend linrad to use sdrplay api directly but my larger goal would be a free and opensource generally accepted protocol usable by any app and any sdr. For this I will definitely look into soapysdr too.
Last edited by jazzkutya on Thu Jan 01, 1970 12:00 am, edited 0 times in total.
Reason: No reason

fyngyrz
Posts: 1
Joined: Tue Jan 03, 2017 1:41 pm

Re: Linux - SDRplay - sdr-ip emulation

Postby fyngyrz » Tue Jan 03, 2017 1:56 pm

if anyone, particularly the original author, has the source to the sdrplay-to-sdrip emulation in perl, I will undertake a project to modify it so that:

(1) it does NOT use the RFSPACE protocol
(2) SdrDx understands it

This assumes that someone can provide a copy of the current version, and that it is functional.

--Ben
AA7AS
SdrDx Author - you can contact me directly using fyngyrz at gmail dot com.
Last edited by fyngyrz on Thu Jan 01, 1970 12:00 am, edited 0 times in total.
Reason: No reason


Return to “Code Corner”

Who is online

Users browsing this forum: No registered users and 2 guests