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

force wait state after lib_cancel_transfer to avoid crash #18

Closed
wants to merge 1 commit into from
Closed

force wait state after lib_cancel_transfer to avoid crash #18

wants to merge 1 commit into from

Conversation

jvde-github
Copy link
Contributor

@jvde-github jvde-github commented Jan 8, 2022

Good day!

I was struggling with an occasional crash of the rtl-sdr tools on windows when closing the device after pressing CTRL-C. Both with the versions as provided with VCPKG and when directly compiling the latest version in MSVC (with latest of libusb). It is a bit difficult to spot a crash at close as usually is silent but you can see it running it from MSVC (see below) or in a debugger. It does not happen always but frequent enough.

After investigation of the libusb logs and experimentation I think this crash can be avoided by 1) defining zerotv in rtlsdr_read_async as 1 ms instead of zero (see libusb/libusb#1043) or 2) include a short call to Sleep to allow async operations to finish. Please find here a pull request for the latter for your consideration.

Thanks for your great work on the rtlsdr library and kind regards.

Found 1 device(s):
  0:  Realtek, RTL2838UHIDIR, SN: 7

Using device 0: Generic RTL2832U OEM
Found Rafael Micro R820T tuner
[R82XX] PLL not locked!
Sampling at 1536000 S/s.
Tuned to 162000000 Hz.
Tuner gain set to automatic.
Reading samples in async mode...
Signal caught, exiting!

User cancel, exiting...

(process 3988) exited with code -1073741819.

@tsaitgaist-bot
Copy link

GitHub is only used to mirror osmocom projects. Please read the following instructions to submit patches.

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