# Sony Vaio S4 Series

## knefas

This HOWTO is out to date. 

For the actual maintained one please move to the wiki and feel free to contribute  :Wink: 

We'll keep this thread for discussion and support

So let's write (in what I hope will be some kind of English, forgive me  :Wink: ) something about this laptop. I have a S4M/S but it is called S460 S480 etc in USA and probabily they use the same configuration. Let me know if this works with your laptop!  :Wink: 

NOTE: many of the urls that I've linked works only if you cut the url and paste them in you address bar.

0. Before we start

I think you want to remove the "Designed for Ms Windows XP" sticker, I did. It's one of the most difficult part of the installation, but just take your time and use your nails.  :Cool:  Ok, seriously: 

1. Basic System

Select "MPENTIUMM" in kernel config. I have this in my make.conf 

```
CFLAGS="[...] -march=i686 [...]"

USE="[...] sse sse2 mmx [...]"
```

2. Disk

Disk is a S-ATA disk, so you need SATA support built-in in the kernel.

N.B. hdparm has no support for sata disks at the moment.

There is a big (10GB) recover partition at the beginnig of the disk. Make recover DVDs from Vaio Recover Utility in Win and wipe it, if you want. I did. Just remeber the bootable DVD is actually the *second* you burn.

3. Frame buffer

At the moment I'm using gentoo-sources-2.6.12-r9 and splashutils-1.1.9.9. I could manage to get the 1280x800 framebuffer, so I stay with 1024x768 (vga=791). vesafb-tng is doing strange things with my display, so I stayed with vesafb. 

4. X

Nvidia 6200 Turbocache and a 13.3'' TFT widescreen. You need ~x86 nvidia-gfx and nvidia-kernel or it won't work. So unmask them (/etc/portage/package.unmask), add them to /etc/portage/package.keywords and finally emerge them. Echo "nvidia" >> /etc/modules.autolad/kernel-2.6 to have it load at boot.

In Xorg.conf we need something like 

```
Section "Device"

        Identifier  "Card0"

        VendorName  "nVidia Corporation"

        BoardName   "GeForce Go 6200"

        BusID       "PCI:1:0:0"

        Driver      "nvidia"

        Option      "RenderAccel" "true"

        #Option      "NoLogo" "true" 

        Option      "NvAGP" "1"

EndSection 
```

 and disable the kernel dri 

```
Section "Module"

...

#       Load  "dri"

```

We also need to set the display properly, and something like this will do it

```
Section "Monitor"

        Identifier   "Monitor0"

        VendorName   "Sony"

        ModelName    "X-Black"

        Option       "dpms"

        HorizSync    29-60

        VertRefresh  0-60

        DisplaySize  285 179 #important to set dpi properly

        Modeline "1280x800"  68.56  1280 1336 1472 1664  800 801 804 824  -HSync +Vsync

EndSection

Section "Screen"

        Identifier "Screen0"

        Device     "Card0"

        Monitor    "Monitor0"

        DefaultDepth 24

        SubSection "Display"

                Viewport   0 0

                Depth  24

                Modes "1280x800"

        EndSubSection

EndSection

```

Touchpad 

```
emerge x11-misc/synaptics
```

```
Section "InputDevice"

        Identifier  "Touchpad"

        Driver      "synaptics"

        Option   "Protocol"      "event"

        Option      "Device" "/dev/input/event2"

        Option      "ZAxisMapping" "Y"

        Option      "Emulate3Buttons" "true"

        Option      "Emulate3Timeout"  "100"

   # Next line required only if you want to disable the mousepad while typing:

        Option "SHMConfig" "on"

   # Tweak this option as you like, it works anyway, have a look in 

   # /usr/share/doc/synaptics*/README.gz for more options

       Option   "LeftEdge"      "60"

       Option   "RightEdge"      "830"

       Option   "TopEdge"      "70"

       Option   "BottomEdge"      "650"

       Option   "FingerLow"      "25"

       Option   "FingerHigh"      "30"

       Option   "MaxTapTime"      "180"

       Option   "MaxTapMove"      "50"

       Option   "EmulateMidButtonTime"   "75"

       Option   "VertScrollDelta"   "50"

       Option   "HorizScrollDelta"   "50"

       Option   "MinSpeed"      "0.50"

       Option   "MaxSpeed"      "0.9"

       Option   "AccelFactor"      "0.02"

       Option   "EdgeMotionSpeed"   "40"

       Option   "UpDownScrolling"   "1"

       Option   "TouchpadOff"      "0" 

EndSection

```

5. Network

The network adapter is 

```
0000:06:08.0 Ethernet controller: Intel Corporation 82562ET/EZ/GT/GZ - PRO/100 VE (LOM) Ethernet Controller Mobile (rev 03)
```

 so you need CONFIG_E100 enabled in you kernel. If you put is as module remember to echo "e100 >> /etc/modules.autoload/kernel-2.6"

```
0000:06:0b.0 Network controller: Intel Corporation PRO/Wireless 2200BG (rev 05)
```

 So we need piw2200 drivers 

```
emerge net-wireless/ipw2200
```

 N.B. I have not yet tested it, but it should work.

6. Sound

Yes, the sound is really poor. But anyway we want it working. So enable 

```
 Symbol: SND_HDA_INTEL [=m]

   Prompt: Intel HD Audio

   Defined at sound/pci/Kconfig:517

   Depends on: !M68K && SOUND!=n && PCI && SND

   Location:

     -> Device Drivers

       -> Sound

         -> Advanced Linux Sound Architecture

           -> Advanced Linux Sound Architecture (SND [=m])

             -> PCI devices

   Selects: SND_PCM
```

and edit /etc/modules.d/alsa with something like

```
alias snd-card-0 snd-hda-intel
```

 and 

```
rc-update add alsasound default
```

 If you prefer using alsa-driver then put 

```
ALSA_CARDS="hda-intel"
```

 in /etc/make.conf.

It seems that adding 

```
options snd-hda-intel position_fix=1
```

 in /etc/modules.d/alsa (remeber to run modules-update after any changes) you get better results. Try also with position_fix=2. But to do this you need ~x86 alsa-drivers, since hda-intel is quite new and still under developement. I didn't try yet.

(Thanks to pijalu for this tweak)

7. ACPI

ACPI at least works. You get the power button event and the lid open/close. You also get ATF0 themperature. You can switch on/off the dvdrw device with sony_acpi.

Frequencies: I don't have yet understood if we have 4 or 8 clock steps. But just follow the  Power Management Guide. I use cpufreqd and it works quite well.

8.  LCD Brightness

The brightness isn't acpi governed, but it uses something in nvidia interface. There is a workaround (thanks Erik Waling!) for this, just use smartdimmer for linux . This is the very first release, so expect enchanchements, it will probabily be integrated in nvclock.  I wrote a quick and dirty ebuild for it, just download it (copy&paste the url) and set put it in your $PORTDIR_OVERLAY/media-video/smartdimmer. Then remeber to (See the docs for more[ info) 

```
ebuild $PORTDIR_OVERLAY/media-video/smartdimmer/smartdimmer-0.1.ebuild digest

emerge -av smartdimmer

```

  See what you can do with 

```
smartdimmer -h
```

9.  Fn key

Now they work, really thanks again to Erik Waling for this. To make them work you need to:

patch your kernel (HOWTO) with this patch. Hopefully this will be integrated in the next relase of sonypi, but for the moment (01/08/2005) this step is needed.

then configure sonypi, read the doc (/usr/src/linux/Documentation/sonypi.txt), but mainly you need to do something like 

```
echo -e "alias char-major-10-250 sonpi \noptions sonypi minor=250" > /etc/modules.d/sonypi

mknod /dev/sonypi c 10 250

modules-update
```

Then set SONYPI (-> Device Drivers -> Character devices) as module and 

```
make modules modules_install
```

Then you need some kind of daemon to grab the keys and do something. I've "upgraded" for our Vaio a quite old project, sonykeyd, you can get the ebuild here  (copy&paste). Put it in $PORTDIR_OVERLAY/app-laptop/sonkeyd, remeber to regenerate the digest, and emerge it. 

```
rc-update add sonypi default

/etc/init.d/sonypi
```

 will run it and add it to the default runlevel. 

