blah2 icon indicating copy to clipboard operation
blah2 copied to clipboard

(Suggestion) Add AntSDR support

Open alphafox02 opened this issue 1 year ago • 13 comments

The AntSDR e200 is very similar to the b210. If perhaps you can make a branch/docker with this modified uhd I can test w/ my AntSDR e200. It is reachable on a network connection so that may be a consideration for how the docker is configured.

https://github.com/MicroPhase/antsdr_uhd

I’ve not looked closely at your recent updates, so this is just a suggestion that may or may not work. Looking forward to testing outside with my sdrplay Duo asap.

alphafox02 avatar Jan 20 '24 15:01 alphafox02

It appears the AntSDR E200 works directly with the UHD drivers provided by Ettus (as commands like uhd_find_devices work). In that case, this SDR should work directly too! In the config/ folder use the config-usrp.yml file, and playing around with the device parameters should get it working. If not please post error messages and I can put fixes in. Our dollar is terrible at the moment so I'll try and see if I can borrow one.

30hours avatar Jan 21 '24 12:01 30hours

The AntSDR only works with UHD if the modified MicroPhase branch is used as linked above. If that’s not needed within the docker, great, because the modified UHD is already in DragonOS natively and I can go test it myself now.

alphafox02 avatar Jan 21 '24 15:01 alphafox02

I took a peek at the docker file

libuhd-dev=4.6.0.0-0ubuntu1~jammy1 
uhd-host=4.6.0.0-0ubuntu1~jammy1 

It would not work as is, would need modified to build the uhd linked above. Preferably a branch off main. I’ll mess around with it when I get a chance.

alphafox02 avatar Jan 21 '24 15:01 alphafox02

Looks like you’ll have to build the modified UHD from source then since there’s no package equivalent. This will add ~30 mins to the build time, but I can put a Dockerfile together to build for the AntSDR - stay tuned.

30hours avatar Jan 22 '24 03:01 30hours

Building the modified UHD from source takes around 30 mins, but let me know how it goes. https://github.com/30hours/blah2/tree/antsdr_e200 Updated Dockerfile to build from source, added a new config file and run off the new config in docker-compose.yml.

30hours avatar Jan 27 '24 01:01 30hours

It might be that it's just late, so I'll take another look in the morning. It seems the docker on the antsdr branch is still showing git clone https://github.com/EttusResearch/uhd /opt/uhd \ on line 34.

alphafox02 avatar Jan 27 '24 03:01 alphafox02

Nah you're right - completely messed up my one job. Let me just change the repo and rebuild.

30hours avatar Jan 27 '24 03:01 30hours

Getting a weird versioning error when building with CMake - the AntSDR code doesn't seem to like the following line: find_package(UHD "4.1.0.0" CONFIG REQUIRED)

Tried removing the version, unless it's named something else in CMake? I'll have another stab tomorrow, but pushing changes in.

