Page 1 of 2

Linux - SDRplay - sdr-ip emulation

Posted: Mon Oct 05, 2015 12:25 am
by jazzkutya
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

Re: Linux - SDRplay - sdr-ip emulation

Posted: Mon Oct 05, 2015 5:25 am
by dc1rdb
Thats great news - thanks! Any chance for an OS X version? This would help supporting the SDRPlay on SdrDx.

Re: Linux - SDRplay - sdr-ip emulation

Posted: Mon Oct 05, 2015 1:52 pm
by jazzkutya
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.

Re: Linux - SDRplay - sdr-ip emulation

Posted: Mon Oct 05, 2015 7:12 pm
by IW2DHW
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

Re: Linux - SDRplay - sdr-ip emulation

Posted: Tue Oct 06, 2015 5:17 am
by dc1rdb
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.

Re: Linux - SDRplay - sdr-ip emulation

Posted: Tue Oct 06, 2015 8:24 pm
by jazzkutya
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.

Re: Linux - SDRplay - sdr-ip emulation

Posted: Thu Oct 08, 2015 10:22 am
by dc1rdb
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...

Re: Linux - SDRplay - sdr-ip emulation

Posted: Sat Oct 10, 2015 8:16 pm
by jazzkutya
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?

Re: Linux - SDRplay - sdr-ip emulation

Posted: Tue Oct 13, 2015 9:36 am
by jazzkutya
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.

Re: Linux - SDRplay - sdr-ip emulation

Posted: Tue Jan 03, 2017 1:56 pm
by fyngyrz
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.