Just an update on my progress.
I've rewritten my TX and RX routines as threads, and I'm calling my TX and RX threads simultaneously, and I've followed your advice by beginning to receive and write samples before the transmitter is doing its job.
By increasing the number of transfers in the TX stream config to anything above 10 (strange number, I know), I can actually see my transmitted signal by using one of the baseband loopback modes. An example return looks as follows:
The number of pulses I can see in the above image is 10, one less than the number of repetitions in my stream config.
- My stream settings are:
RX count: 4096
Num buffers: 24
RX block size: 1024
Num active transfers: 16
Buffer size: 1024
Num buffers: 24
Stream timeout: 100
TX repititions: 11
However, I don't seem to understand how any of the above parameters work, since changing them around randomly affects my received signal in a manner which I can't attribute to anything - e.g. changing the number of TX repetitions to >10, it starts working randomly. My pulses are 100 samples long at the moment, therefore by setting the number of repetitions to 16 I'm expecting to have 1600 samples worth of actual data, which is not the case, for some reason there's a part of one pulse (one, with the current settings) being cut off.
To explain what I'm experiencing with reference to the above image, my transmitter sends data [x---x---x---x---x---x] but my receiver writes data [--x---x---x---x---x---x-], and the next time [-x---x---x---x---x---x--], if that makes sense, since I can't seem to make sense of when exactly things are happening in the underlying streams. While I'm receiving the same number of pulses each time now, they're never in the same position. Also, introducing a delay inbetween transmissions does not seem to have any effect, I'll play around with it more to determine whether I'm calling it at the right location.
Is there any buffer settings that I can realistically change to accommodate a 20 MHz sampling rate? According to the asynch documentation, I would need buffer sizes > 30 MB to be safe against dropped samples, much larger than what the actual stream can be configured to.
Jaco.
EDIT: I've noticed that my init_module is never being called, which caused my sampling rate and frequency to be set to the default values of 1 MHz and 1 GHz, respectively. With my actual sampling rate (which is 10 MHz now), I can sort of produce results but they're in no way repeatable. By making the TX buffer 1024 samples long and padding my signal with zeros until that buffer size is reached works okay-ish, with a consistent 412 spacing (1024/2 - 100 = 412) most of the time. The number of repititions boggle me though, since as I've mentioned it yields nothing when it's set to lower than 11, even if my RX thread is started before my TX thread, and the TX thread is put to sleep for 500 us before it starts executing (using usleep()).