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

SoapySDR: Support multiple gains #118

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

Conversation

Trumeet
Copy link

@Trumeet Trumeet commented Oct 2, 2024

SoapySDR has a function called setGainElement() that allows users to specify gains for different hardware components (e.g., for HackRF, the preamp, the LNA, and the VGA.

Currently acarsdec calls setGain(double) which asks the driver to distribute the gain number to different components, which sometimes may not be desired.

This patch enables the new cmd syntax of -g name:gain -g name:gain ... that allows users to set different gains for different components.

This patch preserves compatibility with the previous syntax -g gain. It conflicts with the previous syntax. The user has to choose between -g gain (use setGain(), supports AGC) or -g name:gain -g name:gain ... (use setGainElement(), does not support AGC)." -m "This patch is for SoapySDR only.

SoapySDR has a function called setGainElement() that allows users to specify gains for different hardware components (e.g., for HackRF, the preamp, the LNA, and the VGA.

Currently acarsdec calls setGain(double) which asks the driver to distribute the gain number to different components, which sometimes may not be desired.

This patch enables the new cmd syntax of `-g name:gain -g name:gain ...` that allows users to set different gains for different components.

This patch preserves compatibility with the previous syntax `-g gain`. It conflicts with the previous syntax. The user has to choose between `-g gain` (use setGain(), supports AGC) or `-g name:gain -g name:gain ...` (use setGainElement(), does not support AGC).

This patch is for SoapySDR only.
@Trumeet Trumeet force-pushed the patch_soapy_multi_gain branch from e504ae9 to ac0d199 Compare October 2, 2024 07:56
@Trumeet
Copy link
Author

Trumeet commented Oct 2, 2024

$ SOAPY_SDR_LOG_LEVEL=TRACE ./acarsdec -v -m 1600 -g LNA:10.0 -g VGA:30.0 -d "driver=hackrf" 131.475 131.550 131.125 131.450 131.525 131.725 131.850 130.450 130.425 130.025 129.125 129.525 
Got gain argument: 'LNA:10.0'
Got gain argument: 'VGA:30.0'
[INFO] Opening HackRF One #0 15a863dc248a5287...
Setting LNA gain to: 10.000000
[DEBUG] setGain LNA RX, channel 0, gain 10
Setting VGA gain to: 30.000000
[DEBUG] setGain VGA RX, channel 0, gain 30
Set center freq. to 131875000Hz
Setting sample rate: 20.0000 MS/s
[DEBUG] Using format CS16.
Decoding 12 channels
blk_starting
[DEBUG] Start RX

@Trumeet
Copy link
Author

Trumeet commented Oct 2, 2024

Supported gain names:

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.

1 participant