The script run when an event occurs is /usr/local/sbin/sonykey.sh, in this version it enables audio (with alsa) and brightness control (you need smartdimmer, read section 8. This is far from perfect, and will be probabily updated with your help.  :Smile: 

Oh. If you want to use the events that occurs by pressing the fn key (i.e. fn+F1) in X you need to translate the event to the X event interface. That can be done in several ways, one of them is using evrouter. (see [1]) But I fond easier to edit sonykeyd (you find the ebuild in this 3d) and add an XTestFakeKeyEvent routine. I'll post the patch as I find the time to check it, just mail me if you're interested meanwhile  :Wink: 

If you want some kind of on-screen-display you can 

```
emerge xosd
```

 (use the ~x86 version, the stable one is too old) and edit your sonykey.sh. I use this commands (put them in the relevant secion of sonykey.sh) 

```
CATCOM="osd_cat -f -*-aquafont-*-*-*-*-17-*-*-*-*-*-*-uni -c red -s 1 -d 1 -o 30 -i 150 -p bottom"

${CATCOM} -b percentage -P $(amixer sset 'Front' 5- | awk '{if(match($5,/[0-9]+%/)){ print substr($5,RSTART,RLENGTH-1)}}') -T Volume #volume +5

${CATCOM} -b percentage -P $(amixer sset 'Front' 5+ | awk '{if(match($5,/[0-9]+%/)){ print substr($5,RSTART,RLENGTH-1)}}') -T Volume #volume -5

${CATCOM} -b slider -P $(smartdimmer -g | awk '{print $3*100/21}') -T Brightness #brightness status

echo mute | ${CATCOM} # displays what you "echo"
```

Ok, that's all for now, I'll add as I we find something more!

Hints are always welcome  :Wink: 

EDIT1: you can see some other interesting notes [1] here

EDIT2: added sect. 0  :Wink: 

EDIT3: ACPI news...

EDIT7: Brightness control now works!

EDIT11: Added smartdimmer ebuild

EDIT13: Now FN key works, added ebuild.

EDIT15: Some more news on FN keys.

EDIT18: xosd part

(the other edits are just typos or minor things!)Last edited by knefas on Fri Aug 26, 2005 7:25 am; edited 21 times in total

----------

## LoDown

Very nice...is extremely helpful...

----------

## blinksilver

https://forums.gentoo.org/viewtopic-t-335267-highlight-s460.html?sid=bdaa4af510b65afb021e30995d1e3804

have you tried that, i the newer FS is just like the newer S, so  I think it will work, made a post there to see if I can get some help, will se what happens

----------

## knefas

Yes, I knew about that. The facts are that sony_acpi does not work on s4, and probabily display brightness is not controlled by ACPI. You see, when you boot in Windows the brightness is changed after the loading of nvidia drivers. So it should have something to do with nvidia, powermixer, smartdimmer or so.

Some other resources that i've found: 

http://www.homepages.ucl.ac.uk/~zctly50/stuff/notes-S4HP.txt

http://www.nvnews.net/vbulletin/showthread.php?t=51566

http://www.nvnews.net/vbulletin/showthread.php?t=53225

http://www.club-vaio.com/clubvaio/mvnforum/viewthread?thread=22236

I believe the way is with something like ddccontrol, but no luck till now  :Neutral: 

----------

## blinksilver

I don't understand why, if this works on the new FS laptops, with the same videocard, Why would they go out of there way to reimplement it differently, I'm sure whatever controls the acpi probably is not a size or heat concern. 

It doesn't make sense, especially since the keys have the same setup, two S keys, and the same FN setup. it just boogles my mind.

Silly Sony, it would be nice if you could keep this tread posted with any info you find.

----------

## pijalu

For the poor sound, found a way on my FS series to get better results:

Add to /etc/modules.d/alsa

```

options snd-hda-intel position_fix=1

```

This fixed all my troubles...

(i am using latest ~x86 alsa-driver, not the one from kernel)

----------

## knefas

Thanks for the hint for sound, pijalu, I'll try ASAP.  :Wink: 

blinksilver: the patch for sony_acpi will not work on our S, since it uses a GHKE method that is not supported on S.

I have a modified (cut&past the url)sony_acpi.c (thanks to J. Jordens) that implements all the method supported by the S4. But it is useful only for cdpower, since the brightness is not working and the other methods (avaible if you modprobe sony_acpi debug=1) are unknow. 

I've seen that the two S buttons are catched by sonypi (but as "unknown") and by the kernel event interface, but I don't have any idea of how to use this...but it makes me hoping.

----------

## blinksilver

okay knefas, I am just really not happy about the whole thing, in anycase, if you need any help I will try my best.

Good luck and keep this posted with any info that comes up.

----------

## knefas

NOW IT WORKS.

Thanks again to J.Jordens, he found this tool http://www.acc.umu.se/~erikw/program/smartdimmer-0.1.tar.bz2. That's amazing, just try it, we now have 21 levels of brightness. Thanks.

I've also seen that S1 and S2 keys are catched by the kernel event interface and by sonypid, so there's probabily a way to use them.

 :Very Happy: 

----------

## pijalu

just for curiosity, can you send me your DSDT ?

```

gzip -c /proc/acpi/dsdt > /tmp/dsdt.gz

```

----------

## knefas

I have put my dsdt here (cut&paste the url if it doesn't work), so everyone can see it. It is slightly modified, because otherwise it wouldn't compile. If you're interested I can find the original version, but I've done really little modify  :Wink: 

(I'm goin on holyday, so see you in a couple of weeks. I hope to come back and discover someone has made fn keys working!)

----------

## mserms

I have just tried using smartdimmer with my S3XP (also a 6200 turbocache card), but am getting 

```
set_card() failed
```

 errors. Does anyone have any ideas about this?

----------

## blinksilver

oh mother of god you are my hero, I am dancing a little dance just for you right now. Okay that was just weird and I was just joking, I am going to grab the nearest linux distro to me and give it a shot.

----------

## blinksilver

oh and i was wondering can I get a list of what your kernel setting are??

----------

## blinksilver

its works fine, as long as i run it as root.

[soganess@localhost ~]$ smartdimmer -i

init_nvclock() failed!

what happens when I try to run it as a regular user

----------

## blinksilver

one more thing (sorry i ask alot of question  :Embarassed: ), any luck with S3 suspend ? I have tried everything i know, but the screen never comes back,

----------

## erikw

Regarding the issue of the Fn-keys and other Sony VAIO related events on newer models:

I wrote a patch for sonypi that will add support for the new models. I posted it on lkml earlier 

today, so you can either grab it from there (http://lkml.org/lkml/2005/7/31/240/index.html)

or from my page (http://www.acc.umu.se/~erikw/program/patch-2.6.12.3-sonypi_type3_models). 

Feedback on how it works on your model would be appreciated.

-- Erik Waling  <erikw@acc.umu.se>

----------

## knefas

erikw: thanks a lot, it works perfectly!  :Cool: 

I've written an ebuild to make all easier to install, if someone who understands c better than me wants to have a look at sonykeyd...that would be great.  :Smile: 

I've seen that there are still problems with the two S buttons, and with fn+

```
u i o p j m 3 4 5 7 8 9 0
```

 while 

```
1 2 e s d f b f1-f12
```

 do work.

I'm thinking about putting all this on the wiki, but I'll wait for some more feedback  :Smile: 

Pietro

----------

## notgmx

Well, figured I might as well get a a GentooForums account even though I don't use it. I write the notes-s4hp.txt by the way (see above for link).

As this forum seems to be the largest gathering of linux + sony s4 series people I was wondering whether anyone has made more progress than I've made with powermanagement on these laptops: In short, swsusp works well when on AC but fails when on Battery. swsusp2 works on Battery, too, but does not play together nicely with the nvidia modules. S3 sleep/resume only worked with the latest ACPI patch and kernel, and even that only to some degree: The screen didn't come back on.

Initially, I suspected that the BIOS changes the disk's powermanagement flags when on battery which in turn messes up the kernel on resume but as swsusp2 worked this seems less likely now. On that note, there is a BIOS update available (PHBSYS-00877815-UN.exe): Has anyone managed to flash this on without Windows? I couldn't extract the image with phnxdeco and do not have Windows installed. If you are using this update, has anything changed for the better/worse?

Also, emperorlinux claims they got hibernate working on it. I used their kernel, patches and .config but ran into the ususal problems described above.

Thanks for any input.

BTW knefas: Your problem with the  u i o p j keys etc can be fixed with evrouter and/or xmodmap remappings, but suit yourself  :Smile:  The only issue I still have with the keys related to the S1 and S2 keys. When pressed, two identical key events are generated instead of one unique, no big deal.

[edit]Oh, and I suppose no one has found patched firmware for the UJ-832D to make it rpc-1/regionfree? www.rpc1.org doesn't have it yet[/edit]

cheers

jjLast edited by notgmx on Mon Aug 22, 2005 1:20 pm; edited 1 time in total

----------

## knefas

I have updated the BIOS (via Windows). The changelog says

```
This BIOS Update fixes following issue :

- Update of the Graphical Card Intel to Fix the No image on LCD even if Backlight is ON

- System sometime hangs up after system booting or running 3D application
```

 but I've not seen any better for sleep. I'll continue to test...  :Smile: 

----------

## blinksilver

I don'r know if this will help at all but

Suspend to RAM does not work. I think I've tried all the possible ACPI, framebuffer, and console/X combinations. All of the ACPI kernel command line options seem to fail on wakeup: acpi_sleep=s3_mode, acpi_sleep=s3_bios, acpi_sleep=s3_mode,s3_bios. However, acpi_sleep=s3_mode suceeded in waking up properly except for the video. The screen remained dark but all other system functionality was present (tested via ssh). All the other combinations failed completely.

http://www.beyondabstraction.net/sonyfs660/

from this guys FS660, I can't SSH into my(currently not near another machine) S so I cant try it, it may work. Also, I don't know much about this stuff, but couldn't we use a script, (assuming the above works) that would call the command used to turn the screen off when inactive, and call the command that turns it back on when active, to see if it reinitializes the screen. 

Oh and if anyone is interesting I have adapted a patch I fouund, it now allows you to undervolt your PM (sanoma) CPU, its currently only setup for my 1.73GHz PM, but adding support for other sanoma(Dothan C0) CPUs is trival. Older Dothan B0 are  supported as well, the only catch is that you need to recompile your kernel for every change you make to your voltage table.

----------

## knefas

Thanks blinksilver, I've tried with acpi_sleep=s3_mode and 2.6.12-gentoo-r9, but it doesn't work. I'll try with other kernels later...

Would you mind to mail me the cpu patch? I'll test it and put online for everyone.  :Smile: 

BTW, how you get your current voltages? I didn't succed to make lm_sensors working...  :Smile: 

----------

## blinksilver

 *knefas wrote:*   

> Thanks blinksilver, I've tried with acpi_sleep=s3_mode and 2.6.12-gentoo-r9, but it doesn't work. I'll try with other kernels later...
> 
> Would you mind to mail me the cpu patch? I'll test it and put online for everyone. 
> 
> BTW, how you get your current voltages? I didn't succed to make lm_sensors working... 

 

Um sure, I am kinda busy now, just give me a day or two, to get it setup for all the CPUs.  Yeah, the way I know my voltage is kinda simple, when i run cpuspeed and my computer stops responding, i know the voltage is too low. ;D  The lm sensor app have not been implemented for whats inside the Sony S.  

When posting it t make sure the proper credits go(i don't want credit for stuff i did not do), it was orignally developed my some debian devel and just I modified it abit to modernize so it works with the sanoma cpu. he gets most the credit, it patches speedstep-centrino which currently only works for banias(that does mean that if you have a banias you can edit the tables and undervolt), it was submited upstream but never made it into the kernel, but hey as long as it gets out there.

----------

## knefas

I'm looking forward to it  :Smile:  BTW, on Win I can run 1600 with 12x1.000 volt. But I've not sperimented a lot, so I'll be glad to gather your experiecies.   :Wink:  Here's the gentoo 3d about undervolting

I've added to the Howto some lines about using xosd to display on the screen things like volume and brightness changes.

----------

## blinksilver

That Patch that you linked above is almost exaclty what I did, haha, it just prove that there are only a few ways to skin a cat. You will notice that in linux you don't get the same undervolt you do it windows, (probably means that my windows undervolt is unstable). for reference, 

in windows .716-1.068

in linux       .796-1.084

----------

## knefas

I though it would be a good idea to let everyone contribute to this howto, in order to collect and organize better all the stuff that is around, so I started a wiki page, I hope you'll enjoy it  :Smile: 

----------

## flocchini

your ebuild for sonykeyd mentioned in wiki page has been removed from altervista   :Confused: 

I found it trough google cache

```
# Copyright 1999-2005 Gentoo Foundation

# Distributed under the terms of the GNU General Public License v2

# $Header: $

inherit eutils

S=${WORKDIR}/${PN}

DESCRIPTION="A daemon to use fn key on Sony Vaio Laptops"

HOMEPAGE="http://juljas.net/linux/vaiofx240/sonykeyd.html"

SRC_URI="http://knefas.altervista.org/${P}.tar.gz"

LICENSE="GPL-2"

SLOT="0"

KEYWORDS="x86"

RDEPEND="media-video/smartdimmer"

src_unpack() {

unpack ${A} || die

}

src_compile() {

cd ${S} || die

emake || die

}

src_install() {

exeinto /usr/sbin

doexe sonykeyd

exeinto /usr/local/sbin

doexe scripts/sonykey.sh

exeinto /etc/init.d

doexe scripts/sonypi

dodoc doc/README

}

pkg_postinst() {

einfo "To enable fn-keys at boot run"

einfo "rc-update add sonypi default"

einfo "Please see http://forums.gentoo.org/viewtopic-t-2590043.html"

}
```

But the source is still missed. Can you link it here?    :Wink: 

----------

## knefas

Damn altervista, sometimes I forget to keep it alive...sorry about that.  :Smile: 

I've updated the wiki with the new ebuild and re-uploaded the source. It doesn't depend anymore on smartdimmer, since it's functionalities have been integrated into nvclock-0.8beta. I didn't find the time to write a sonykey.sh to use the new nvclock (I'm still using smartdimmer!), but that's the way to go.

----------

## flocchini

great  :Wink: 

but there are still some problems

```
voyager sonykeyd # emerge sonykeyd

Calculating dependencies ...done!

>>> emerge (1 of 1) app-laptop/sonykeyd-0.2.2 to /

>>> md5 files   ;-) sonykeyd-0.2.2.ebuild

>>> md5 files   ;-) files/digest-sonykeyd-0.2.2

>>> md5 src_uri ;-) sonykeyd-0.2.2.tar.gz

>>> Unpacking source...

>>> Unpacking sonykeyd-0.2.2.tar.gz to /var/tmp/portage/sonykeyd-0.2.2/work

>>> Source unpacked.

gcc -Wall -Wstrict-prototypes -O2 -pipe -I/usr/src/linux/include   -c -o sonykeyd.o sonykeyd.c

sonykeyd.c:49:18: xosd.h: No such file or directory

make: *** [sonykeyd.o] Error 1

!!! ERROR: app-laptop/sonykeyd-0.2.2 failed.

!!! Function src_compile, Line 22, Exitcode 2

!!! (no error message)

!!! If you need support, post the topmost build error, NOT this status message.
```

I installed xosd-2.2.14 and it works. This is the fixed ebuild:

```
# Copyright 1999-2005 Gentoo Foundation

# Distributed under the terms of the GNU General Public License v2

# $Header: $

inherit eutils

S=${WORKDIR}/${PN}

DESCRIPTION="A daemon to use fn key on Sony Vaio Laptops"

HOMEPAGE="http://juljas.net/linux/vaiofx240/sonykeyd.html"

SRC_URI="http://knefas.altervista.org/${P}.tar.gz"

LICENSE="GPL-2"

SLOT="0"

KEYWORDS="x86"

DEPEND=">=x11-libs/xosd-2.2.14"

src_unpack() {

unpack ${A} || die

}

src_compile() {

cd ${S} || die

emake || die

}

src_install() {

exeinto /usr/sbin

doexe sonykeyd

exeinto /usr/local/sbin

doexe scripts/sonykey.sh

exeinto /etc/init.d

doexe scripts/sonypi

dodoc doc/README

}

pkg_postinst() {

einfo "To enable fn-keys at boot run"

einfo "rc-update add sonypi default"

einfo "Please see http://forums.gentoo.org/viewtopic-t-2590043.html"

}
```

----------

## flocchini

 *knefas wrote:*   

> Damn altervista, sometimes I forget to keep it alive...sorry about that. 
> 
> I've updated the wiki with the new ebuild and re-uploaded the source. It doesn't depend anymore on smartdimmer, since it's functionalities have been integrated into nvclock-0.8beta. I didn't find the time to write a sonykey.sh to use the new nvclock (I'm still using smartdimmer!), but that's the way to go.

 

It doesn't work... I successfully installed sonykeyd with the provided ebuild, patched my gentoo-sources-2.6.12-gentoo-r10 and created the device node

```
echo -e "alias char-major-10-250 sonpi \noptions sonypi minor=250" > /etc/modules.d/sonypi 

mknod /dev/sonypi c 10 250

modules-update
```

.

I load sonypi module and start the daemon but nothing happen, fn keys are still unusable. No log in /var/log/sonypi. What's wrong?   :Wink: 

----------

## knefas

Try to emerge sonypid and see if it gets the key events... 

when you 

```
modprobe sonypi verbose=2
```

what does dmesg say?

----------

## flocchini

with sonykeyd and verbose module

fn+f2

```
Sony Vaio Jogdial input method installed.

Sony Vaio Keys input method installed.

sonypi: event port1=0x00,port2=0x05

sonypi: event port1=0x00,port2=0x05

sonypi: Sony Programmable I/O Controller Driverv1.26.

sonypi: detected type3 model, verbose = 2, fnkeyinit = off, camera = off, compat = off, mask = 0xffffffff, useinput = on, acpi = on

sonypi: enabled at irq=11, port1=0x1080, port2=0x1084

sonypi: unknown event port1=0x0e,port2=0x05

sonypi: event port1=0x12,port2=0x21

sonypi: event port1=0x1f,port2=0x21

sonypi: event port1=0x12,port2=0x21

sonypi: event port1=0x1f,port2=0x21
```

with verbose module launching sonypid:

```
voyager ~ # sonypid

sonypid: Sony Vaio SPIC daemon version 1.9, Oct 8, 2003

Event: Fn-F2 Pressed

Event: Event unknown!

Event: Fn-F3 Pressed

Event: Event unknown!

Event: Fn-F4 Pressed

Event: Event unknown!

Event: Fn-F5 Pressed

Event: Event unknown!

Event: Fn-F6 Pressed

Event: Event unknown!

```

 :Rolling Eyes: 

tnx for your help   :Wink: 

----------

## knefas

There's a little bug in sonykeyd, I'm really sorry about that, and thanks a lot to flocchini for telling me about it!  :Smile: 

I think I've corrected it (it was just a misplaced comment) in the source that now is at http://knefas.altervista.org/sonykeyd-0.2.2.tar.gz

I don't know why but it seems that altervista (or my tar.gz...) today doesn't work so well, I can't directly emerge it and I get a 

```
!!! Couldn't download sonykeyd-0.2.2.tar.gz. Aborting
```

 But the source is all right downloaded in /usr/portage/distfiles.   :Confused:   :Confused: 

EDIT: ah, the ebuild actually doesn't depend on xosd. You'll need it if you want to use some IMO cute thigs, but it's not compulsory  :Wink:  I removed the 

```
#include <xosd.h>
```

 that was there just for some experiments...sorry for uploading a so broken thing!  :Smile: 

----------

## flocchini

ooooook, now it works, many thanks!  :Wink: 

Still some problems with the init.d script, if sonykeyd is launced through it shut down after one command. Otherwhise no problem if launched standalone from the shell, I'm taking a look now  :Smile: 

----------

## flocchini

solved: the problem was apparently the "DAEMON" variable, hardcoding the command works perfectly for me  :Wink: 

First of all you must add sonypy module to /etc/modules.autoload.d/kernel-2.6 with the wiki-provided options in /etc/modules.d/sonypi

Now the init, maybe a good idea update the source archive  :Smile:  (after you successfully tested it, of course, don't trust me!   :Laughing: )

```
# Copyright 1999-2005 Gentoo Foundation

# Distributed under the terms of the GNU General Public License v2

# Please mail me for suggestion/support: knefas@gmail.com

# $Header: $

start() {

  ebegin "Starting Sony Input/Output event interface"

   start-stop-daemon --start --quiet --exec /usr/sbin/sonykeyd

  eend $?

}

stop() {

  ebegin "Stopping Sony Input/Output event interface"

  start-stop-daemon --stop --quiet --exec /usr/sbin/sonykeyd

  rmmod sonypi

  eend $?

}

reload() {

  ebegin "Restarting Sony Input/Output event interface"

  start-stop-daemon --stop --signal 1 --quiet --exec /usr/sbin/sonykeyd

  eend $?

}

```

----------

## M0

Hi all,

I am thinking about buying a vaio VGN-S5HP and since I was told that the S4 and S5 series are quite similar (despite of CPU, Harddisk and GPU) I'd like to hear about your experiences with the S4:

I am quite noise sensitive and I hate Notebooks that constantly have a fan running. The dealer told me that the fan would only run in rare cases when the system is claimed very much, but on the the one hand his experience is M$-Win based only and on the other hand I'd like to get some "independend" statements.

My "great dream" would be that the NB is quiet (fan off and no electronic chirping) in everyday work like textediting (email, programming, OpenOffice, ...) and surfing the web. Of course it's absolutely okay if the fan is running while doing CPU- and / or GPU-intensive work like compiling, encoding or running 3D acceleration. What are your experiences?

Thank's in advance!

Greetings

Moritz

PS: I hope this posting is not OT!?  :Rolling Eyes: 

----------

## knefas

The fan kicks on at 56 degrees on S4's, and yes, you will definitely reach them even undervolting. I haven't find a way to modify this behaviour.  :Smile: 

----------

## M0

 *knefas wrote:*   

> The fan kicks on at 56 degrees on S4's, and yes, you will definitely reach them even undervolting. I haven't find a way to modify this behaviour. 

 

Hmmm ... doesn't sound that good.  :Sad: 

Does that mean, the fan will run nearly all the time?  :Confused:  What is the temperature while the system is idle (up an runnig, but not touched)?

What about my example of text editing and surfing; do you think (or have you experienced) this will make the temperature go over the mentioned 56 degrees?

You mentioned undervolting, but what about the speedstep modes? The S5HP has 1,73GHz which I think is far more power than usually needed for surfing (and my often mentioned text editing  :Wink: ). Let's say I throttle it to ~1 GHz, shouldn't that keep the CPU cool enough?

----------

## knefas

See the wiki section about undervolting, and the 3d about it...it has useful info  :Smile:  You can run a 1.73Ghz CPU at 800 (non sure, but something like that). You can also say that you want it to run at 0.800 Volt instead that 1.xxx : it requires a bit of testing and it's not really straightforward, but it saves power and heat. 

My S4 runs 55-56 degrees idle, I'm quite happy about it, but yes, it runs at that temp.

----------

## M0

In a nutshell: The fan is wailing all the time ?!  :Crying or Very sad: 

----------

## knefas

 *M0 wrote:*   

> In a nutshell: The fan is wailing all the time ?! 

 

I can't really answer: No, it's not, but undervolting. And sometimes kicks on anyway. But it's possible that the S5 has a better cooling system, I have no idea.  :Smile: 

----------

## M0

 *knefas wrote:*   

> I have no idea. 

 

Anyway, thanks for your help!  :Very Happy: 

----------

## lacerto

I've an S3XP, and followed the WIKI howto for the S4, as they a pretty much the same machine I think. 

The problem I'm having is that when I compile ACPI Support-> Processor  into the kernel, the boot process hangs for about 3 mins when loading the disk drivers(sata etc). In then runs on quite smoothly, though still a little slow.

When I compile as a module, the boot process works fine, but I loose the ACPI funtionality. 

At I guess, I think the kernel might be throttling my CPU...if this is the case, is there some way of stopping it doing this, short of disabling ACPI?

I'm using kernel 2.6.13-r3. 

Anyone seen this before?

----------

## knefas

Are you sure it depends only to "CONFIG_ACPI_PROCESSOR" ? I'm using gentoo-sources with acpi processor enabled and I don't see this...sorry.  :Smile: 

----------

## lacerto

Hi thanks for the response.

Well yes and no I suppose - As I said, if I compile it as a modules, there's no problem. When in kernel, then it takes ages to boot. 

I suppose it could be a combination though - if I compile into kernel, then I need to change something else. Tricky to find though....

----------

## lacerto

I don'tr suppsoe someone could post up their .config? Would be a useful addition to the wiki

----------

## knefas

see on the external link of the wiki, http://www.homepages.ucl.ac.uk/~zctly50/stuff/ for example  :Smile: 

----------

## lacerto

Thanks - that has helped very much.

----------

## alemare

First off all hi! i'm a new buyer of a sony vaio and i have only one problem with fn key. The problem is simple fn doesn't work   :Very Happy:  !

when i press for example fn-f4 in log appear a 

```
atkbd.c: Unknow key pressed (translated set 2, code 0xf5 on isa0060/serio0).

atkbd.c: Use 'setkeycodes e075 <keycode>' to make it known.
```

I had just loaded module sonypi and at boot started sonykeyd and all apper to start well without error.

All because i want to reduce brightness of the monitor. I try to use smartdimmer manually but the screen flash a moment but nothing change. There is the same brightness in all the 21 level selectable.

Bye bye Alemare

----------

## knefas

 *alemare wrote:*   

> First off all hi! i'm a new buyer of a sony vaio and i have only one problem with fn key. The problem is simple fn doesn't work   !
> 
> 

 

Hi!  :Smile: 

If you just bought it it's probably a VGN-S5, and I've no idea if this stuff still works.  :Smile: 

The best way to see if sonipy is working is to:

1) compile a recent kernel, >= 2.6.14, with sonypi as module, reboot etc.

2) modprobe sonypi

3) emerge an run sonypid

4) press some key and see what happen (in sonypid). If nothing happens then there is a problem.  :Neutral: 

 *Quote:*   

> 
> 
> All because i want to reduce brightness of the monitor. I try to use smartdimmer manually but the screen flash a moment but nothing change. There is the same brightness in all the 21 level selectable.
> 
> 

 

emerge the lastest (beta) nvclock and run nvclock -S 30, or 40, or another percentage.

good luck!  :Smile: 

----------

## alemare

 *knefas wrote:*   

> 
> 
> Hi! 
> 
> If you just bought it it's probably a VGN-S5, and I've no idea if this stuff still works. 

 

I have a vgn-fs

 *knefas wrote:*   

> 
> 
> The best way to see if sonipy is working is to:
> 
> 1) compile a recent kernel, >= 2.6.14, with sonypi as module, reboot etc.
> ...

 

nothing append in sonypid but in log there is the same error that i had before

 *knefas wrote:*   

> 
> 
> emerge the lastest (beta) nvclock and run nvclock -S 30, or 40, or another percentage.
> 
> 

 

also this, i can run the command and it says to me that the brigthness is change but nothing really change. Under X i "find" a workaround for this, i emerge nvidia-settings and with this i can change brightness, contrast...

Thanks Alemare

----------

## knefas

 *alemare wrote:*   

> 
> 
> I have a vgn-fs

 

So you don't want to use the information in this thread, at least, the one youre looking for. I mean that as far as I know vgn-fs are different. Try to look to this other 3d instead.  :Smile: 

----------

## alemare

Iuhu! I resolve all, thank you! i followed the wrong tips!  :Rolling Eyes: 

I take the solution here is easier!

Bye bye and have a good time in London i've been there last month...

Alemare

----------

## blinksilver

hey, I was wondering how S3 sleep was going? I have been waiting on that for some time now.

----------

## knefas

I don't think any other progresses have been made on S3. If I know something else I will post on the wiki and in this thread....

The most active developent AFAIK is going on on the tifm xx20/xx21 memory stick drive  :Smile: 

----------

## rek2

ipw2200  ok I emerge this and I reboot and loads but then when I try to ./net.eth1 start it just hangs and crashes the network..

I had a problem with ubunto that if I enable de wireless X will start acting weird ...

now under gentoo I cant even run it.. did anyone had any issues with the wireless?

Thanks

----------

## knefas

Hi. Here wireless is fine...probably is a configuration issue, but I'm really very little expert about wi-fi.  :Sad: 

I use wpa_supplicant and ipw2200

----------

## rek2

this is on a sonic Vario. what is your laptop?

----------

## BlackEdder

I have a sony vaio s3, which is pretty much identical to the s4 series. First I wanted to thank you guys for the guide. It really helped (although I went the evrouter way for my fn keys).

Two questions:

1) has anyone got the externmal monitor/beamer working. According to the nvidia readme it should work, with the right xorg.conf and your hotkey, but I got the feeling that I first need to configure my hotkey to give the right "command". Anyone any ideas about that.

2) Anyone got suspend2 working yet. It works form the consol;e for me (even with nvidia module loaded), but from within the xserver it just stops at the end.

----------

## knefas

As far as I know

1) I got an external monitor working with TwinView, but I've never tryed to associate an hot-key or something to do the switch while X running.

2) People got the best results with 2.6.15. I managed only to suspend from console, and only to disk (not to RAM). The section on the wiki is quite up-to date, and people tend to update it with the lastest results (wow!). I hope something new will come with 2.6.16  :Smile: 

