Skip to content

Bug/fix: Auto gain disables when web page loads #13

Description

@tronba

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);

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions