Topics

Dockerized sdrangel


alain@...
 

Hello,
I'm trying to run the dockerized version of sdrangel but I am getting this error:

Alains-MacBook:~ alain$ docker run -it --rm -e DISPLAY=docker.for.mac.host.internal:0  alain/sdrangel /opt/install/sdrangel/bin/sdrangelsrv

[...]

ERROR: Unable to find host: Name or service not known
2019-03-03 15:54:43.536 (D) DeviceSoapySDRScan::scan: Lib Version: v0.7.0-g6d21756e
2019-03-03 15:54:43.538 (D) DeviceSoapySDRScan::scan: API Version: v0.7.0
2019-03-03 15:54:43.538 (D) DeviceSoapySDRScan::scan: ABI Version: v0.7
2019-03-03 15:54:43.539 (D) DeviceSoapySDRScan::scan: Install root: /opt/install/SoapySDR
2019-03-03 15:54:43.544 (D) DeviceSoapySDRScan::scan: loaded module: /opt/install/SoapySDR/lib/SoapySDR/modules0.7/libremoteSupport.so
2019-03-03 15:54:43.544 (D) DeviceSoapySDRScan::scan: driver: remote
[ERROR] avahi_client_new() failed: Daemon not running
sdrangelsrv: client.c:785: avahi_client_get_state: Assertion `client' failed.

Yes, It is a mac :)

I have no devices attached to this laptop as my plan are to use run sdrangel headless. Am I doing anything wrong?
Thanks for your help.

Alain


Edouard Griffiths
 

Hi,

Running in docker is not officially supported yet, I don't think you will ever see it mentioned anywhere yet. However I am exploring this and currently having a hard time with NVidia OpenGL on a Linux host. Actually this seems easier in Windows with Xming. Compilation should run smoothly though. At the end you should add:

RUN sudo service dbus start \
&& sudo service avahi-daemon start

The idea is to have a pretty much fail safe build from source in any environment getting rid of all the hassle and issues with package builds.

Contributions welcome...

Brgds,
Edouard.


alain@...
 

Edouard,

Thank you for the clarification.

I see you are trying to run those daemons via "RUN", which is incorrect.
I tried pushing a branch for a pull request but I have no permission to do that. In any event, at the end of the Dockerfile you should use something like this:

 

# Start some services on which SDRangel depends
COPY start.sh /start.sh
ENTRYPOINT ["/start.sh"]

and then add the start.sh executable in the same directory (make sure it is executable):

 

#!/bin/bash
sudo service ssh start
sudo service dbus start
sudo service avahi-daemon start
/opt/install/sdrangel/bin/sdrangel

Unfortunately, those modifications solve the first problem but reveal another one:


2019-03-03 22:14:28.932 (W) Unrecognized OpenGL version
2019-03-03 22:14:28.932 (W) Unrecognized OpenGL version
2019-03-03 22:14:28.933 (D) FFTEngine::create: using FFTW engine
2019-03-03 22:14:33.442 (D) FFT: creating FFTW plan (n=1024,forward) took 4509ms
2019-03-03 22:14:33.442 (D) GLSpectrum::connectTimer
2019-03-03 22:14:33.450 (D) DSPDeviceSourceEngine::addSink:  SpectrumVis
2019-03-03 22:14:33.450 (D) DSPDeviceSourceEngine::handleSynchronousMessages:  DSPAddBasebandSampleSink
2019-03-03 22:14:33.453 (D) DSPDeviceSourceEngine::setSourceSequence: seq: 0
2019-03-03 22:14:33.453 (D) FileSourceInput::FileSourceInput: device source engine: 0x55dd2f71dce0
2019-03-03 22:14:33.453 (D) FileSourceInput::FileSourceInput: device source engine message queue: 0x55dd2f71dcf8
2019-03-03 22:14:33.453 (D) FileSourceInput::FileSourceInput: device source: 0x0
2019-03-03 22:14:33.463 (D) DSPDeviceSourceEngine::setSource
2019-03-03 22:14:33.463 (D) DSPDeviceSourceEngine::handleSynchronousMessages:  DSPSetSource
2019-03-03 22:14:33.463 (D) DSPDeviceSourceEngine::gotoIdle
2019-03-03 22:14:33.463 (D) DSPDeviceSourceEngine::handleSetSource: set
2019-03-03 22:14:33.467 (D) MainWindow::setDeviceGUI: insert Rx tab at 0
2019-03-03 22:14:33.467 (D) MainWindow::setDeviceGUI: adding tab for FileSource
2019-03-03 22:14:33.467 (D) DSPDeviceSourceEngine::handleInputMessages: message: DSPSignalNotification
2019-03-03 22:14:33.467 (D) DSPDeviceSourceEngine::handleInputMessages: DSPSignalNotification:  m_sampleRate:  48000  m_centerFrequency:  435000000
2019-03-03 22:14:33.468 (D) DSPDeviceSourceEngine::handleInputMessages: forward message to  SpectrumVis
2019-03-03 22:14:33.468 (D) DSPDeviceSourceEngine::handleInputMessages: DSPSignalNotification: guiMessageQueue: 0x55dd2f7deed8
2019-03-03 22:14:33.470 (D) MainWindow::MainWindow: load current preset settings...
2019-03-03 22:14:33.470 (D) MainWindow::loadPresetSettings: preset [default | no name]
2019-03-03 22:14:33.470 (D) DeviceSourceAPI::loadSourceSettings: Loading preset [default | no name]
2019-03-03 22:14:33.470 (D) Preset::findBestSourceConfig: no match
2019-03-03 22:14:33.470 (D) DeviceSourceAPI::loadSourceSettings: center frequency: 0 Hz
2019-03-03 22:14:33.470 (D) DeviceSourceAPI::loadSourceSettings: source sdrangel.samplesource.filesource[0]:  not found
2019-03-03 22:14:33.471 (D) DeviceUISet::loadRxChannelSettings: Loading preset [default | no name]
2019-03-03 22:14:33.471 (D) DeviceUISet::loadRxChannelSettings: 0 channel(s) in preset
2019-03-03 22:14:33.471 (D) MainWindow::MainWindow: apply settings...
2019-03-03 22:14:33.471 (D) MainWindow::MainWindow: update preset controls...
2019-03-03 22:14:33.472 (D) MainWindow::MainWindow: registered resource file /opt/install/sdrangel/bin/sdrbase.rcc
2019-03-03 22:14:33.472 (D) StaticFileController: docroot=:/webapi, encoding=UTF-8, maxAge=60000
2019-03-03 22:14:33.473 (D) StaticFileController: cache timeout=60000, size=1000000
2019-03-03 22:14:33.473 (D) HttpListener: Listening on port 8091
2019-03-03 22:14:33.473 (I) WebAPIServer::start: starting web API server at http://127.0.0.1:8091
2019-03-03 22:14:33.474 (D) MainWindow::MainWindow: end
2019-03-03 22:14:33.495 (C) GLSpectrum::initializeGL: no current context
/start.sh: line 6:    65 Segmentation fault      /opt/install/sdrangel/bin/sdrangel

Is the segmentation fault related to OpenGL? I can't tell.
It would really be nice being able to have this running in Docker, at least for the headless client.


Edouard Griffiths
 

Hi Alain,

normally you should be able to fork and make PRs that's what all people do. Anyway this part is still very much under construction and is far from being in a workable stage and is going to be refactored heavily. Thanks for the tips indeed the last RUN commands have no effect when you start again the container.

I see you aim at a headless variant but sdrangel is the GUI variant and requires an X display with OpenGL. However the server variant must be also built as /opt/install/sdrangel/bin/sdrangelsrv.

Brgds, Edouard. 


alain@...
 

I created a pull request for the change in case you might want to apply it.
The server variant, however, also fails when run in the container.


Edouard Griffiths
 

Hello,

I have vastly re-organized the docker folder on the dev branch taking this change into account so I will reject this PR.
I can run OpenGL fine on a NVidia graphics card but now have trouble with pulseaudio so Docker is definitely not a workable solution yet.

Brgds, Edouard. 


Edouard Griffiths
 

Hi,

SDRangel has a strong dependency on pulseaudio and pulseaudio is not compatible with Docker. So SDRangel cannot run in a docker container dot.
I think this closes the debate about Docker.

Brgds, Edouard.


Ondra OK1CDJ
 

Hi, pulse audio is no problem in docker. I am runnig GNU radio from docker container with Pluto and pulse  audio.

Regards, Ondra



út 5. 3. 2019 v 14:13 odesílatel Edouard Griffiths <f4exb06@...> napsal:

Hi,

SDRangel has a strong dependency on pulseaudio and pulseaudio is not compatible with Docker. So SDRangel cannot run in a docker container dot.
I think this closes the debate about Docker.

Brgds, Edouard.




Edouard Griffiths
 

Hi,

it is not that easy to find useful information on the net about Pulseaudio in Docker but actually these guys seem to have saved SDRangel on docker: https://github.com/TheBiggerGuy/docker-pulseaudio-example
It takes one more step to make it work with the X11 stuff: https://github.com/TheBiggerGuy/docker-pulseaudio-example/issues/1

I got the sound working now! Wow!

Brgds, Edouard.


Ondra OK1CDJ
 


út 5. 3. 2019 v 15:12 odesílatel Edouard Griffiths <f4exb06@...> napsal:

Hi,

it is not that easy to find useful information on the net about Pulseaudio in Docker but actually these guys seem to have saved SDRangel on docker: https://github.com/TheBiggerGuy/docker-pulseaudio-example
It takes one more step to make it work with the X11 stuff: https://github.com/TheBiggerGuy/docker-pulseaudio-example/issues/1

I got the sound working now! Wow!

Brgds, Edouard.




Edouard Griffiths
 

Yep, the pulse-client.conf is exactly the same. This and --volume /run/user/${USER_UID}/pulse:/run/user/1000/pulse \ do the trick but I also had to add:
-e "PULSE_SERVER=unix:/run/user/1000/pulse/native" \
according to the issue mentioned just above

I think I will move the Docker stuff to its own repo on Github. Eventually it will use Docker compose to fire up the web client (https://github.com/f4exb/sdrangelcli) as well. 

Brgds, Edouard.


Edouard Griffiths
 

SDRangel in Docker has now its own repository in Github: https://github.com/f4exb/sdrangel-docker
Please give it a try!

Brgds, Edouard.