-
Notifications
You must be signed in to change notification settings - Fork 29
Description
Hi, noticed a bug when playing with a fork, got some AI assist, and think we found a fix. Hope it can be of help.
Problem: Auto gain works initially, but gets disabled as soon as you open the web interface. You then have to toggle it off and on to get it back.
Cause: In rtl_fm_python.c, the lib_get_tuner_gains_count and lib_get_tuner_gains functions both call rtlsdr_set_tuner_gain_mode(dongle.dev, 1) which switches the device to manual mode. The web page calls these functions to populate the gain dropdown menu.
Solution: Remove the rtlsdr_set_tuner_gain_mode lines from both functions since they're only meant to query available gains, not change the gain mode.
In lib_get_tuner_gains_count, remove: rtlsdr_set_tuner_gain_mode(dongle.dev, 1);
In lib_get_tuner_gains, remove: r = rtlsdr_set_tuner_gain_mode(dongle.dev, 1);