----------

## Kugar

I think there is a problem with the wiki and I hope there is a backup somewhere.

----------

## knefas

Thanks kugar, I don't know why but I didn't get the email notification in the wiki. The changes have been reverted, there is a whole backup in the "history" section, where you can see everychanges. Thanks a lot again!  :Smile: 

----------

## Kugar

Thank you for the backup and for your job with the wiki.

I suppose you have a VAIO s4, does the suspend to swap works for you with suspend2 ?

----------

## MacBouba

Hi,

I have a S5-HP and I would like to control the brightness of the LCD

I have compiles the kernel 2.6.15-r1 with sonypi as a module.

Then I modprobed it.

After I have emerged "sonypid" and run it:

 *Quote:*   

> 
> 
> macbouba@Vaio ~ $ sonypid 
> 
> sonypid: Sony Vaio SPIC daemon version 1.9, Oct 8, 2003
> ...

 

Then I emerged sonykeyd with your ebuild.

It seems that controlling he sound is good howerver, concerning the brightness, nothing works.

The "sonykeyd.sh" mentions something about a "smartdimmer" - I went on the link of your Howto but it seems that the prog is not there anymore.

Then I tried with "spicctrl"

The prog worked with every commands except the one concerning the setting of the brightness

Finally I emerged nvclock, and it seems that it doesn't work with my card:

 *Quote:*   

> 
> 
> macbouba@Vaio ~ $ nvclock -i
> 
> NVClock v0.7
> ...

 

Can someone help me to make my "Fn-keys" work?

Thanks  :Smile: 

----------

## knefas

Hi, emerge nvclock (the lastest version, you may have to unmask it) and run

```
nvclock -S 20
```

where 20 is a percentage.

smartdimmer has been included in nvclock. I wrote a new script for the fn-keys, when I have time to check it I'll update the wiki.  :Smile: 

I hope nvclock works for you  :Smile: 

----------

## nathanjb

Since we have had the 2.6.16 kernel for a while, are there any updates to the wiki that anyone can contribute? I hope our laptops have not fallen off the radar. Thanks.

----------

## BlackEdder

I've been trying to use the newest suspend2 sources (2.6.16-r4) without success. The laptop won't boot at all with coldplug enabled (stops just before getting to login) and it seems ipw2200 doesn't work anymore. Anyone else seeing these problems?

----------

## 115552

 *nathanjb wrote:*   

> Since we have had the 2.6.16 kernel for a while, are there any updates to the wiki that anyone can contribute? I hope our laptops have not fallen off the radar. Thanks.

 

Hi,

I've done some rewriting in parts of the wiki and gone through it fixing a few things here and there.

On my S460, i upped the RAM to 2Gb, and noticed that the vanilla kernel wont work well with over ~800Mb RAM. You'll need the ck-sources kernel.

