Feature #3337
closedosmo-trx: Clarify where RxGain parameter should be set
100%
Description
Right now, it seems we have a hardcoded RxGain in LMSDevice::stRxGain:
double LMSDevice::setRxGain(double dB, size_t chan) { if (chan) { LOG(ALERT) << "Invalid channel " << chan; return 0.0; } dB = 34.0; ...
However, the current setup of osmo-bts-trx and osmo-trx indicates that this cfg should be set in VTY in osmo-bts-trx:
static void show_phy_inst_single(struct vty *vty, struct phy_instance *pinst) { ... if (l1h->config.rxgain_valid) vty_out(vty, " rx-gain : %d dB%s", l1h->config.rxgain, VTY_NEWLINE); else vty_out(vty, " rx-gain : undefined%s", VTY_NEWLINE); ...
Which is then sent to osmo-trx via trx-CTRL protocol:
int l1if_provision_transceiver_trx(struct trx_l1h *l1h) { ... /* after power on */ if (l1h->config.rxgain_valid && !l1h->config.rxgain_sent) { trx_if_cmd_setrxgain(l1h, l1h->config.rxgain); l1h->config.rxgain_sent = 1; } ...
which is then send with "SETRXGAIN" command.
osmo-trx then receives it in Transceiver::driveControl() and sends it to radioIface and finally ro the radioDevice (like LMSDevice::setRxGain()).
However, RxGain seems to be quite attach to the device, so I'm wondering whether it makes sense to have a VTY cfg option in osmo-trx. I think we can still have them both: The one in VTY of osmo-trx is initially applied, and then if one is set in osmo-bts-trx.cfg it will be sent and override the one in osmo-trx (no need to modify anything in osmo-bts-trx, it already works like that).
This way we can provide sensible defaults for each device since we already have a per-defice .cfg file in osmo-trx/doc/examples/.
Feedback on this proposal is welcome.