fairwaves / UHD-Fairwaves

Fairwaves version of the UHD drivers, tweaked to support Fairwaves UmTRX.
http://umtrx.org
25 stars 21 forks source link

gain distribution and and test app #7

Closed guruofquality closed 9 years ago

guruofquality commented 9 years ago
guruofquality commented 9 years ago
chemeris commented 9 years ago

Interesting. I indeed saw a 1dB error when setting the gain, but was thinking it's my problem.

chemeris commented 9 years ago

What kind of loopback test did you perform? Did you check the actual register values in LMS with get_tx_vga1gain(), get_tx_vga2gain(), get_rx_vga2gain() or with the umtrx_lms.py utility?

Could you try to run osmo-trx and check that it actually set gains properly on both channels? Please test with this commit: http://cgit.osmocom.org/osmo-trx/commit/?h=fairwaves/master&id=79ca9ae69450142abf51c8cbd4d4a39e33169c92 There is a later commit by @kluchnikov , which I think is incorrect, so please ignore it: http://cgit.osmocom.org/osmo-trx/commit/?h=fairwaves/master&id=48da6f97e3274f751a133365b526f4ca0f3b7ea1

PS Also see my comments for the patch.

guruofquality commented 9 years ago

To test that the registers were actually set, I changed set_tx_gain() and set_rx_gain() to return the actual gain values as readback through spi using the get_tx_vga1gain(), get_tx_vga2gain(), get_rx_vga2gain(), etc calls from lms6002d.hpp.

And I created a unit test app to check the set/get gain API calls on multi-usrp under several discrete values to check that the distribution algorithm is working correctly: https://github.com/fairwaves/UHD-Fairwaves/blob/4d7a11c21a09f0c049ef30386889a44223385f89/host/utils/umtrx_test_gains.cpp

The loopback test involved a simple transmit/receive app though leakage, and dragging the gain through the complete range and ensuring that the levels appeared to change correctly without jumps and strange behaviour: http://i.imgur.com/Mabcurx.png

chemeris commented 9 years ago

re: testing registers and leakage - great idea! Did you check for both channels?

Could you test with osmo-trx as well, though? We must be sure that the gains are set to optimal values, as described in my patch for osmo-trx: http://cgit.osmocom.org/osmo-trx/commit/?h=fairwaves/master&id=79ca9ae69450142abf51c8cbd4d4a39e33169c92

guruofquality commented 9 years ago

I believe that this issue is well tested and completely merged now. OK to close it?

chemeris commented 9 years ago

Yes, let's close it. We haven't done much testing ourselves, but I trust your testing app.

Please excuse typos. Written with a touchscreen keyboard.

Regards, Alexander Chemeris CEO Fairwaves, Inc. https://fairwaves.co On May 7, 2015 3:38 PM, "Josh Blum" notifications@github.com wrote:

I believe that this issue is well tested and completely merged now. OK to close it?

— Reply to this email directly or view it on GitHub https://github.com/fairwaves/UHD-Fairwaves/issues/7#issuecomment-99992071 .

guruofquality commented 9 years ago

Cool, closed