This is a quick description on how to build the Charleston Rx1 support for James Ahlstrom's Quisk, Version 3.4.8.
			By Terry Fox, WB4JFI.  Contact: wb4jfi@knology.net
Quisk is written by James Ahlstrom, see http://james.ahlstrom.name/
This file is based on installing on a system with Ubuntu 10.04LTS

The first step is to add all the dependencies, libs, etc, for a successful Quisk compile.  You will open Synaptic Package Manager (SPM) (under System/Administration/Synaptic Package Manager in the top-of-screen menu)(password required), then make sure "All" is selected in the left window.  In the "Quick Search" window, type in each of the following searches.  You will then highlight the recommended packages shown below by clicking on the little square box to the left of the package name.  Then, select "mark for installation".  You can either install each section individually by then clicking on "Apply" in the upper SPM menu, or wait until all packages are selected before clicking on Apply.  I usually do each section, that way I get a quicker warning if errors show up.  There will be other packages that have been previously installed either by you or the original Ubuntu installer.  In general, you can leave these other packages alone, with one exception, bluez-alsa, as noted below.  If you are interested, you can also install the "doc" packages for each of these.  Experts can use the "sudo apt-get install 'package'" method...

	A) (Charleston only) get libusb and support.  SDR-IQ uses a separate FTDI driver, see James Ahlstrom web site.
		Open Synaptic Package Manager, and search for libusb.  You want to install at least two files:
			libusb-0.1-4 	(this package may already be installed)
			libusb-dev
		These files may also be installed (I'm not sure which libusb is a better long-term solution)
			libusb-1.0-0
			libusb-1.0-0-dev

	B) get fftw3.
		In SPM, search for fftw.  You want to install two files:
			libfftw3-3
			libfftw3-dev

	C) get Python and dev support.  Python may already be installed:
		In SPM, search for python.  You want at least these two files:
			python (should already be installed, mine shows 2.6.5-0ubuntu)
			python2.6-dev

	D)  get sound_alsa support, and remove bluez-alsa, which can cause error messages at runtime.
		In SPM, search for alsa.  Note that if you are running a 64-bit machine/Linux, you may want the 64-bit versions.
			libasound2 (or 64-bit lib64asound2)	This file should already be installed.
			libasound2-dev (or 64-bit lib64asound2)

		In SPM, still under alsa, find bluez-alsa, and click on it, then select "Mark for Removal"

	E)  get portaudio and support.
		In SPM, search for portaudio.  You want to install two files:
			libportaudio2 (should already be installed)
			portaudio19-dev

	F)  get Python wxgtk support.  There will be additional packages automatically installed during this step.
		In SPM, search for wx.  One of these (and its support packages) may already be installed
			python-wxgtk2.6
			python-wxgtk2.8

That should complete downloading and installing the dependencies.  Next, copy a wx2.8 file to be a wx2.6 file.  This step is necessary to eliminate an Attribute error.  There are probably other ways to resolve the problem, but this works for me.  The error is: AttributeError: 'module' objuect has no attribute 'BitmapFromBuffer'.  To correct this, follow these steps:
	A) cd /usr/lib/python2.6/dist-packages
	B) sudo cp wx-2.8-gtk2-unicode.pth wx-2.6-gtk2-unicode.pth (you will need to enter your password)

Next, make sure the charleston folder and its files are within the appropriate Quisk (version) folder.  For example, copy/move the charleston folder into ~/quisk3.4.8.

copy the (ver)quisk_conf.py file from the charleston directory to your home directory as .quisk_conf.py (cp chas3.4.8quisk_conf.py ~/.quisk_conf.py).  NOTE there is a period before the file name in the final copy.

The file you just made (~/.quisk_conf.py) holds several configuration parameters that can be tweaked.  For now, leave it as it was, as its default values work for a Charleston board.  You can edit it, but because of the period at the front of the name, it may not show up in normal folder listings.  I use the old "joe" editor (SPM, and search for joe), because it reminds me of the old CP/M and WordStar days.  Plus, I HATE, HATE, HATE vi, emacs, etc.  I edit this file to select between my SDRIQ and Charleston boards.

Finally, all the preliminary work should be completed.  cd to the quisk directory, and type: make.  If all goes well, you will not see any error messages, just several lines during compile time.  Note that Jim's make also makes the SDRIQ directory, but not the charleston directory.

Next, compile the charleston support software.  cd into (quiskdir)./charleston, and type: make.  A couple of lines of files will be compiled will go by, hopefully no error messages here either.  You should ALWAYS compile the main quisk directory first, then the charleston directory, to make sure all files are properly synced.

If you were able to compile without errors, you are ready to test the code.  Plug the Charleston USB connector in, and wait for the amber "DONE" led to light.  cd back to the main quisk folder, and type: "python quisk.py".  After a few seconds, the Quisk window should appear, and the LEDs LD0, LD1, LD5, and LD6 shoudl start flashing quiskly.  The flashing leds indicate that data is being passed between the Digilent FPGA board and the host computer.

If you get a blank spectrum display and errors such as:
Init Chas Rx1: Chas Init failed!
Quisk Open Chas Rx1: Failed

then the Charleston board was not successfully connected to Quisk.  This is probably a hardware problem, double-check cables, Digilent power switch, etc.  Another possibility is that the USB port does not have user-access priveleges, make sure you start Quisk using sudo, or use the Python method mentioned above.

Another way to start quisk is to type: sudo ./quisk.py.  You will need to type in a password.  I'm working on why you need to run uisk as root (sudo) using this method, as one of my computers does not require this.

Once Quisk is successfully started once, it creates a file in your home (~) directory called "quisk_init.pkl".  This file holds the startup properties, such as band and frequency last used when shut down.  This file may have permissions that limit its alterations, effectively preventing it from being updated.  The can be changed in two ways, one is to change the group from (probably) root, to your group.  The other is to change the permissions to allow read and write by all (666).

I have included a subdirectory in charleston called filter_display.  I added a shadow to the quisk display that shows the present audio filter bandwidth, based on tuned frequency, mode, filter bandwidth, sample rate, etc.  It is still a little sketchy (but no crashes that I know of), so it is included for your enjoyment.  To use it, copy the file "filter_display_quisk.py to the main quisk directory as quisk.py.  Next, copy the file filter_display_quisk_conf_defaults.py to the main quisk directory as conf_defaults.py.  Note that these overwrite Jim's original version of those files, so make a copy of his versions first.  I usually put them in another folder called "originals".  Now, try it out.  Since these are Python files, no recompiling is necessary.

I also made notes on the changes necessary to add the filter_display to the above quisk files.  Those notes are in the file "filter_mods3.4.x.txt", where the 3.4.x is the quisk version.  These notes may help down the road as Jim modifies the quisk files.

That's it for the moment.  Enjoy Quisk on your Charleston SDR Receiver!
Terry, WB4JFI


