For permanent configuration of certain device behaviours, UHD supports configuration files.
Configurations files use the INI format. A UHD configuration file might look like this:
For the most part, any setting that can get put into device args at initialization time can be put into the config file. For example, the X300 has a key called ext_adc_self_test
which is disabled by default. To enable it, you can add it to your device args:
However, this can be cumbersome if the intention is to permanently enable this for all X300s connected to this machine. To generally enable this option for all X300s without having to modify the make()
call, the config file can simply be updated as such:
This will act as if this key/value pair had been passed to the device args directly.
UHD will look for up to three configuration files:
/etc/uhd/uhd.conf
. On Windows systems, %programdata%/uhd/uhd.conf
. The default can be overwritten at compile time by setting UHD_SYS_CONF_FILE
through CMake.$APPDATA/.uhd/uhd.conf
, where $APPDATA
is usually the same as the user's home directory, unless $APPDATA
or $USER_CONFIG_DIR
are defined. On Windows systems, it simply resolves to %appdata%
. The default can be overwritten at compile time by setting the UHD_USER_CONF_FILE
through CMake.UHD_CONFIG_FILE
UHD will read these files in this order (if they exist). Settings from one file will overwrite those from a previous one, so if the same setting exists in the system-wide file and the user-specific file, the settings from the user-specific file will take effect. There is no error if a file does not exist, or the environment variable is not set.
MPM will only look for a configuration file in /etc/uhd/mpm.conf
, on the device running MPM itself.