Let me address some code questions heard in various places. This is to save some people time and set others aright while they are struggling. It is somewhat surprising to me that these things need to be stated but my surprise is the reason they have not heretofore been stated, except at Dayton in the SDR evening forum, and even there in limited form.

Ignore the following: PortTalk, PortAudio, FFTW, Pthread except insofar as how we use them. You do not need to know their guts and I know I certainly DO NOT.

<<I>> do not know what fn_1, fn_2, ... are. I can't believe someone cares, thus my surprise. Here is what you should care about. Those things in FFTW allow us to compute fft's and inverse fft's. The API is straightforward, and this can be seen in DttSP in several places. To use fftw, you create a plan of action, and suprisingly enough, they call it a plan :-) . Its purpose is very similar (identical) to Frank's tx, rx, uni, etc. structs (classes) in DttSP, defined in sdrexport.h and constructed in setup_tx and setup_rx and main or winmain. It allows you to pass a HUGE set of configuration data around by passing a single pointer. If my life depended on it, outside of two or three things, I could not tell you what is in that plan struct. I could make a good guess. The point is, forget about. fn_1 is a mold spore, on the tree, that is in the forest, and you need to look at the forest. Outside of that, FFTW IS MAGIC. Use it and be grateful we have it. It was done by people more talented in the extreme at computing than I am.

PortTalk is the necessary magic to talk to the ports on our PC's directly under the heavily protected devices under Win NT and follow on's (2000, XP). It opens the virtual copies of those ports to us in user space. This allows many threads to talk to and write those ports and not step all over each other to some extent. If you have two different threads writing contradictory settings to external hardware being controlled by this port, it will happily do that. For us, we are reading and writing a couple of bits to do things that are not necessarily the (say) DDS settings and this stuff helps magically arbitrate all of that at the kernel level and appear virtually in user space. Think of it as write-through cache, if nothing changes, then nothing is actually written to the port until such time as something does change.

PortAudio is a bit of magic that allows us to have one single interface to all the sound hosts (except the one we really want: wdm-ks) on Windows. It appears that SOMEDAY, you will be able to use PortAudio on a Mac, Linux machine, Windows, etc. I do not see it easily displacing jack on Linux but time will tell.

pthread is a bit of wonderful coding that brings a standard multithreading library into being under Windows(Win32). It is another in an amazing collection of fantastic work by cygnus and has been co-opted by RedHat and continued. It is a FANTASTIC piece of work. It is what allows us to schedule the various dsp signal processing, control, error reporting, etc. threads.

Outside of this, all you need to know is what the api calls are and how do they work. I suggest you do exactly what we did. We went online, we googled, we found the FFTW, Pthreads-win32, PortAudio, and PortTalk online documentation and while it was in our browser, we hacked the lines that call the libraries. I could not even begin to tell you what was inside all of those hundreds of little functions in FFTW, Pthreads, etc. I know the hand full of lines of code that interface the libraries. That is all I need to know since it works. I am too busy to care about the guts so long as it works. One day, when something stops working or does not work as expected, I will care.

DttSP uses and makes calls to pthread, and fftw

Console application uses, and makes calls to PortTalk, PortAudio, and DttSP.

If you expect more documentation on these individual libraries that Console and DttSP make use of, it will not be forthcoming from the very busy people I know are doing code. But how we use them in Console and DttSP is a valid question. That we can and would love to document. WE MAY do so, most likely we will not. What would be most helpful would be someone who can write technical documentation to volunteer to work with us while we do the coding and produce the widgets. Some level of documentation by us is required for us to work together but that can be very terse indeed and usually consists of "Go to this URL and click on this", followed by "follow your nose". Eric sends me

"see:  http://msdn.microsoft.com/USUALLY_UNREADABLE_JUNK.htm "

almost every day.

May I suggest that doing this documentation would be an ideal way to learn what is happening. This is not laziness. Anyone that has seen me work 18 hours a day, read an hour, and then go to sleep will not be calling me lazy. There is no time for doing this detailed documentation and I have neither the talent nor the patience for it. Frank has the talent but even less patience. Eric has more talent, patience than any one man should but he has a one year old, one on the way, and a boss that keeps him busy 12 hours a day. He has managed to do a decent job with the manual. That too could use a talented person's help. SIGN UP.

Bob




Reply via email to