[hpsdr] Updated KISS Konsole for Cross-platform Execution

Jae Stutzman k5jae at stutzman.net
Sun Sep 7 08:25:02 PDT 2014


I've been working on bring KK to Linux for about a week. There are several
reasons for doing this. The first is that I wanted to use my OpenHPSDR rig
from my main Linux desktop (Ubuntu 14.04). The other, was to see how well
Mono's SWF (System.Windows.Forms) would work in this domain.

A little background:

Microsoft released .NET to the world more than 10 years ago. The framework
and class library are clean and unified. The C# programming language has a
lot of nice things going for it. The problem: MS only released .NET for
their operating systems. A group of OSS folks decided to re-implement
(clean room) the .NET framework in order to bring the .NET framework to
other OS platforms, thus Mono was born (http://mono-project.com). Much of
the framework is OS agnostic, which made the implementation neat and tidy.
However, the main namespace that most UI developers use is NOT OS agnostic:
System.Windows.Forms. This library relies on native libraries including the
Windows Message pump. Creating a library that would allow Windows GUIs to
run under Mono would require a reimplementation of more than just the .NET
library, but much of the underlying win32 wm architecture.

Current Status:
Mono Windows Forms or MWF is the open source cross platform UI toolkit that
attempts to re-implement the SWF on Windows. It doesn't do a perfect job
and performance isn't as good, but many SWF apps will run under MWF with
some careful code level changes. Once the changes are done, both Windows
and Mono (Linux) can run the same application.

KISS Konsole is a Windows Forms C# application. It has a single native
library dependency: fftw3. Fortunately, this library is OSS and compiles on
many platforms. For KK purposes, this library is used by SharpDSP using the
C# P/Invoke mechanism. To me, this is one of the beauties of C# vs Java: It
is really easy to p/invoke native libraries and does not require a shim
layer to do the work, like JNI.

Porting Process

The first thing that I did was attempt to get the source to compile within
MonoDevelop. MonoDevelop is able to read/write VS.NET solution and project
files (C#). This is an easy way to find out if there are any project
reference related issues with the source code. KK compiled without any
issues when I tried it on Ubuntu 14.04 using the distro Mono packages. This
was good news! Next I tried running it and was greeted with a
DLLNotFoundException. It was complaining about not being able to find the
libfftw3.dll library. After a bit of digging, I realized that I had not
installed that library on my workstation prior. After installing the
missing library, I was able run KK. The GUI elements didn't look the same
as Windows and there were some issues with widget placement and zorder, but
the app was able to run my SDR rig. TIP: MonoDevelop does not have a GUI
designer for Windows Forms. Work is much faster when using VS.NET as the
authoritative designer and then sharing the code with MonoDevelop for
building/debugging.

One of my goals was to attempt to make KK look as similar as possible under
both .NET and Mono. This was accomplished by adding panels and regrouping
several items together. I also had to mess around with the AutoSize
functionality of various widgets. Under Mono, there were times when the App
Window would begin to flutter as if it was fighting over the size it wanted
to be. Windows never exhibited this behavior.

Summary:

It was a nice project to get me involved in this project. I enjoyed several
conversations I had with various members of the community and enjoyed the
warm welcome.

How to get it running:

The patch is located here:
http://openhpsdr.org/downloads/KissKonsole/kiss.patch and you should use
"save as" to download it. The patch is against SVN version 515, which
should apply.

Mono Dependencies
mono-complete
monodevelop
libfftw3-bin
libfftw3-dev

on Ubuntu do:

$ sudo apt-get install mono-complete monodevelop libfftw3-bin libfftw3-dev

Build source with either monodevelop or xbuild. Example below:

~/Devel/kiss/Unified$ xbuild KISS\ Konsole\ Unified.sln

This will build the default configuration.

Any and all comments welcome. Enjoy. I plan on continuing the work I
started with running KK on the Jetson board.

73,
Jae - K5JAE
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openhpsdr.org/pipermail/hpsdr-openhpsdr.org/attachments/20140907/57ad3a10/attachment-0001.htm>


More information about the Hpsdr mailing list