#28 0.375 -- The C compiler identification is GNU 11.4.0 #28 0.436 -- The CXX compiler identification is GNU 11.4.0 #28 0.444 -- Detecting C compiler ABI info #28 0.521 -- Detecting C compiler ABI info - done #28 0.530 -- Check for working C compiler: /usr/bin/cc - skipped #28 0.530 -- Detecting C compile features #28 0.531 -- Detecting C compile features - done #28 0.534 -- Detecting CXX compiler ABI info #28 0.620 -- Detecting CXX compiler ABI info - done #28 0.631 -- Check for working CXX compiler: /usr/bin/c++ - skipped #28 0.631 -- Detecting CXX compile features #28 0.631 -- Detecting CXX compile features - done #28 0.640 -- Looking for pthread.h #28 0.732 -- Looking for pthread.h - found #28 0.733 -- Performing Test CMAKE_HAVE_LIBC_PTHREAD #28 0.841 -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success #28 0.842 -- Found Threads: TRUE #28 0.880 -- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.11") #28 0.881 -- Found httplib: /blah2/lib/vcpkg_installed/x64-linux/include/httplib.h (found version "0.12.2") #28 0.889 CMake Error (dev) at /usr/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:438 (message): #28 0.889 The package name passed to find_package_handle_standard_args(PkgConfig) #28 0.889 does not match the name of the calling package (UHD). This can lead to #28 0.889 problems in calling code that expectsfind_packageresult variables #28 0.889 (e.g.,_FOUND) to follow a certain pattern. #28 0.889 Call Stack (most recent call first): #28 0.889 /usr/share/cmake-3.22/Modules/FindPkgConfig.cmake:99 (find_package_handle_standard_args) #28 0.889 /opt/uhd/lib/cmake/uhd/UHDConfig.cmake:42 (include) #28 0.889 /opt/vcpkg/scripts/buildsystems/vcpkg.cmake:859 (_find_package) #28 0.889 CMakeLists.txt:19 (find_package) #28 0.889 This error is for project developers. Use -Wno-error=dev to suppress it. #28 0.889 #28 0.889 -- Configuring incomplete, errors occurred! #28 0.889 See also "/blah2/build/prod-release/CMakeFiles/CMakeOutput.log". #28 ERROR: process "/bin/sh -c mkdir -p build && cd build && cmake -S . --preset prod-release -DCMAKE_PREFIX_PATH=/blah2/lib/vcpkg_installed/x64-linux/share .. && cd prod-release && make" did not complete successfully: exit code: 1

30hours avatar Jan 27 '24 08:01 30hours

I'll have to jump to a different system. My one 22.04 Host while trying to build main or the ant branch is giving me issues at the moment.

 > [blah2 blah2_env 6/8] RUN cd /blah2/lib && vcpkg integrate install   && vcpkg install --clean-after-build:                        
0.281 Applied user-wide integration for this vcpkg root.                                                                             
0.281 CMake projects should use: "-DCMAKE_TOOLCHAIN_FILE=/opt/vcpkg/scripts/buildsystems/vcpkg.cmake"                                
1.784 /opt/vcpkg/.vcpkg-root: error: Failed to take the filesystem lock                                                              
1.784     Device or resource busy
------
failed to solve: process "/bin/sh -c cd /blah2/lib && vcpkg integrate install   && vcpkg install --clean-after-build" did not complete successfully: exit code: 1

alphafox02 avatar Jan 27 '24 12:01 alphafox02

I can suppress the error and get the find_package(UHD ..) line to complete, but now I'm getting errors from including #include <uhd/usrp/multi_usrp.hpp> - may be more difficult without delving into the AntSDR changes in more detail.

Not sure about the lock file issue, my host is 22.04 as well. Try sudo docker system prune -a to clear all cache?

30hours avatar Jan 28 '24 01:01 30hours

I read this, https://github.com/microsoft/vcpkg/issues/12286 Was lazy and just did a reboot, that fixed it, building your latest main before trying AntSDR now.

alphafox02 avatar Jan 28 '24 11:01 alphafox02

Off topic, but it appears this 3.12 API is far more stable. I managed one time so far to get the blah2 container to start, but the Duo was not usable. Stopped the container and ran SoapySDRUtil --find which just kind of hung (not a surprise to me). So I ran sudo systemctl restart sdrplay.service which also just looked to be hanging, but i waited maybe a minute and it eventually completed. I think in the past I've had to kill the service manually and then restart to get SDRPlay equipment back and usable.

After the restart I've started and stopped the container like 5 times, even pulled out the usb connector and plugged back in. I've not been able to get the SDRplay service to hang again.

alphafox02 avatar Jan 28 '24 11:01 alphafox02

That's great to hear - during development I often had to restart the SDRplay service and wait the ~2 minutes for it to restart. Tried it just then and you're right, seems to be instantly restarting which is great.

30hours avatar Jan 28 '24 12:01 30hours