Thursday, June 30, 2005

vSound Ideas

I started to take a look at creating a virtual sound card driver for use with PowerSDR. Here are two ways that I thought about doing it:

vsc1

In the above figure we create two virtual sound card instances. They are virtually hooked together as depicted above. The advantage is that they appear to each application as a sound card so MME and DS can be used in both programs.


vsc3
In the above diagram, the driver creates one virtual sound card device and the third party program talks to it as normal using MME or DS.

PowerSDR talks to the driver using normal file read/write IO and custom IOCTL commands instead of through PortAudio's MME or DS.

Which one is preferred? Comments: Email Me

Wednesday, June 29, 2005

I have a preliminary serial to TCP bridge app. Here are some screenshots:

(click on the image for a full size version)

smallsamp

In the image above PowerSDR's TCP Listener is enabled to listen for connections on port 4444 as in the notes for June 28, 2005 below.

I have two pairs of vCOM ports enabled: The first pair is COM4 and COM5, the second pair is COM6 and COM7.

The Serial To TCP Bridge app connects the virtual com ports to TCP. The app connects to PowerSDR as a client on port 4444.

In the screenshot above HRD is set to connect to COM5. MixW is set to connect to COM7. In the Serial To TCP Bridge app above, COM4 and COM6 are set to bridge to TCP port 4444. Refer to the screenshot below:

bridge

The IP Address is the address of the computer where PowerSDR is running. It can be an IP address or a machine name (or "localhost").

The TCP Port Number must be the port that the PowerSDR TCP Server is listening to for connections (here 4444).

COM Port 1 is the virtual com port that you want to bridge to TCP in the first pair of ports you have installed. The Enable check box enables COM Port 1.

COM Port 2 is the virtual com port that you want to also bridge to TCP in the second pair of ports you have installed. If you have only one pair of ports installed then you should not enable the COM Port 2 selection. The Enable check box enables COM Port 2.

The Monitor check boxes determine whether commands can be sent from the virtual com port to the PowerSDR TCP Server or not. If checked, the virtual com port only receives from the TCP Server. Any commands sent to the com port in Monitor mode are not transmitted to the PowerSDR TCP Server. If unchecked the communication is both ways - any commands sent to that virtual port will be sent to the TCP Server. Using Monitor mode another radio can be slaved to PowerSDR.

The Connect button will attempt to connect to the PowerSDR TCP Server with the selected settings. The progress will be reported in the status window. If a successful connect is made the Serial To TCP Bridge form with minimize, otherwise it will report the error.

The Disconnect button will disconnect from the PowerSDR TCP Server. It also closes the Serial To TCP Bridge application.

Here is the source code diffs and the binaries (based on 1.3.12) to play with. You will have to copy the PowerSDR.exe binary over an existing installed PowerSDR 1.3.12.

Note that the N8VB Serial To TCP Bridge application has to be running on the same computer that HRD, MixW, etc... is running. With just the TCP CAT enabled in PowerSDR you do not have to have the virtual com ports installed on the PowerSDR machine (unless you are running all applications on the same computer).

Here is a diagram of how it is set up:

how it works

If you have only one pair of vCOM ports enabled then COM6 and COM7 above would not exist.

We can get more sophisticated in the monitoring setting by possibly filtering commands on the monitored port. It could be set up so that only query commands such as FA; or FB; can be transmitted to the PowerSDR TCP Server from the monitored port. Any set commands would be filtered out and not sent. We will have to explore these possibilites based on what users want to do with all of it.

Also, to use the bridge with a read hardware port we would need to put settings for the com ports on the bridge form. Right now it is hard coded in the software for 9600, 8, n, 1

Tuesday, June 28, 2005

I have added preliminary support for TCP in an experimental version of PowerSDR1.3.12. Here are a few screenshots:

(click on the image for a full size version)

small

The windows titled "TestClient" is just a fast app I wrote to test the CSocketClient and CSocketServer classes that I wrote. I am using it to send and receive to/from PowerSDR. The four windows represent four different simultaneous connections to PowerSDR.

I added a few items to the setup form:

setup

You can enable either CAT via Serial or TCP or both. For TCP you can set the maximun connections allowed and which port number the TCP server listens to for connections from clients.

I used an umodified PowerSDR 1.3.12 as a base so the new serial port code is not in it. This was just for testing purposes though. As Bill, KD5TFD brought up in an email conversation, we will probably have to serialize access to the PowerSDR CAT and a good place might be in the command parser.

The TCP stuff will probably not be integrated into the console until after 1.4.0 is out.

Here is a view of the two new files (3 classes CSocketClient, CSocketServer, TCPListener) added to make it work:

new

SocketUtilites.cs contains the asynchronous CSocketServer and CSocketClient classes.

TCPListener basically has the same function as SIOListener.

The next step is to create a TCP Client to Serial bridge what will allow you to connect to a virtual com port and send/rx data to/from the TCP server in PowerSDR.

COMMENT: I must say that Bob, K5KDN and Bill, KD5TFD have made it very easy to extend the CAT support based on their excellent code.

Friday, June 24, 2005

I wanted to add some additional fixed filter buttons to PowerSDR as well as two sliders for setting the filter low and filter high for the variable filters. PowerSDR is running out of room for all these "enhancements" so I added a tabbed control to the filter selection section of the screen to try to get some more room. See below:

one

two

When you select either one of the Var buttons on the Fixed Tab it automatically takes you to the Variable tab.

Oh, the above console has not been calibrated with my signal generator yet...

Can we gain some more room by putting some of the other controls on tabs? Comments, suggestions, hate mail: Email Me

Wednesday, June 22, 2005

Build 222 of the vCOM virtual serial port driver is released.

New Features:

Build 222 will now allow you to create up to 10 virtual com port pairs. Each pair acts like a virtual null modem cable.

By default, the inf file that comes with the download will create 1 pair (COM4 and COM5) by default. To change there settings you have to edit the inf file as follows:

Look for the section titled "Localizable Strings"

-------------------------------------------------------------------------------
; *******Localizable Strings*******
N8VB= "N8VB vCOM"
Desc_x860= "N8VB vCOM MultiportSerialdrivers"
N8VBvCOMDesc= "N8VB vCOM Virtual Serial Port Driver"

;NOTE: Edit the following to change com port number and amount of paired ports

;Number Of Pairs
;************
PAIRS=0x01
;PAIRS=0x02
;PAIRS=0x03
;PAIRS=0x04
;PAIRS=0x05
;PAIRS=0x06
;PAIRS=0x07
;PAIRS=0x08
;PAIRS=0x09
;PAIRS=0x0A
;NOTE: MAX is 10 pairs

;Pair 1
;************
PORT1="COM4"
PORT2="COM5"

;Pair 2
;************
PORT3="COM6"
PORT4="COM7"

;Pair 3
;************
PORT5="COM8"
PORT6="COM9"

;Pair 4
;************
PORT7="COM10"
PORT8="COM11"

;Pair 5
;************
PORT9="COM12"
PORT10="COM13"

;Pair 6
;************
PORT11="COM14"
PORT12="COM15"

;Pair 7
;************
PORT13="COM16"
PORT14="COM17"

;Pair 8
;************
PORT15="COM18"
PORT16="COM19"

;Pair 9
;************
PORT17="COM20"
PORT18="COM21"

;Pair 10
;************
PORT19="COM22"
PORT20="COM23"

-------------------------------------------------------------------------------

To change how many port pairs the driver creates you must uncomment one of the settings in the ";Number Of Pairs" table above. By default it is PAIRS=0x01. To create two pairs you need to comment out PAIRS=0x01 by putting a semicolon in front of that line (;PAIRS=0x01) and then uncomment PAIRS=0x02 by deleting the semicolon in front of that entry.

To change what port numbers are used for each pair you must edit the Pair(n) tables where n is 1 through 10. You must not use com port numbers that are created by a real hardware com port or driver installlation will fail.

Bug Fixes:

It is worthwhile to upgrade to build 222 even if you do not intend to use more than one pair of virtual com ports. I found a few bugs in the DeleteDevice section of the driver that caused problems with creating symbolic links if the driver was previously installed and them removed. The symbolic links were not being deleted correctly. This could either cause BSODs or failure of the driver to reinstall. Since I had to completely rwrite the AddDevice and DeleteDevice functions within the driver I corrected the bugs and now deletion of the symbolic links appears to work correctly.

See the installation procedure below for updating to build 222. Once this installation procedure is done and build 222 is on your system you should be able to uninstall, make changes to the inf file and then reinstall the driver without having to reboot the system. Also, future builds will be able to be installed without rebooting (hopefully ;-)).

Installing Build 222:

To upgrade to build 222 for an earlier build:

1. Go to Control Panel->System->Hardware->Device Manager and uninstall the current vCOM driver. It will be under Multi-port Serial Adapters in Device Manager.

2. Open Start->Run->RegEdit. In RegEdit navigate to HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM. If you see any entries named \Device\vComDrvx where x = 0...n, right click on these entries and select delete. This will delete any symbolic links that were supposed to be deleted when build 114 or earlier was uninstalled.

3. REBOOT your computer. This is important! Do not try to install build 222 until after you have rebooted your computer.

4. Go to Control Panel->System->Hardware->Device Manager and verify that the vCOM driver has not been loaded.

5. Edit the N8VB_vCOM.inf file as described above to select your virtual com ports and number of pairs.

6. Navigate to the N8VB_vCOMBuild222 folder and run install.bat (make sure you have admin privileges!). Some users have reported that just double clicking on install.bat in a Windows Explorer window does not work for them. It appears to be releated to Windows XP Home Edition. They have reported success by first opening a console window and running install.bat from there.

HRD NOTES:

To use PowerSDR with Ham Radio Deluxe you should select TS-50S for the radio type. The current CAT command support in PowerSDR does not implement all of the TS-2000 commands so HRD will update very slowly if you set it for TS-2000. Eventually HRD will support the SDR-1000, but right now selecting TS-50S works ok.

OTHER NOTES:

Eventually the vCOM driver will have a proper installation program that will make it easier to configure all of the settings.