Open wizardishungry opened 6 years ago
@davephillips @dizzisound: feedback appreciated
Hi Jon ! The proposed changes look good, I'd like to see the expanded capabilities. However, I am concerned about latency and granularity so I'll be watching/testing those aspects for any degraded performance. The module works well for me now but of course I'm always interested in your improvements. :)
Granularity – Existing rtl_fm code runs in a bunch of pthreads with a whole mess of synchronization between them. This is from memory but: tuning uses rtlsdr_set_center_freq
which blocks for quite a while on each call. I played around with spawning a new thread to make a tuning call, but it looks like there's a a bit of back and forth between librtlsdr and the dongle for each tuning operation - i.e. it isn't just a single message "set dongle frequency". So having multiple rtlsdr_set_center_freq
calls running breaks the instance. In short, I don't think this is going to make things much worse, as major limited factor for tuning granularity is librtlsdr chatting with USB not context switching. (Also just came up with #39 to try to improve our tuning performance in existing architecture. )
Latency – there's two layers of buffering going on between the dongle and rack. I'm concerned that right now we're getting further behind on outputting the buffer than we need to be (and never catching up). What about using a popen
pipe instead of the second shared memory buffer? Perhaps we could get better performance by seeking to the end of the popen
ed stream on start, attempting to read into a buffer / outputting 0.f
until we see data. Dropping a few samples at the start of operation is better than being thousands of samples behind the radio for the duration of operation.
rtl_udp or rtl_fm_python allow us to control an rtl_fm process over a UDP or TCP control socket respectively. Leaning towards the UDP implementation as it should be simpler.
Advantages
select
on a file handle streaming PCM.Disadvantages