Linrad support: The hardware related parameters
(Feb 15 2007)
Screen under Windows and X11
Sound under Linux
Sound under Windows

The screen set up under svgalib

When Linrad is started for the very first time you will see this message:

Setup file dsp_uiparm missing.
Use W to create a new dsp_uiparm file after setup.

Press S for setup routines.
Any other key to exit.
Then press enter.

=>


After pressing S and enter you will first get a selection of screen modes. These are the video modes reported to be present by svgalib. What svgalib is doing can be controlled by the /etc/vga/libvga.config file. The 640 x 480 screen should work with the default config file.

It is a good idea to use vgatest, a small program that Linrad compiles for you if you use svgalib. Use it to check that the screen sync rates are correctly set and that the desired screen modes really work.

Next you have to select a font scale. The smallest font 1 will give most screen area for waterfalls and spectra, but if your screen has a large number of pixels you may want to select bigger fonts.

When you have selected the font scale Linrad will switch to the selected graphical mode and if svgalib works OK you will then be prompted for mouse speed reduction factor. Enter 4 here to start with.

After that you are prompted for a parallel port address. The distribution version of Linrad assumes you have a WSE converter system and it would need a parallel port for frequency control. You may supply a users_hwaredriver.c to make the parallel port fit other hardwares. If you have a standard PC the standard com1 location is 888 (0x378 hex). Enter 0 if you do not want to use the parallel port.

If a parallel port address was entered, the next item is the pin that the WSE drive routine should use to check that the units are working. Default is 10, the acknowledge pin of the parallel port but in case this pin is damaged you may use another control pin. Be extremely careful to avoid static electricity, always make sure that the chassis of the computer is in good electrical contact with the chassis of any hardware before connecting the parallel port. With printers etc this is normally ensured by the grounding through the mains cable which should be connected first. A WSE system is typically not grounded through the power supply but through the cable to the Delta 44 which has to be connected first. It is always a good idea to have an extra ground connection as a safety precaution.

You should now have the main menu on the screen. Press W to save the setup to disk (create dsp_uiparm.

Optimising the svgalib screen

If you are going to use Linrad with a normal SSB receiver a 640 x 480 screen is sufficient. To monitor only a few kHz bandwidth this screen has plenty of pixels!

If your hardware can supply much more bandwidth, screen size is a limiting factor for system performance and then you should try to use the biggest possible screen.

Press S on the main menu and try a larger screen. The new mode will most probably be ok for your videocard. Svgalib thinks it is any way if you are given the choice....

If your monitor will accept the vertical and horisontal sync frequencies is quite another thing. If the monitor does not show the main menu properly on the bigger screen you should edit /etc/libvga.config and set the frequency ranges properly for your monitor. If this does not help there are many more things one can do with libvga.config but I can not provide any guidance.

If the new and bigger screen is ok - and if you want to use it, press W to update dsp_uiparm.

Note that it may be quicker to do the libvga.config screen configuration with the ./vgatest command rather than by using Linrad.

The mouse under svgalib

If you are not happy with the mouse, if it is moving too slowly or too quickly across the screen you can change the mouse speed reduction factor. Press S enter a different value for the mouse speed. A bigger number makes the mouse move slower.

As an alternative you may change the mouse parameters in libvga.config.

In case the mouse moves too quickly it will not be possible to resize the windows. The mouse cursor has to be placed exactly on the border line to grab it, and if mouse speed is too large the mouse will move two or more pixels at a time making it impossible to place the cursor on some positions.

The screen set up under X11 or Windows

When Linrad is started for the very first time you will see this message:

Setup file dsp_uiparm missing.
Use W to create a new dsp_uiparm file after setup.

Press S for setup routines.
Any other key to exit.
Then press enter.

=>


After pressing S and enter you will first be prompted for a font scale. (1 to 5) The smallest font 1 will give most screen area for waterfalls and spectra, but if your screen has a large number of pixels you may want to select bigger fonts.

Next you are prompted for a parallel port address. The distribution version of Linrad assumes you have a WSE converter system and it would need a parallel port for frequency control. You may supply a users_hwaredriver.c to make the parallel port fit other hardwares. If you have a standard PC the standard com1 location is 888 (0x378 hex). Enter 0 if you do not want to use the parallel port.

If a parallel port address was entered, the next item is the pin that the WSE drive routine should use to check that the units are working. Default is 10, the acknowledge pin of the parallel port but in case this pin is damaged you may use another control pin. Be extremely careful to avoid static electricity, always make sure that the chassis of the computer is in good electrical contact with the chassis of any hardware before connecting the parallel port. With printers etc this is normally ensured by the grounding through the mains cable which should be connected first. A WSE system is typically not grounded through the power supply but through the cable to the Delta 44 which has to be connected first. It is always a good idea to have an extra ground connection as a safety precaution.

You will then be prompted for screen size. Depending on how the graphical environment (Desktop) is setup, the maximum useful size is somewhere in the range 85% to 98%.

You should now have the main menu on the screen. Press W to save the setup to disk (create dsp_uiparm.

A/D and D/A setup under Linux.

Press U on the main menu for A/D and D/A setup. If some dedicated SDR hardware is detected you will first be prompted whether you want to use it or not. If you select to use a PC soundcard or do not have any dedicated SDR hardware, Linrad will try to open all reasonably named device drivers and those which can be opened and seem to be ok are presented on the screen with their main characteristics.

If the /dev/sndstat file is found and if your screen is wide enough the information from /dev/sndstat will be displayed on screen. This information may be helpful to find out what sound driver to select on systems with many sound devices. Select one of the device drivers with the number of the corresponding line. If you have just one soundcard selecting /dev/dsp with line number 63 is usually a good idea.

Next you have to decide if you want to open the device as RDONLY (if the device can be opened both as RDWR and RDONLY). Do not use RDWR with modern hardware. There is no need to force the same sampling speed for input and output if they use independent hardware. If the soundcard does not actually have two devices, the sound system may still look like it had. Under OSS it is for example possible to open two devices for a VIBRA16X soundcard. One for RDONLY and another for WRONLY. These two are using common hardware and changing the sampling speed on one of them will affect the other one as well and cause incorrect behaviour of the system. Using just one device opened as RDWR avoids those problems but I do not have the experience to tell which will work better in case there is any difference. Differences may show up in the behaviour when sound output is stopped and started again as will happen each time a new signal is selected.

If you have a high performance system with a Delta44 or similar soundcard for high speed input you need a second soundcard for the output. The Delta44 will not allow different sampling speeds for input and output and Linrad is not designed for high speed output.

When Linrad knows what device to use for input and how to open it, the device is tested. If all is OK the next parameter to set is the radio interface. the choices are:

1: One rx channel, normal audio.
2: One rx channel, I/Q stereo (direct conversion rx)
3: Two rx channels (adaptive polarisation/phasing)
4: Two rx channels, I/Q stereo (adaptive polarisation/phasing)


The fourth line is present only if your input device has 4 A/D channels. (Or if you have opened two stereo channels on the same soundcard) Normal audio means a real valued signal such as the audio output of a normal radio receiver. I/Q stereo means a complex signal that uses two A/D channels to send the in phase signal and the quadrature signal from a direct conversion radio to the soundcard. Select the mode that fits your analog hardware.

Next you have to select the sampling speed. For some soundcards there is only one frequency to select because the selection is already done by the system mixer program. Under OSS and with a Delta44 soundcard, the sampling speed is set with the ossmix program. Normal soundcards give you a range like 5000 to 44100Hz but very simple soundcards may allow only one choice, 48 kHz.

The A/D sampling rate has a large influence on the work load for the CPU. On modern computers (Pentium III and up) CPU power is usually no issue so it does not matter if you sample faster than necessary.

To process normal SSB bandwidth a sampling rate in the range 5000 to 8000Hz is sufficient. Heavy oversampling at low bandwidth, like 44100Hz for an SSB receiver may improve the dynamic range of the digital processing but that is of no value at all because an SSB receiver is limiting the dynamic range within the passband anyway. Already without oversampling the computer has a much better dynamic range than an SSB receiver.

If your analog hardware provides a real signal you should start by selecting the lowest possible pitch. Place the BFO as close as possible to the passband, not further away than necessary to get sufficient attenuation of the mirror image (the other sideband). This way you make the highest frequency as low as possible.

As an example, select 6000Hz for the sampling speed. The Nyqvist frequency is then 3000Hz, and that is the highest frequency that can be present in the digital signal. Assuming the analog hardware is a normal SSB radio, the signal spectrum is flat between 200 and 2600Hz or so. At 3000Hz the level has dropped by perhaps 20dB and at 3300Hz the signal is down by perhaps 50dB. A signal at 3300Hz will show up as a signal at 2700Hz in the digital representation but the anti alias filter inside the soundcard has suppressed it further so it is well below -50dB when it shows up as an alias spur. In case the mirror image gives spurs, move the BFO by 1 kHz in this example and set the sampling speed to 8000 Hz. Performance at the high side will be the same but the mirror image between 0 and 2.2 kHz will disappear.

Make a preliminary selection based on what you think about your analog hardware. When the setup is finished, Linrad is an excellent spectrum analyser and you can easily evaluate the spur levels and decide if you can reduce the sampling rate or possibly gain dynamic range by increasing it. It will also be easy to set the BFO pitch for good suppression of the image spur with minimum offset from the passband.

If your A/D converter has more than 16 bits you will be prompted for A/D data format. You may choose 16 or 32 bits. Even if you have a 24 bit soundcard like Delta44 it is not obvious what choice to make. The Delta44 soundcard is said to be a 24bit A/D converter but that is not true at all. When run at 96kHz it is perhaps 16.5 bits and the loss in dynamic range by selecting 16 bit format is very small. Selecting 32 bits causes a minimal increase in processor load, typically less than 1%. The disadvantage of using 32 bit format is that saving data on the hard disk is somewhat slower. In 32 bit mode Linrad saves raw data in a 18bit format which uses 12.5% more disk space than the 16 bit format. As it happens, my PentiumIII can save data for long periods of time in 16 bit format, but with 12.5% more disk load, the disk writes take too much time and A/D overrun starts to become a problem.

Finally you have to select an output device driver. The output sampling speed and number of bits is not set here among the general parameters since different processing modes may need different formats.

As an example wideband AM may need 24 kHz to provide good sound quality on music while morse code does not even need 5000 Hz, the lowest speed I have seen supported by hardware.

Another example: When saving the loudspeaker output from Linrad there is no need to use more than 8 bits if S/N is very low. That would make the saved file twice smaller.

Do not forget to press W to save your new parameter selection in the dsp_uiparm file.

A/D and D/A setup under Microsoft Windows.

Press U on the main menu for A/D and D/A setup. If some dedicated SDR hardware is detected you will first be prompted whether you want to use it or not. If you select to use a PC soundcard or do not have any dedicated SDR hardware, Linrad will show a list of all the available sound devices.

Select one of the device drivers by the number of the corresponding line.

Next you have to supply a sampling speed. Be careful to select a sampling speed that your hardware really can supply. If you type in something else, Windows will happily make a rate conversion in software and supply what it thinks you want. Figure 1 shows the spectrum with a Delta 44 when Windows is asked to supply 96 kHz. Figure 2 shows exactly the same signals, the only difference is that the Windows sound driver is asked to supply 100 kHz.



Fig. 1 Two strong signals. 10.681 MHz and 10.716 MHz with a Delta 44 soundcard (unmodified) under Microsoft Windows with the sampling speed set to 96 kHz.


Fig. 2 Two strong signals. 10.681 MHz and 10.716 MHz with a Delta 44 soundcard (unmodified) under Microsoft Windows with the sampling speed set to 100 kHz.

From these figures it is obvious that the Windows sound driver uses the Delta 44 at 48 kHz because the 10.681 MHz signal is missing. The software upsampling to 99.373 kHz increases the noise floor and adds spurious signals. In Windows one can choose the compromise between resampling quality and resouces utilized for that. The control is at |Control Panel|sound and Audio Devices|Advanced|. This control is available in some Windows installations depending on update status and presumably drive routines installed. Unfortunately this control does not affect the mediocre quality of the (nominal) 100 kHz signal from a Delta 44 even in cases when the control is present (at least not under Win 2000.)

If you have a high performance system with a Delta44 or similar soundcard for high speed input you need a second soundcard for the output. The Delta 44 will not allow different sampling speeds for input and output and Linrad is not designed for high speed output.

The A/D sampling rate has a large influence on the work load for the CPU. On modern computers (Pentium III and up) CPU power is usually no issue so it does not matter if you sample faster than necessary.

To process normal SSB bandwidth a sampling rate in the range 5000 to 8000Hz is sufficient. Heavy oversampling at low bandwidth, like 44100Hz for an SSB receiver may improve the dynamic range of the digital processing but that is of no value at all because an SSB receiver is limiting the dynamic range within the passband anyway. Already without oversampling the computer has a much better dynamic range than an SSB receiver.

If your analog hardware provides a real signal you should start by selecting the lowest possible pitch. Place the BFO as close as possible to the passband, not further away than necessary to get sufficient attenuation of the mirror image (the other sideband). This way you make the highest frequency as low as possible.

As an example, select 6000Hz for the sampling speed. The Nyqvist frequency is then 3000Hz, and that is the highest frequency that can be present in the digital signal. Assuming the analog hardware is a normal SSB radio, the signal spectrum is flat between 200 and 2600Hz or so. At 3000Hz the level has dropped by perhaps 20dB and at 3300Hz the signal is down by perhaps 50dB. A signal at 3300Hz will show up as a signal at 2700Hz in the digital representation but the anti alias filter inside the soundcard has suppressed it further so it is well below -50dB when it shows up as an alias spur. In case the mirror image gives spurs, move the BFO by 1 kHz in this example and set the sampling speed to 8000 Hz. Performance at the high side will be the same but the mirror image between 0 and 2.2 kHz will disappear.

Make a preliminary selection based on what you think about your analog hardware. When the setup is finished, Linrad is an excellent spectrum analyser and you can easily evaluate the spur levels and decide if you can reduce the sampling rate or possibly gain dynamic range by increasing it. It will also be easy to set the BFO pitch for good suppression of the image spur with minimum offset from the passband.

If your A/D converter has more than 16 bits you will be prompted for A/D data format. You may choose 16 or 24 bits. Even if you have a 24 bit soundcard like Delta44 it is not obvious what choice to make. The Delta44 soundcard is said to be a 24bit A/D converter but that is not true at all. When run at 96kHz it is perhaps 16.5 bits and the loss in dynamic range by selecting 16 bit format is very small. Selecting 32 bits causes a minimal increase in processor load, typically less than 1%. The disadvantage of using 32 bit format is that saving data on the hard disk is somewhat slower. In 32 bit mode Linrad saves raw data in a 18bit format which uses 12.5% more disk space than the 16 bit format. As it happens, my PentiumIII can save data for long periods of time in 16 bit format, but with 12.5% more disk load, the disk writes take too much time and A/D overrun starts to become a problem.

When Linrad knows what device to use for input and how to open it, the device is tested. If all is OK the next parameter to set is the radio interface. the choices are:

1: One rx channel, normal audio.
2: One rx channel, I/Q stereo (direct conversion rx)
3: Two rx channels (adaptive polarisation/phasing)
4: Two rx channels, I/Q stereo (adaptive polarisation/phasing)


The fourth line is present only if your input device has 4 A/D channels. (Or if you have opened two stereo channels on the same soundcard) Normal audio means a real valued signal such as the audio output of a normal radio receiver. I/Q stereo means a complex signal that uses two A/D channels to send the in phase signal and the quadrature signal from a direct conversion radio to the soundcard. Select the mode that fits your analog hardware.

Finally you have to select an output device driver. The output sampling speed and number of bits is not set here among the general parameters since different processing modes may need different formats.

As an example wideband AM may need 24 kHz to provide good sound quality on music while morse code does not even need 5000 Hz, the lowest speed I have seen supported by hardware.

Another example: When saving the loudspeaker output from Linrad there is no need to use more than 8 bits if S/N is very low. That would make the saved file twice smaller.

Do not forget to press W to save your new parameter selection in the dsp_uiparm file.




SM 5 BSZ Home page

Linrad home page