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

read seems to return samples from the past #12

Closed
mbaz opened this issue Sep 3, 2021 · 3 comments
Closed

read seems to return samples from the past #12

mbaz opened this issue Sep 3, 2021 · 3 comments

Comments

@mbaz
Copy link

mbaz commented Sep 3, 2021

The test setup is one laptop transmitting a sine wave using a B200 with gnuradio, and a second laptop receiving using an RTLSDR and SoapySDR.jl.

Samples are read from the RTLSDR using Base.read(stream, 10_000).

This is the sequence of events:

  1. B200 transmitting; RTLSDR returns a clean sine wave.
  2. B200 off; RTLSDR returns the same sine wave.
  3. Julia restarted; RTLSDR returns noise (as expected).
  4. B200 transmitting; RTLSDR returns noise (expected a sine wave).
  5. Julia restarted; RTLSDR returns a sine wave (as expected).

One explanation is that read returns old samples stored somewhere. The ideal behavior is that samples are discarded by default; when reading, the specified number of samples are read from the device and returned; subsequent samples are discarded, until a new read is executed.

@sjkelly
Copy link
Collaborator

sjkelly commented Sep 5, 2021

I wonder if this is related to #13. Can you see if the fix here helps: #13 (comment)

@mbaz
Copy link
Author

mbaz commented Sep 6, 2021

@sjkelly Wrapping reads in between stream activation and de-activations helps.

@sjkelly
Copy link
Collaborator

sjkelly commented Sep 14, 2021

Should be fixed in #22. Please comment or reopen if otherwise.

@sjkelly sjkelly closed this as completed Sep 14, 2021
@sjkelly sjkelly mentioned this issue Oct 5, 2021
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants