-
Notifications
You must be signed in to change notification settings - Fork 4
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
Create an example of how to use with a RTL SDR #37
Comments
Have a look at #38. Do these changes answer your question? I generally prefer to use gqrx instead of rtl_fm. I think the demodulator and AGC are generally superior to rtl_fm's default options. It also permits me to mute/unmute the audio so I can listen to it. But samedec can be made to work just as well with rtl_fm. |
Thanks for the quick response, I was asking about including example code of implementing rtl sdr (using any way that works, was playing around with rtl fm but it didn't work) using sameold. You included some example code here: |
The changes in #38 are for the samedec (binary program) documentation. They haven't been merged or released yet, so they won't show up on docs.rs or crates.io. I was hoping you could look at the diffs or the topic branch ( I was able to get rtl_fm to work, but it will likely require some tweaking. In particular, you need to set the sameold (not samedec) is the Rust library crate that can be integrated into other Rust projects. Were you looking to try and integrate with the rtl-sdr drivers in Rust? That's a more complicated task. |
… And if you have not already, I would see the samedec executable. You can either build it from source or use our binary releases here on GH. All you have to do is pipe in audio samples in a particular format, and you can obtain the audio from a variety of sources. Documentation is here or on crates.io. |
My project involves integrating this library into a rust project. Im a bit new to rust so an example of how to pass in audio via cqrx would be very helpful. |
You would need to obtain a Rust wrapper around the existing rtl-sdr drivers, which are native C. If no such wrapper exists, you will need to write one. Rust can wrap native C libraries with bindgen, but you will need to write Then you need to obtain the raw IQ samples and recover demodulated baseband audio. For NOAA stations, a narrowband FM (NBFM) demodulator suffices. For commercial FM, you will need a wideband FM demodulator (WBFM). For digital commercial radio like NRSC5, you will need to write a digital decoder and things will be very hard. For television—don't bother, you don't have enough bandwidth. librtlsdr does not do any of this for you. An understanding of digital signal processing would be helpful. Once you have recovered single-channel baseband audio in uncompressed f32 format, you can feed that to sameold by following the example. I have no examples for this because I have not done it. And if I had done it, samedec would probably support it. |
I meant using cqrx into stdin, sort of like how you did it in samedec. Sorry if I am being confusing. |
I am very confused. What exactly is your final goal? What are you trying to do? samedec already supports UDP input from gqrx, per its documentation. You just run a program like socat or netcat that receives the UDP and pipes it into samedec. No need to write any Rust. Or, if you must write another executable, the samedec source code is an example for how that can be done. |
I was able to use rtl_fm reliably with samedec but after trying to follow what you did in the main samedec code I was unsuccessful with writing my own code using the library. https://gist.github.com/RCGV1/4f6946bfd49331ea87b022732b2ad0f6 |
Did you mean 48000 Hz? A sampling rate mismatch will definitely cause things to not work. Our documentation recommends at least 8000 Hz at the input. sameold is designed to work efficiently even at relatively high sampling rates. The sample data in the I am going to merge #38 and close this issue as it seems that things are working. I am generally unwilling to support executables in other projects. If you discover a bug or missing functionality in sameold or samedec itself, please feel free to open a new issue. |
I am confused on how to implement this with an RTL SDR
The text was updated successfully, but these errors were encountered: