pothosware / SoapyRTLSDR

SoapySDR RTL-SDR Support Module
https://github.com/pothosware/SoapyRTLSDR/wiki
MIT License
124 stars 29 forks source link

Native format allowing buffer optimization? #15

Open xloem opened 8 years ago

xloem commented 8 years ago

SoapyRTLSDR tells Soapy its native format is CS8, but it looks like the actual native format is CU8.

The code simply subtracts 127 from all values. If it specified CU8 instead, could it simply forward the data without having to process it?

See https://github.com/pothosware/SoapyRTLSDR/blob/master/Streaming.cpp#L379

cjcliffe commented 8 years ago

That's a fairly simple fix and makes sense; I'll add CU8 and make it the native default.

guruofquality commented 8 years ago

A few things to keep in mind.

Its not so bad to add CU8 to soapy rtl, and soapy remote could always support more format conversions.

cjcliffe commented 8 years ago

Would it be a stretch to handle the same format conversions for local devices in SoapySDR? It would be nice if I could request CF32 even if a module only supplied something like CS16 or CS8. Seems convenient for remote but I have to handle potentially all of them in-app for local devices depending on what is or isn't implemented in the module..

guruofquality commented 8 years ago

Would it be a stretch to handle the same format conversions for local devices in SoapySDR?

Yea, its crossed my mind a few times. If SoapySDR had a common library of conversions, it could be used by the remote, and any local module. Without interfering too much with the ability to customise the read/write stream calls. I think maybe some new SoapySDR API calls to:

guruofquality commented 8 years ago

In any case, I added SU8 to soapy remote: https://github.com/pothosware/SoapyRemote/commit/8f6715cead618252e6fb04d8334cf5317b17bce8

guruofquality commented 8 years ago

Would it be a stretch to handle the same format conversions for local devices in SoapySDR?

Made a new issue for this: https://github.com/pothosware/SoapySDR/issues/49

zuckschwerdt commented 6 years ago

Is anyone still working on this? I would offer to add CU8 support to SoapyRTLSDR. Just as supported format, not as "native" format, so existing consumers can continue to auto select CS8.