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

Fix gain mode (rtlsdr) #104

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

oandrew
Copy link

@oandrew oandrew commented Aug 6, 2024

Fix rx_fm not working with rtlsdr (fixes #90 )

  1. SoapySDRDevice_setGainMode was called after SoapySDRDevice_setGain, that seems to reset gain to 0. Likely due to https://github.com/steve-m/librtlsdr/blob/619ac3186ea0ffc092615e1f59f7397e5e6f668c/src/librtlsdr.c#L258C1-L261C2 :
int r820t_set_gain_mode(void *dev, int manual) {
	rtlsdr_dev_t* devt = (rtlsdr_dev_t*)dev;
	return r82xx_set_gain(&devt->r82xx_p, manual, 0);
}

i.e. gain value is reset to 0 when rtlsdr_set_tuner_gain_mode is called
2. Remove rtlagc option as it's not needed anymore.

With these changes I get identical output from rtl_fm and rx_fm with both auto and manual gains e.g.

rtl_fm -vvvv   -f 88.5M -M wbfm -r 48k  | play -r 48k -t raw -e s -b 16 -c 1 -V1 -
rx_fm -vvvv   -f 88.5M -M wbfm -r 48k  | play -r 48k -t raw -e s -b 16 -c 1 -V1 -

or
 
rtl_fm  -vvvv   -f 88.5M -M wbfm -r 48k -g 30  | play -r 48k -t raw -e s -b 16 -c 1 -V1 -
rx_fm -vvvv   -f 88.5M -M wbfm -r 48k -g 30  | play -r 48k -t raw -e s -b 16 -c 1 -V1 -

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

Successfully merging this pull request may close these issues.

rx_fm fails with local rtlsdr device whereas rtl_fm works using the same command line arguments
1 participant