As for the version, i've been always upgrading and testing the same day they're out. I'm currently and very stably on 2.6.16.17. 

```
# uname -a

Linux localhost 2.6.16-ck11 #1 Tue May 23 12:40:09 BST 2006 i686 Intel(R) Pentium(R) M processor 1.73GHz GNU/Linux
```

If you want, i can paste a copy of my .config for you all so that you can test it out. It has a few modifications here and there from me that i found useful. But nothing serious or potentially damaging (i care for my lappy too )  :Wink: 

----------

## BlackEdder

 *BlackEdder wrote:*   

> I've been trying to use the newest suspend2 sources (2.6.16-r4) without success. The laptop won't boot at all with coldplug enabled (stops just before getting to login) and it seems ipw2200 doesn't work anymore. Anyone else seeing these problems?

 Never mind, my selective updating policy bit me in the ass, my udev version was to far out of date. And module-rebuild apparently doesn't check dependencies -> newest version of ipw2200-firmware wans't installed, so ipw2200 refused to work.

----------

## kadrim

greets,

could someone post the actual ebuild and source for sonykeyd?

the altervista link is again broken   :Sad: 

----------

## 115552

 *kadrim wrote:*   

> greets,
> 
> could someone post the actual ebuild and source for sonykeyd?
> 
> the altervista link is again broken  

 

Try this ebuild. It works for me including the url.

 Downloading 'http://knefas.altervista.org/sonykeyd-0.2.2.tar.gz'

--21:50:25--  http://knefas.altervista.org/sonykeyd-0.2.2.tar.gz

xushitop sonykeyd # cat sonykeyd-0.2.2.ebuild

```

# Copyright 1999-2005 Gentoo Foundation

# Distributed under the terms of the GNU General Public License v2

# $Header: $

inherit eutils

S=${WORKDIR}/${PN}

DESCRIPTION="A daemon to use fn key on Sony Vaio Laptops"

HOMEPAGE="http://juljas.net/linux/vaiofx240/sonykeyd.html"

SRC_URI="http://knefas.altervista.org/${P}.tar.gz"

LICENSE="GPL-2"

SLOT="0"

KEYWORDS="x86"

src_unpack() {

        unpack ${A} || die

}

src_compile() {

        cd ${S} || die

        emake || die

}

src_install() {

        exeinto /usr/sbin

        doexe sonykeyd

        exeinto /usr/local/sbin

        doexe scripts/sonykey.sh

        exeinto /etc/init.d

        doexe scripts/sonypi

        dodoc doc/README

}

pkg_postinst() {

        einfo "To enable fn-keys at boot run"

        einfo "rc-update add sonypi default"

        einfo "Please see http://forums.gentoo.org/viewtopic-t-361872.html"

}
```

Last edited by 115552 on Tue Nov 07, 2006 8:24 am; edited 1 time in total

----------

## kadrim

thanks, that was an ultra fast reply  :Wink: 

and yes it seems to download the source correctly.. strange, with firefox i couldn't download the tar.gz file.. well whatever it's running now *hehe*

----------

## 115552

 *kadrim wrote:*   

> thanks, that was an ultra fast reply 
> 
> and yes it seems to download the source correctly.. strange, with firefox i couldn't download the tar.gz file.. well whatever it's running now *hehe*

 

Oops, forgot the trailing [ /code ]  :Smile: 

I've got this topic watched.. I like to monitor contributions to the laptop  :Smile: 

Strange thing is, i tried that link in konq, and it only displayed a weird advertising website. The link worked in FF though, and the ebuild downloaded.

Anyway, it works, good luck and keep us informed

----------

## BlackEdder

Has anyone got suspend fully working?? I'm using the suspend2 sources and suspend to harddisk is working perfectly, but suspend to ram seems to be working only to wake up immediately. I also tried the uswsusp method, but that only worked when not in X-windows (and only suspend to ram worked).

```
cat /etc/hibernate/common.conf | grep -v '^$'  | grep -v \#

Verbosity 0

LogFile /var/log/hibernate.log

LogVerbosity 1

Distribution gentoo

SaveClock restore-only

UnloadBlacklistedModules yes

LoadModules auto

GentooModulesAutoload yes

RestartServices local net.eth1 

StartServices ntp-client

EnableVbetool yes

VbetoolPost yes

SwitchToTextMode yes

UseDummyXServer yes

XStatus gnome

cat /etc/hibernate/hibernate.conf | grep -v '^$'  | grep -v \#

TryMethod suspend2.conf

TryMethod ususpend.conf

TryMethod disk.conf

TryMethod ram.conf

cat /etc/hibernate/suspend2.conf | grep -v '^$'  | grep -v \#

UseSuspend2 yes

Reboot no

EnableEscape yes

DefaultConsoleLevel 1

Compressor lzf

Encryptor none

ProcSetting userui_program /sbin/suspend2ui_text

FullSpeedCPU yes

Include common.conf

cat /etc/hibernate/ram.conf | grep -v '^$'  | grep -v \#

UseSysfsPowerState mem

EnableVbetool yes

VbetoolPost yes
```

----------

## dsamersoff

Does anybody know where I can get sonykeyd sources? It seems to be unavailable anymore.

PS: Someone above has trouble with nvclock ....

0.7 doesn't recognize the card - use 0.8b from  http://www.linuxhardware.org/nvclock/

----------

## dsamersoff

 *dsamersoff wrote:*   

> Does anybody know where I can get sonykeyd sources? It seems to be unavailable anymore.

 

Not found.  I wrote my own one. I hope the code is accurate enough to be used as a base for further enhancement. 

(adding xosd support, build-in nvclock brightness etc)

Available here (sonypi User Land) :  http://devnull.samersoff.net/pub/soft/sonypiUL-1.02.tar.gz

BSD licensed, but let me know if you find it usable.

PS:

      Does anybody know why s1 and s2 button return the same event, but power button doesn't return event at al.

      sonypi driver bug???

----------

## Kugar

Does someone use compiz-fusion without XGL but xorg with nvidia GL effects configuration on a vaio S4 ? I used tu use beryl with xgl but now, the memory bug is fixed in nvidia drivers and as I had to reinstall my gentoo. So I put compiz-fusion instead of beryl and configure my xorg to use nvidia gl effects (not AIGL) an not xgl and I have big memory problems.

It seems that compiz always use more and more memory and never liberate anything. I never had such problems with xgl and beryl and I want to know if the problem comes from my laptop/configuration or if someone else ever had a problem like that.

----------

