Thread: HQCT Driver.
View Single Post
Old 05-26-2006, 01:45 PM   #14
TheLlama
FLAC
 
TheLlama's Avatar
 
Join Date: Jul 2004
Location: All over the world
Posts: 984
OK. But in the meantime you can check out this zip file. The forums wouldn't let me upload a tarball.

I worked around the problem from above by simply placing a sleep at the end of the ioctl function. This causes ioctl to always block for at least 100ms, which in turn, doesn't allow you to send messages fast enough to overload the radio. This is just a fix until I redo the mechanics again.

So, it 'works', but it causes needless waiting and some lag. For example, if you send 20 tef commands at once, then you have to wait ~2seconds for them to all be processed. This should be good enough for people to start writing software with the API.

I am going to rework the innards and it will actually end up being a simplification. The user API will not change (except maybe for some additions). I plan to keep a queue of work needed to be done and have a kthread that loops on the queue and sends out the next packet every 100ms. Changing TEF settings (volume, bass, etc..) will still block until the command has executed, but it won't be a dumb wait like it is currently. Also, if the user sends multiple TEF settings then they will be collapsed into a single packet. For instance, if you set the volume to -10,-9,-8, and -7 within 100ms, then only the -7 will be sent.

Development notes I forgot to place in README:
Do not send TEF settings while seeking and do not seek while the module is initializing. These problems are easy to fix, but I'm going to wait for the new version.
You can use hqct_get_tef() to get the current TEF string. You should do this before your program closes and store the output to a file. This way your program can read the settings from file and use it as the 2nd parameter of hqct_init().

Files contained:
hqct.c - HQCT device driver
hqct.h - HQCT device driver header
hqctapi.c - The HQCT C API, check this file for documentation
hqctapi.h - The HQCT C API header, include this file in your programs
demo.c - Demonstation including initialization, blocking seek, and a few TEF settings.
Makefile - builds the driver, api, and demo
README - Read this, it will provides installation and development tips.

Attached Files
File Type: zip linux_hqct-2.zip (16.9 KB, 194 views)

Last edited by TheLlama; 05-26-2006 at 02:08 PM.
TheLlama is offline   Reply With Quote