UPD: If you have Sony Vaio FW2xx or FW2x models, please use dsdt-error-fw21.patch and dsdt-ati-fix-fw21.patch here.

UPD: If you have Sony Vaio FW3xx or FW3x models, use dsdt-error-fw21.patch then dsdt-error.patch and then dsdt-ati-fix-fw21.patch here.

sudo acpidump -b -t DSDT -o DSDT.aml
iasl -d DSDT.aml
sudo rm DSDT.aml
patch < dsdt-error.patch
patch < dsdt-ati-fix.patch
iasl DSDT.dsl
sudo cp DSDT.aml /etc/initramfs-tools/
sudo dpkg-reconfigure linux-image-`uname -r`
&#91;/sourcecode&#93;
Here we dumped our DSDT table and then decompilled it. Then patched with <strong>dsdt-error.patch</strong>, this patch fix wrong name ("_T_0") produced by disassembler. Without this patch we can not recompile this table back. Then we patch with <strong>dsdt-ati-fix.patch</strong>, this is the actual fix made by <strong>Zhang Rui</strong> from bugzilla, and recompile table back. And then we put our patched DSDT into initramfs, to allow kernel load it instead of original DSDT.
Fourth, we need to patch <strong>sony-laptop</strong> module to make our Fn keys for brightness work correctly:
<span style="color:#ff0000;">UPD</span>: If you have Jaunty kernel version &gt;= 2.6.28-11.36, do not do this step, this patch is included already.
Install kernel source and all packages needed for compiling it (who knows a better way to not download so many packages by build-dep? or build-essential is enough).
sudo apt-get build-dep linux-source-2.6.27
sudo apt-get install linux-source-2.6.27
cp /usr/src/linux-source-2.6.27.tar.bz2 ./
tar jxvf linux-source-2.6.27.tar.bz2
cd linux-source-2.6.27

Then put here (linux-source-2.6.27) sony-laptop.patch patch and make this:

Egaistek, I can’t thank you enough! I tried this out and it works beautifully. The only issue I am having is that my ‘brightness +’ key is missmapped somewhere and doesn’t work. The ‘brightness -‘ works perfectly. I just need to figure out how to reset the keymapping for KDE.
Oh well, I can still use guidance power manager or the console to adjust brightness in the mean time.

Egaistek, Your patch works just like it should. When I run xev I can see that the keys are returning unique keycodes, but they are mapped to “XF86STOP” and “XF86FORWARD” I have a feeling it is one of the remaining bugs in KDE4.1. I have been able to map other keys to do the same function, so I am able to get by until I figure out the proper fix.

josepcoves, brightness is set to default value after reboot, you can change it in power management preferences (right click on battery in tray).
I guess we can save last set value and then restore it after reboot with scripts etc, I’ll think about it then.

dwade, if the first patch not work for you, which laptop model do you have? the same is Joc have?

Tamagotono, yea, seems bug somewhere, because Gnome see this keys as XF86MonBrightnessUp/Down.

One thing though. I know it’s a miles of work but… I would love to see this packaged in proper patch form. Command line would even be nice and some simple graphical version would be awesome and would really help the people who are just stumbling into the world of Ubuntu and happen to have VAIO in front of them. Let’s face it, for normal user, command line is something rather scary. Hell, I wouldn’t want to use it myself either.

Egaistek, Joc:
I`m also having Sony Vaio FW Series Notebook… VGN-FW21M exactly. For me also first patch doesn’t work. It ends with the same error message like Joc’s… Is there any possibility to handle that?

I’ve tried also, on a fw21z, same error has Joc, I stopped there.
quick tip for those in my case, and using compiz, in the module “opacity, brightness and saturating”, you can configure to lower the brightness a little of all windows, menus… It helps a lot the eyes, if not the battery

Mikko Tikkanen, about the packaging. Well you see that there is problems with different bios versions etc. We can contact sony-laptop author to update it with patch, but again, this patch without patching DSDT is almost nothing. But again we can write shell script which can check bios/model version with dmidecode --type system and download needed packages/sources for compiling. If you want to help, let’s try =)

Egaistek : I had not answer from the terminal when doing those commands, and same error after
Is it possible that the sony-laptop module isn’t installed ?
I wasn’t able to find anything about this module
I’ll try later to do a second time the whole thing to see if anything changes

the modinfo return me this
“filename: /lib/modules/2.6.27-9-generic/kernel/drivers/misc/sony-laptop.ko
depends:
vermagic: 2.6.27-9-generic SMP mod_unload modversions 586”
so the sony-laptop seems to be installed
after the two commands before (modprode) I have still the same error for “dmesg | grep -i sony-laptop”

The Fn’s and gnome brightness applet do not work, but when doing the echo commands the brightness is changing

dwade ok, try commands from this comment, if this not work, try to apply original patch dsdt-ati-fix.patch and try commands again. If that not work, post output of commands from this comment after you apply original patch.

For myself with last update the brightness keys aren’t working, but the gnome applet is working perfectly, and the default brigness in power management to.

the results from the dmesg | grep -i sony-laptop aren’t the good ones, I m not at home, but I remember I had first time something like this:
[ 11.177295] sony-laptop: Sony Notebook Control Driver v0.6.
[ 20.642880] sonypi: please try the sony-laptop module instead and report failures, see also http://www.linux.it/~malattia/wiki/index.php/Sony_drivers

Nirgal, well again, in this comment you have patched sony-laptop right because you saw brightness osd, now you forgot to patch it or I don’t know. Last update touch only DSDT and not sony-laptop. Remake the 4th step again.

I see that sony-laptop module is loaded at you and detected fw series, but I don’t understand why fn keys not work. Does sound change when you use volume keys? Do you see sound osd while changing? Does osd like with sound pop up when using fn brightness keys?

As for sony-laptop, events is fine, I have the same, you should see brightness osd in Ubuntu anyway. But if you are in KDE (Kubuntu), the keys will not work. Anyway I can’t help you anymore with sony-laptop, because it looks ok. Try a clean install of Ubuntu Intrepid.

Yep, make another partition on your hard drive and install clean Ubuntu there for testings. You will have old installation and new for testings. Then make only 4th step on new. Reboot and try brightness keys. If that not help, I give up.

Hi!
Nice tutorial! The only thing that’s not working on my sony-vaio is the FN & sound keys. FN+F2 for mute and the multimedia (- and +) buttons. The rest of them I really don’t use.
The OSD for the sound volume and mute works, but it does nothing. Do you know any solution for this problem?
Btw, I have a Vaio FW11M.

Paulo Cabido, open volume control (double click on sound icon in tray), then use sound buttons and if you can see one of sliders changing it’s value, possibly it’s front or pcm, there is a solution. If you don’t see this, I can’t help.
The solution is: go to System->Preferences->Sound, select ALSA everywhere. In default mixer tracks select device HDA Intel (Alsa mixer) and select Master in channels list (there is a tip under that list). Then close and use your sound keys.

PROBLEM Kubuntu 64bit! Everything seems to be going well through the whole process but then it wont restar. It gets just in the Kububtu loading bar, recovery does not help either.Tried twice with different kernel versions. I twas working fine on 32bit.

Just the fact that uses all the 4gb of RAM. maybe a bit faster on soem applications only. Anyway, if it is not possible to make it work on 64bit I will fall back to 32bit it is not such a big deal.
Thank you very much anyway.

I have a FW21J with ubuntu 64 and it has worked great for me. brightness works fine and the fn keys work now too. I have 4Gb ram.
My only problems were that when I initially downloaded the source code it would not compile because of a function which was not declared anyway (strange), not sure either if the patch worked correctly for me. I deleted that part of the code and then it compiled fine. However, just I did this there was this update from 2.6.27-10 to 2.6.27-11, after updating the fn keys didnt work so I had to download source code againg for -11 and correct it, i did it all manually this time. After booting fn keys were working again.
So, thanks a lot!!

thank you for this blog. I’ve a z11 vn/b vaio and brigthness/acpi issues. I compiled kernel 2.6.27-11 without any improvments. I know this post is dedicated to the FW models; hope you have good pointers for me, many thanks🙂

Worked great for my FW21E with Linux Mint 6! The only thing not described that I had to do was to uncomment the lines with the source rep’s at sources.list. Also, I don’t know what it is supposed to do, but the special key S1 also decreases brightness. I bought this laptop yesterday and already have everything working under linux🙂

I have only partial success. Fn keys doesn´t work but
sending values to /sys/class/backlight/acpi_video0/brightness does brightnes changes.
I have FW21E, 2.6.27.10 kernel, patched dsdt table and sony-laptop and in kernel loaded custom dsdt table:

I don´t use gnome and my distribution version of gnome-power-manager has no option to change brightness so I can´t tell. I loaded sony-laptop module with debug option as you recommended and output is here:http://pastebin.com/f612e54f8
Thx for your time.

Well, the keys are working. Gnome controls brightness with gnome power manager. sony-laptop patched ok, it just handle key press events, not brightness control. So if you are in KDE or another DE, you should find app to control brightness which can hook on this keys.

Well, I can’t help you with KDE. My patches touching only drivers side and not front-end. If software can not handle hal events, it’s software issues, you can fire a bug on launchpad or bugzilla for kpowersave.
In this comments I saw someone using KDE too. Maybe he can help.

Charlylerouge, what do you mean by not working? Have you mapped this buttons to do something in keyboard shortcuts preferences? If no, there is nothing to do with this buttons by default.
If you did it, then make commands from this comment, but for S1 and AV buttons and not brightness.

Hey egaistek,
Your website has definitely made installing Ubuntu on my FW290 a much easier job.
I got your tutorial working on kernel 2.6.27-9-generic, no problems. Unfortunately, because of a bug in the kernel (https://bugs.launchpad.net/ubuntu/+source/linux/+bug/286285) I had to enable the intrepid-proposed repo and install kernel 2.6.27-11. The mentioned bug disappeared, but unfortunately I can’t get your tutorial to work anymore. I have re-done all the steps many times, deleting all installed files and installing them again, but no cigar.
When I press the fn keys, I get the brightness OSD working fine, but does not affect the brightness. Setting the brightness from the panel does nothing. There is nothing in /sys/class/backlight and “cat /proc/acpi/video/VGA/LCD/brightness” throws “” (ie. I can’t echo anything to that file). S1 and AV keys work fine. Any clues?

Also, before I was getting, for dmesg | grep -i sony-laptop, an additional comment:
sony-laptop: Sony: Brightness ignored, must be controlled by ACPI video driver
But then I found http://www.gossamer-threads.com/lists/linux/kernel/996431 and applied the patch there.
This only resulted in getting rid of that message, but nothing changed as far as brightness is concerned.

Pepe Gonzales, there is a bug in 2.6.27-11.23 kernel update from proposed which broken brightness control for many people, bug 311716. If you want to control your brightness, you can use 2.6.27-10 kernel.

2 egaistek: So if I understand well fn+F5 and fn+F6 keys
not changing brightness by default and I must do some special key mapping. Could you kick me to right direction how to make this? Sorry for stupid post, but I really don´t know where to start.

works great! I am on a sony vaio fw21z with Ubuntu 8.10 64bit and kernel version 2.6.27-9-generic. I was exactly following your excellent description with only one (hopefully minor) issue. When doing the “make” I get one warning “WARNING: /home/ckny/Downloads/Sony_Vaio_Ubuntu_Patches/kernel_src_and_packages/linux-source-2.6.27/drivers/misc/fujitsu-laptop.o(.text+0xebd): Section mismatch in reference from the function acpi_fujitsu_add() to the variable .init.data:fujitsu_dmi_table
The function acpi_fujitsu_add() references
the variable __initdata fujitsu_dmi_table.
This is often because acpi_fujitsu_add lacks a __initdata
annotation or the annotation of fujitsu_dmi_table is wrong.”. Do you also get this one?
I have also added my dmesg output as it differs slightly from yours:
[ 11.739381] sony-laptop: Sony Notebook Control Driver v0.6.
[ 11.808158] sony-laptop: detected Sony Vaio FW Series

ckny, I could not get it to work on 64 bit.I wonder why, maybe I should use the same Kernel as you. Is the mocrophone working in any of you? Will this fix be included in ant of the nexr ubuntu kernel? I am looking forward to a permanent solution

rodez, have not checked mic yet, but egaistek seems to not have it working. So I guess it’s not possible.
rodez, any more details about it? what do you get here:
dmesg | grep -i sony-laptop
dmesg | grep -i dsdt

@mazin
I think your comment got cut off.
But when egaistek says “sony-laptop” he means “sony-laptop”. You shouldn’t have to change any instructions from the post.
Mazin, please post any error message you might be getting.
Sometimes when you copy commands from the blog into the console, they might get a hash (#) added, which you have to get rid of. For example,
# iasl -d DSDT.aml
change it into
iasl -d DSDT.aml
It won’t work with the hash.

The only problem I ran into with this tutorial is the line:
make -C /lib/modules/`uname -r`/build/ M=`pwd` modules
which I had to run with sudo:
sudo make -C /lib/modules/`uname -r`/build/ M=`pwd` modules

i have the brightness working on my fw390 there are some additional lines you will need to patch in DSDT.dsl. I will try to either upload the new patch file somewhere or send it to the author of this blog when I get some free time.

quick question: I know it’s a little bit off topic, but does anybody have any clue on how getting a 32 bit epson printer driver to work on ubuntu 8.10 desktop 64 bit? Unfortunately, there is only a 32 bit driver provided by an external company for my excellent all in one printer epson PX800FW. That’s one of the last bits that are missing on my Ubuntu 8.10 64 bit setup on my sony vaio FW21Z.
thanks,
ckny

2 VtG: Forgive my ignorance but what do you mean text mode?
Anyway, the new ati driver is out (9.1) and it supposed to be flicker free so I jus might give it a try. I like the responsiveness of the xf86-video-ati though.

My current kernel 2.6.27-11-server. I got the source via apt as it is written in the document. But before done other parts except fourth, i could not change brigthness using power management. Now , i can not use F5 and F6 to change it.

damn, I’m a java programmer myself, and why was I acting as a noob here??🙂 I explicitly declared a boolean variable for all the C scripts where it used the ‘acpi_vendor_backlight_support()’ method, and now everything’s fine!
Thanks for the great work, egaistek! appreciate!

ps
ignore my second post about sony-laptop.c🙂 it was because I was re-patching on the already patched file🙂

well, sorry for being annoying and posting a fourth message, but please help me out. my ‘find /proc/acpi’ has only VGA, and no GFX0. But before applying these patches and steps, I remember it had only GFX0 and now VGA.. is it okay??

Thanks man, everything is working fine, except the S1, AV-MODE buttons and the internal mic.🙂

as for the compilation problems, I have just replaced the function “acpi_vendor_backlight_support()” to “true”🙂 assuming that it actually DOES support backlight🙂 and I’ve done it in all the files that report compilation problems due to the “acpi_vendor_backlight_support()” function.

Hi can anyone help please I have a EPSON Stylus
photo PX800FW it keeps flashing saying error the printers pads are at the end of their service life. I am looking for a reet code if anyone can help I would be grateful

ok i got on patched kernel, but ACPI does not take DSDT from initrd, it does not even check for custom dsdt
[18929.534548] sony-laptop: Sony Notebook Control Driver v0.6.
[18929.552251] input: Sony Vaio Keys as /class/input/input9
[18929.584612] input: Sony Vaio Jogdial as /class/input/input10
[18929.615059] sony-laptop: detected Sony Vaio FW Series

I applied the patches, but the first one did not work properly. The Brightness keys now work and show the little window, values in /sys/class/backlight/acpi_video0/brightness change by setting brightness up or down with fn-F5 and fn-F6, but the screen does not get lighter or darker.

I am on a Sony Vaio FW21Z with Ubuntu 9.04 64 bit (just upgraded to Jaunty) and am also using an Epson PX800FW. So in case you would like to exchange some info. I am using a trial software at the moment: TurboPrint …
Feel free to drop me an email: ckny at gmx dot net

Anyone else on Jaunty 64 bit yet?
Worked pretty smooth. Only (minor) drawback is that some of my applets (using AWN with Mac4Lin) do not work anymore. But it is probably just a matter of time. In addition to that, only 2.6.27-12 works for me. 28.11 leads to a weird screen display that is not usable at all. I had no time to debug so far.
Other experiences?
–CKNY

hi, thanks for this, everything is working great on my vaio.
i’ve a dumb question though. not really thinking clearly, i downloaded your patch to a new desktop folder and subsequently have all the files from your tutorial in subfolders of this folder. do i still need it or can i delete it? if i need it, is there a safe way to move it somewhere else – a tutorial perhaps :)?

cylebrity, you do not need to keep this files =) But if you will update the kernel package, the 4th step must be re-done. So it’s your choice to keep it or not and it’s save to move your folder anywhere you want )

but after a while I figured out all I needed to do was open the DSDT.dsl file with some text editor and switch any “_T_0” that showed up by “T_0” to get rid of the errors. I still got 3 warnings after that, but followed the walk-through anyway and after a restart the brightness controls worked perfectly.

Out of desperation I tried the fix proposed by Andre for the FW390 and substituted the string “_T_0″ in the DSDT.dsl file by “T_0″. Compilation still produces errors, but this way the .aml file is created.

The remaining steps went out without incident, up to the reboot. Runing the grep commands I get very similar results to those shown in the tutorial. Using the Fn key plus F5 and F6 a little menu shows up with a graphical bar that moves left or right. However, the screen simply keeps at full brightness.

What went wrong? Can anyone point out how to deal with the remaining errors when compiling the DSDT.dsl file?

I have a VGN-FW31E with Ubuntu 9.04. I did your tutorial, patched dsdt-error-fw21.patch, dsdt-error.patch and dsdt-ati-fix-fw21.patch, compile DSDT.dsl and reboot, but now Ubuntu cannot restart any more, it freezes at “Starting up…” !
When I launch the recovery mode, I see :

This can’t be just because of DSDT patching, if you did it correct. You can delete DSDT.aml (sudo rm /etc/initramfs-tools/DSDT.aml) file in recovery mode and then do dpkg-reconfigure linux-image-`uname -r` to clear DSDT modification from system.
If system boots ok, you can try this guide.
If not, that means that you did something more than just DSDT patching.

However I’m having kernel panics do to a buggy iwlagn wireless driver with the factory ubuntu driver.
Do you have this patch to the latest kernel(2.6.30-rc7) from kernel.org ? I tried to apply it but it failed, the modules has too much changes.

Hi. I have a FW31M and applying the patches as they appear at the beginning return an error, as the (buggy) _T_0 variables seem to appear somewhere else. Anyway, I applied the first and second patches without problems and then I manually corrected the _T_0 variables to be T_0. Compilead and recompiled, and the volume keys are working and nothing else (ethernet, wireless, bluetooth, CD, USB, etc.) seems to be broken, so I assume it is pretty safe.

Where can / should I send the original and patched up DSDT for other to benefit from this?