sonyfxd
Warning: This is alpha software and interfaces
directly with the hardware. It may cause your system to stop working.
We are not responsible for any damage caused to your system from this
software. There is no warranty whatsoever associated with it.
sonyfxd is a daemon that will answer the Fn and PPK buttons. Assuming
you are running X, it will allow you to change the volume, mute the
audio system, and change the brightness of the screen.
Updated to Version 0.1.2 (See ChangeLog)
What it does
sonyfxd runs in the background and listens to requests. When a request comes
in, it executes the instruction found in the configuration file. It also
has support for muting the volume, changing the volume, and changing the
brightness. It allows you to do this by popping up an X window, where you
can change the value. You can exit the window by pressing Enter to keep
the current value or Escape to return to the original value. It will also
automatically close after three seconds of inactivity.
Installation
Please read this section carefully, and follow it exactly. The software
has little error checking built in and will likely crash if not everything
is perfect.
- Make sure you have a complete development environment on your computer.
You do not need to build it on your laptop, but you do need a recent kernel
(and the kernel include files).
- Download, compile, and install the
dotconf library. I am using this
library to parse the configuration file - saved me a lot of time. If you
are using an RPM based system, you can become root, download the file, and
execute an rpm -ta dotconf.tar.gz (replace the filename with the
correct name) to build RPM packages.
- Now make sure you have a kernel with the correct sonypi patches (see
my Vaio 220 web page for more information). This
will enable you to use all three of the PPK keys. You do not need the ACPI
patches, but they may be helpful in the long run.
- You need to make sure the sonypi module is loaded at start up each boot.
An easy way to do this (if you have Mandrake), is to add
sonypi nojogdial=1 fnkeyinit=1 to /etc/modules. Note
that the options used in that line are the ones you need to load in order to
use all the keys.
- By default, /dev/sonypi is only writable by root. If you want non-root
users to be able to use the software (you do want this), add
(if you have devfs enabled) chmod 777 /dev/misc/sonypi or (if you
don't have defs enabled) chmod 777 /dev/sonypi to
/etc/rc.d/rc.local.
- Now we have to compile. Download the
latest release,
unpack the source (tar jxf sonyfxd-<version>.tar.bz2), and cd
to the new directory (sonyfxd-<version>)
You now have a choice - if you just want a background daemon to run that
will let you lauch programs when the Sony keys are pressed, type in
./configure --without-x. If you want to be able to change volume, mute,
and change the LCD brightness in X using sonyfxd, type in ./configure.
Also, you can add --prefix=/usr to either of the two previous commands
if you want the software to install into /usr/bin and /usr/share/sonyfxd.
Otherwise, it will install into /usr/local/bin and /usr/local/share/sonyfxd.
- Now, type in make, and wait for the build process to complete.
If no errors are reported, become the superuser (su), type in
make install to install the program. If you ever want to uninstall
the program, typing make uninstall should do the job.
- The last thing that has to be done is to create the configuration file.
There is a sample in the package, which is called sample.conf. It
has comments which will let you know what each option does. Once you have
customized it to your needs, copy it to /etc/sonyfxd.conf
(or to .sonyfxd.conf in your home directory).
- Finally, we need to start the daemon. The best way (I think) is to add
a few lines into /etc/X11/Xsession. This file starts the window manager,
and will start the sonyfxd process as the new user. I just added the following
lines near the beggining of the file:
if [ -f ~/.sonyfxd.conf ]; then
/usr/bin/sonyfxd -C ~/.sonyfxd.conf &
elif [ -f /etc/sonyfxd.conf ]; then
/usr/bin/sonyfxd -C /etc/sonyfxd.conf &
fi
This will start the process up with either the user's preferences if they have
them, or the global file if they do not.
- The daemon uses three files for background images. They are installed in
/usr/local/share/sonyfxd or /usr/share/sonyfxd, depending on what
options you gave the configure script. You can change those files - just keep the same size and file format (xpm). This is the same size as the
backgrounds that Sony uses for the Windows versions. I am hoping Sony will
allow me to distribute those backgrounds, but for now, I am just distributing
very simple backgrounds.
Now, you're done. Test it out, and see if it works.
Report
any bugs you find, and if you want, help me out with coding it.
Command Line Options
sonyfxd accepts the following command line options:
-C <configfile> Configuration File
-d Start in debug mode (do not fork into background)
Known Limitations
- From what I have noticed, only one application can access
/dev/sonypi at a time. Once sonyfxd
opens it, you cannot use any other application to change the brightness or the
like.
- Although the windows that open it are supposed to stay on top, they may
not do so all the time. Please do not open any other windows while you are
changing the volume/brightness. - Should be fixed now, please let me
know if not
- Do not use another application to change the volume if you are using
muting. sonyfxd has to keep track of the mute status manually, since there is
no mute status for the sound on Linux (please correct me if I'm wrong).
- Do not clear out /tmp at each boot (or keep the Mute_State_File in a
different place).
Back to the home page
David Levitan <david@dlevitan.com>
Last Modified: 04/04/2002