Topics

Proficio Experiment: HDSDR in Linux with voice, fldigi and wsjt-x, running on an old PC

ag5gt@...
 

Well, folks, the script has evolved to a bit more than an experiment. It worked well enough that it is presently the only means I use to operate the Proficio. Because of that, a few refinements were needed:
1- The original version was just a start-up script, with an awkward exit and re-start sequence to change operating modes. Now, version 2 recycles to its beginning and can restart in another mode relatively quickly. I use a desktop launcher to start the xterm that runs the script. That gets parked in a corner of the screen where operating status messages can be seen.
2- Frequency calibration is now automated, including offering pre-set broadcast reference options. The result is saved in a start-up file, along with a bunch of other things.
3- Voice/CW mode has a new GUI with some push-button functions missing in HDSDR. There is a flexible Split Rx/TX capability that can also serve the purpose of RIT. There are six memory presets available per band (except in 60 meters where there are only 5 fixed channels). Adding more presets would be a trivial matter, but six is about all I can keep track of. Band-switching sets HDSDR's mode to a reasonable default for the band. It also remembers the last selections for each band, including Split state, even after power-down and re-start. Set frequencies are displayed as button labels, including for Split RX and TX.
4- The goofy sound system in Linux caused fits initially, trying to get the applications to stay in-sync in terms of I/Q and audio configuration from one power-up to the next. The script now includes invocation of pavu before anything else starts. That, combined with a consistent habit of fully booting the PC before powering-up the Proficio, has resulted in smooth start-up in all modes without having to fiddle with settings. Sequence: Allow the PC to totally enumerate its peripherals, then power-up Proficio and, finally, apply PAVU settings before before invoking sdr applications.
Caveat:
I tried to excessively comment the code, not only to help others figure out how to make it all work, but also to remind me six months from now. However, that, a README, and some other notes are all you get in terms of installation help at the moment. I can't honestly recommend trying it unless you are comfortable fooling around with linux or are committed to learning. That said, I hope others find this useful in some way.

The revised start-up Dialog:


Push-button controls to supplement HDSDR's in Voice/CW mode (Split frequencies are not set in this example. When set, the buttons display frequencies.):


Bruce, AG5GT

ag5gt@...
 

The source file archive should now be accessible using the following link:

https://drive.google.com/open?id=0B0QDZpLElJ4tZ2JnTXBFUmtZR1E

Fellow tinkerers, please pass along any fixes or other improvements. As long as it seems relevant, I'll make an effort to update the archive with the current/best version.

Bruce, AG5GT

ag5gt@...
 

Right you are about RPi compatibility. The RPi series has certainly set a standard for price/performance and power-effciency. Impressive, actually.

But, there is some x86 competition. I was thinking of an x86 micro-board, something more like this:
https://liliputing.com/2017/06/core-quad-core-x86-mini-pc-thats-smaller-raspberry-pi-crowdfunding.html
There are others. Some claim to be Win10 capable, though I'd probably stick with Ubuntu linux, for better support of us tinkerers. I'm imagining porting the set-up from my giant, acoustically noisy, power-hungry, 2005 NoName PC mid-tower to a little box that has in it the proficio radio hardware, an HF amplifier and one of these little PC boards. It could also be kept 12V compatible, though likely a little more of a power consumer than an RPi version. Anyway, so far, the exercise I reported has been quite educational w.r.t. what's likely workable and how.

An immediate goal is to make the setup behave as "instant-on"; i.e., no switching, reconfiguring, level-setting, etc., when starting in one config after having been running in another. It is pretty close right now. HDSDR's profile feature helps a lot with that, by remembering its setup on a per profile basis.

One remaining annoyance is wsjt-x and port-audio not always cooperating immediately on power-up, as others have observed. I have to believe there's a scriptable, not-too-complicated solution to that. Maybe the user's preferred pavu configuration needs to be explicitly activated at the start of the radio script, before wsjt-x, for example. There can't be too much in it because fldigi starts right up every time, no fuss no muss, using the same virtual audio devices.

Bruce, AG5GT

K7AZJ <jdawgaz@...>
 

of course, this will never work on the raspberry pi.
wine only works on x86 architecture.

personally, anything I do, has to work on the raspberry pi, because, I take it out portably. I can do everything with a 12v battery.

but it was a good exercise that you did. And shows what can be done.

Jerry



--
Extra Ham Operator: K7AZJ
Registered Linux User: 275424
Raspberry Pi and Openscad developer

The most exciting phrase to hear in science - the one that heralds new discoveries - is not "Eureka!" but "That's funny...".
- Isaac. Asimov


On Thu, Aug 24, 2017 at 1:17 PM, <ag5gt@...> wrote:
I took this on mostly as a personal challenge, not at all certain it would all work in the end. I wanted to see if a Proficio could be made to work with HDSDR in Linux, thereby avoiding purchase of the latest and greatest from Microsoft and its PC hardware ecosystem. I was familiar with Quisk, liked it for its comprehensive collection of ham transceiver features, and understood it had already been proven to be cross-platform compatible. But, to my knowledge, HDSDR was still regarded as a Windows-only option. I can report that, for the last several days, I have been exercising my proficio in a variety of modes without ever having hooked it up to a Windows-based PC, all with HDSDR as the SDR core. So, for those willing and able to deal with Linux systems, I'd now suggest HDSDR is an option. With more scripting to automate installation and configuration, it might even become an option with substantial appeal, given HDSDR's receive-mode features and refined user-interface.

This was enabled by availability of some important pieces of code. First of course is the WINE compatibility layer in Linux. It is my understanding that HDSDR's developers made a particular effort to avoid coding techniques not compatible with WINE's api. As a result, HDSDR loads and looks right, processes I/Q signals, and passes audio to and from the Linux sound system. The HDSDR developers also made available a very basic dll that adds TX capability and is platform agnostic, ExtIO_SRlite.dll. What all that does not do is support USB control of softrock or proficio hardware. Enter usbsoftrock, a Linux command-line utility that can set the radio's LO frequency and ptt state, among other things. Since the proficio was built with softrock compatibilty in mind, usbsoftrock can be recompiled to do the essentials with a proficio, too.

My code contribution at this point is a tcl/tk script and related rigdef file to overcome the awkwardness of a command-line method of tuning and rx/tx control. What the script does is communicate with HDSDR through its CAT interface, using virtual serial ports. It relays tuning and ptt commands to the radio by invoking usbsoftrock. For voice-mode operation, the script sets up a virtual teletype terminal to talk to HDSDR. It periodically asks HDSDR for the frequency being displayed on its GUI. When a change is noted, it calculates the needed LO frequency, correcting for offset and calibration and sends that to the radio. The script also pops up on-screen a small window with two buttons for controlling ptt; one toggles the rx/tx state and the other acts as a momentary-contact TX switch. Hovering the mouse pointer over that window also causes the keyboard space-bar to act as a TX switch (HDSDR’s TX button is presently used only as an indicator). In digital modes, the script invokes native-linux versions of fldigi or wsjt-x and supports CAT communications between HDSDR and those app’s. It monitors virtual serial port traffic, looking for tuning or rx/tx commands. Those are relayed to the radio after formatting and adjustment similar to voice mode operation. In the case of fldigi, a few tested rig definitions proved poor surrogates, so a custom rigdef file was built to implement HDSDR’s CAT commands exactly (afaik). In wsjt-x, the Kenwood TS-2000 rig definition appears workable, apparently not relying on features available on a TS-2000, but not supported by HDSDR.

The result is a means to operate with HDSDR in Ubuntu 14.04 on a PC of ~2005 vintage, using native-linux features for virtual audio and serial cables. That virtuality results in a (relatively) clean desktop, with minimal spurious RF radiation or coupling and no signal degradation from non-essential d/a or a/d conversions. Incidentally, it occurs to me this might be particularly useful to folks building portable systems using micro-form-factor PC hardware having limited i/o. Except for the necessity to lock HDSDR’s tuning to a fixed offset from the LO, operation seems to me essentially un-compromised. Both fldigi and wsjt-x native-linux app’s appear to operate normally (they each have their own quirks...). Even with only 5 watts and 13 characters, I’m  finding JT65 to be oddly addictive, but I digress...

Below  are screen captures of the thing in various modes of operation. I’m happy to share code, configuration data, notes, etc., if somebody can advise on the best place to post a directory full of that stuff. I don’t have a step-by-step installation document. If there’s interest, I can put that on my to-do list.

The pop-up dialog at start-up of the script:



Voice/CW mode:



Fldigi:



Wsjt-x:



Cheers, Bruce, AG5GT


ag5gt@...
 
Edited

I took this on mostly as a personal challenge, not at all certain it would all work in the end. I wanted to see if a Proficio could be made to work with HDSDR in Linux, thereby avoiding purchase of the latest and greatest from Microsoft and its PC hardware ecosystem. I was familiar with Quisk, liked it for its comprehensive collection of ham transceiver features, and understood it had already been proven to be cross-platform compatible. But, to my knowledge, HDSDR was still regarded as a Windows-only option. I can report that, for the last several days, I have been exercising my proficio in a variety of modes without ever having hooked it up to a Windows-based PC, all with HDSDR as the SDR core. So, for those willing and able to deal with Linux systems, I'd now suggest HDSDR is an option. With more scripting to automate installation and configuration, it might even become an option with substantial appeal, given HDSDR's receive-mode features and refined user-interface.

This was enabled by availability of some important pieces of code. First of course is the WINE compatibility layer in Linux. It is my understanding that HDSDR's developers made a particular effort to avoid coding techniques not compatible with WINE's api. As a result, HDSDR loads and looks right, processes I/Q signals, and passes audio to and from the Linux sound system. The HDSDR developers also made available a very basic dll that adds TX capability and is platform agnostic, ExtIO_SRlite.dll. What all that does not do is support USB control of softrock or proficio hardware. Enter usbsoftrock, a Linux command-line utility that can set the radio's LO frequency and ptt state, among other things. Since the proficio was built with softrock compatibilty in mind, usbsoftrock can be recompiled to do the essentials with a proficio, too.

My code contribution at this point is a tcl/tk script and related rigdef file to overcome the awkwardness of a command-line method of tuning and rx/tx control. What the script does is communicate with HDSDR through its CAT interface, using virtual serial ports. It relays tuning and ptt commands to the radio by invoking usbsoftrock. For voice-mode operation, the script sets up a virtual teletype terminal to talk to HDSDR. It periodically asks HDSDR for the frequency being displayed on its GUI. When a change is noted, it calculates the needed LO frequency, correcting for offset and calibration and sends that to the radio. The script also pops up on-screen a small window with two buttons for controlling ptt; one toggles the rx/tx state and the other acts as a momentary-contact TX switch. Hovering the mouse pointer over that window also causes the keyboard space-bar to act as a TX switch (HDSDR’s TX button is presently used only as an indicator). In digital modes, the script invokes native-linux versions of fldigi or wsjt-x and supports CAT communications between HDSDR and those app’s. It monitors virtual serial port traffic, looking for tuning or rx/tx commands. Those are relayed to the radio after formatting and adjustment similar to voice mode operation. In the case of fldigi, a few tested rig definitions proved poor surrogates, so a custom rigdef file was built to implement HDSDR’s CAT commands exactly (afaik). In wsjt-x, the Kenwood TS-2000 rig definition appears workable, apparently not relying on features available on a TS-2000, but not supported by HDSDR.

The result is a means to operate with HDSDR in Ubuntu 14.04 on a PC of ~2005 vintage, using native-linux features for virtual audio and serial cables. That virtuality results in a (relatively) clean desktop, with minimal spurious RF radiation or coupling and no signal degradation from non-essential d/a or a/d conversions. Incidentally, it occurs to me this might be particularly useful to folks building portable systems using micro-form-factor PC hardware having limited i/o. Except for the necessity to lock HDSDR’s tuning to a fixed offset from the LO, operation seems to me essentially un-compromised. Both fldigi and wsjt-x native-linux app’s appear to operate normally (they each have their own quirks...). Even with only 5 watts and 13 characters, I’m  finding JT65 to be oddly addictive, but I digress...

Below  are screen captures of the thing in various modes of operation. I’m happy to share code, configuration data, notes, etc., if somebody can advise on the best place to post a directory full of that stuff. I don’t have a step-by-step installation document. If there’s interest, I can put that on my to-do list.

****Edit****

The source files are available here:
https://drive.google.com/open?id=0B0QDZpLElJ4tZ2JnTXBFUmtZR1E

****Edit****

The pop-up dialog at start-up of the script:



Voice/CW mode:



Fldigi:



Wsjt-x:



Cheers, Bruce, AG5GT