Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Native format allowing buffer optimization? #15

Open
xloem opened this issue Nov 3, 2015 · 7 comments
Open

Native format allowing buffer optimization? #15

xloem opened this issue Nov 3, 2015 · 7 comments
Assignees
Labels

Comments

@xloem
Copy link
Contributor

xloem commented Nov 3, 2015

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 cjcliffe added the bug label Nov 3, 2015
@cjcliffe cjcliffe self-assigned this Nov 3, 2015
@cjcliffe
Copy link
Contributor

cjcliffe commented Nov 3, 2015

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

@guruofquality
Copy link
Contributor

A few things to keep in mind.

  • The native stream format is what soapy remote uses over the wire. So we are going to have to add another conversion to soapy remote for this change (otherwise it will fall-back to floats). And readStream() will need to support CU8 as well.
  • Worth mentioning too; the direct buffer access api is currently operating on the native "CU8" samples, but the readStream() call actually provides CS8 format.

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

@cjcliffe
Copy link
Contributor

cjcliffe commented Nov 3, 2015

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
Copy link
Contributor

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:

  • given a native format, get a list of source formats that we can convert from
  • given a native format, get a list of target formats that we can convert to
  • given a source format and destination format, get a pointer to the conversion function

@guruofquality
Copy link
Contributor

In any case, I added SU8 to soapy remote: pothosware/SoapyRemote@8f6715c

@guruofquality
Copy link
Contributor

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

Made a new issue for this: pothosware/SoapySDR#49

rxseger added a commit to rxseger/rx_tools that referenced this issue Jul 16, 2016
Instead of having rtl_fm and rtl_sdr convert CS8 to CU8, add the
read_samples_cu8() convenience function. This reads from SoapySDR using
CS8 format, and adds 127 to convert to CU8, the actual native format - a
redundant but necessary conversion, could be improved after
pothosware/SoapyRTLSDR#15 if SoapyRTLSDR adds
native CU8 support (remove the loop in read_samples_cu8()).
@zuckschwerdt
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants