Home > Geekspeak > Please ignore this post unless you are a total geek

Please ignore this post unless you are a total geek

So the last few days I have been working pretty solidly on a SerialServer. I inherited it from a previous employee at my work. Basically it enables serial devices to be connected to a network. It’s written in C and uses lots of threads.

This week I have fixed about a dozen defects in the code. Interesting ones included setting file descpitors to 0 and checking for -1 as the un-init value. When it is 0 and you write to it under Linux it outputs to stdio (i.e the screen). Other problems selective use of MUTEX’s a lot of them had been commented out. Lots of system calls weren’t checked for errors to.

Ended up adding the select system call before the LAN reads to make it more robust. However on my faster laptop this caused the system to have MUTEX problems. Turns out adding a usleep(1) when no data is found by select works quite nicely.

Using three usbserial (FTDI chips using ftdi_sio.c ) devices under 2.4.28-lck1 was causing the data to stop on one or more devices. However often no error was reported. Sometimes I got race errors and other input errors.

I decided to try a 2.6 series kernel. I decided on 2.6.10 (which I already had on my laptop) and it worked fine. Fixing the USB Serial issues. However I then had to update some of the startup scripts.

However the sound was still not working. The motherboard was a Cyrix MediaGX board. I couldn’t get it recognised. I needed to recompile the kernel using modules for the audio componenets. This meant I also had to update the mod-utils (I used the ubuntu ones). All but lsmod worked fine with the old libc on the target board. So that was fine. I tried compiling a geode-alsa driver I had found. However it wouldn’t compile with the 2.6 kernel. Eventually I tried using the sb module from oss with the irq=5 io=0×220 dma=1 and that worked!

Then I tried playing an mp3. The board was too slow for that and they played with a stuter. However .wav files played fine.

That’s all the issues I know of solved. Now I just need to get the control box working.

Geekspeak

  1. April 14th, 2006 at 19:27 | #1

    should’ve listened to your warning/blog entry title.
    gave me quite a headache!

  1. No trackbacks yet.