pothosware / SoapyBladeRF

Soapy SDR plugin for the Blade RF
https://github.com/pothosware/SoapyBladeRF/wiki
23 stars 19 forks source link

enable channels in constructor, not stream #33

Closed guruofquality closed 5 years ago

guruofquality commented 5 years ago

this may affect certain settings to not have channels enabled at init time. This should fix some issues with setting the gain.

KarlL2 commented 4 years ago

Actually this is not as simple as this. This commit fixes the issue with the RX gain (but maybe something should be fixed in libbladerf to handle that), but it breaks the transmission. I think the issue is with

https://github.com/Nuand/bladeRF/blob/896d2431b3a35a4b31b6e729386202ebf5fdc5c0/host/libraries/libbladeRF/doc/doxygen/sync_tx_meta.dox#L21

After calling writeStream several times, you get a timeout. It seems the buffers are all filled and nothing ever empty them.

guruofquality commented 4 years ago

Remember to enable the front end via bladerf_enable_module() after calling bladerf_sync_config(), and before attempting to call bladerf_sync_tx().

Ok, so the change is incorrect for transmit, but it might be OK for RX?

guruofquality commented 4 years ago
Remember to enable the front end via bladerf_enable_module() <i>after</i>
calling bladerf_sync_config(), and <i>before</i> attempting to call
bladerf_sync_rx().

Rx is the same. I think I will revert the commit. This is probably a libbladerf bug. I cant do anything about it in this wrapper.

guruofquality commented 4 years ago

I think the other option (if bladerf cant fix it in the driver) is to stash the gain when streaming and re-apply the gain once the enable() is called. I think a few of the rx only devices also do something like this.

KarlL2 commented 4 years ago

The change seems indeed correct for RX but incorrect for TX.

I agree it would be best if this could be fixed in libbladerf instead. I opened https://github.com/Nuand/bladeRF/issues/746