Sony Vaio VGN-FJ170, Mint 15, Fn keys dont work

Questions about hardware,drivers and peripherals
Forum rules
Before you post please read this

Sony Vaio VGN-FJ170, Mint 15, Fn keys dont work

Postby alne on Thu Nov 28, 2013 1:28 pm

Hi everybody,
I installed Mint 15 (Cinnamon) and later Ubuntu 12.04 LTS on my old sony laptop Vaio VGN-FJ170. My problem is that in both OS laptop can't detect the press of Fn key combinations. I investigated a bit and found that at least some functionality of sony-laptop module in kernel works - display brightness could be changed through Ubuntu settings (and it works through changing setting file in /sys/devices/platform/sony-laptop see below).

I tried to see if os could detect Fn+F2 and other things by using acpi_listen or through xev. Nothing comes through...

However, After pressing FN+Fkey combination file /sys/devices/platform/sony-laptop/fnkey changes with specific codes:
Fn+F2 - (audio mute) - fnkey file content changes to 1;
Fn+F3 - (Vol down) - fnkey file content changes to 2;
Fn+F4 - (Vol Up) - fnkey file content changes to 4;
Fn+F5 - (Brightness down) - fnkey file content changes to 8;
Fn+F6 - (Brightness up) - fnkey file content changes to 16;
Fn+F7 - (Video output change) - fnkey file content changes to 32;
Fn+F10 - (Zoom) - fnkey file content changes to 1024;
Fn+F12 - (Sleep) - fnkey file content changes to 64;
No other key combination changes value of /sys/devices/platform/sony-laptop/fnkey

I guess it is possible to write a daemon which will watch content of this file and translate it to something which could be detected by window manager and used to trigger keyboard shortcuts... But this is well beyond my capabilities... Could someone please help?

Changing display brightness works as well, but I don't know how to actually tie it to daemon or somehow make it accessible through GUI...Here is the details:
File /sys/class/backlight/sony/brightness controls actual brightness of the screen (values are integers from 0[lowest] to 7[highest]).

Command
Code: Select all
sudo sh -c 'echo "0" > /sys/class/backlight/sony/brightness'
will change it to the lowest setting for example.

I dont know system command to change volume of the sound or mute.

Please help me to utilize this in GUI.
Thank you in advance!
alne
Level 1
Level 1
 
Posts: 7
Joined: Thu Nov 28, 2013 1:14 pm

Linux Mint is funded by ads and donations.
 

Re: Sony Vaio VGN-FJ170, Mint 15, Fn keys dont work

Postby roblm on Wed Dec 04, 2013 1:24 pm

Did you try adding a kernel parameter to the GRUB boot file? You can temporarily add these commands for testing. The effect will
only last for one session and will no longer be in effect after restarting your system.

At the GRUB boot menu select the correct line but don't press Enter. Press the “e” key to edit.
If no menu is displayed then restart and hold down the Shift key.
Go down to the line that starts with:
linux /boot/vmlinuz..........ro quiet splash $vt_handoff

Add the parameter: acpi_osi=Linux
between the word “splash” and “$vt_handoff”. The end of the line will look like this:
…..ro quiet splash acpi_osi=Linux $vt_handoff

Press Ctrl+X at the same time to start your system. Test the Fn+key combinations. If necessary, repeat the process with
these parameters:

acpi_backlight=vendor
acpi_osi=Linux acpi_backlight=vendor
acpi_osi='!Windows 2012'
acpi_osi=

If your problem gets solved then make the change persistent. Open the GRUB boot file with this command in the Terminal:
gksudo gedit /etc/default/grub

Change the line: GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
to the line below which has the parameter that worked.

GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash acpi_osi=Linux”
GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash acpi_backlight=vendor"
GRUB_CMDLINE_LINUX_DEFAULT="quite splash acpi_osi=Linux acpi_backlight=vendor"
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_osi='!Windows 2012'"
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_osi=”

Save the file and then run this command in the Terminal: sudo update-grub
Last edited by roblm on Wed Dec 04, 2013 8:05 pm, edited 1 time in total.
User avatar
roblm
Level 4
Level 4
 
Posts: 436
Joined: Sun Feb 24, 2013 2:41 pm

Re: Sony Vaio VGN-FJ170, Mint 15, Fn keys dont work

Postby alne on Wed Dec 04, 2013 2:35 pm

Hi roblm,
Thank you for your response, I will try it tonight. I'm total newb, but i think your suggestion relates to use of nvidia video driver, correct? Unfortunately my laptop is very old and it only have intel i915 video chip. Could you please confirm or give a bit of explanation. I'm trying to learn things about linux...
Thank you in advance,
Alex
alne
Level 1
Level 1
 
Posts: 7
Joined: Thu Nov 28, 2013 1:14 pm

Re: Sony Vaio VGN-FJ170, Mint 15, Fn keys dont work

Postby roblm on Wed Dec 04, 2013 2:51 pm

alne,
The instructions don't apply to any particular video driver.
User avatar
roblm
Level 4
Level 4
 
Posts: 436
Joined: Sun Feb 24, 2013 2:41 pm

Re: Sony Vaio VGN-FJ170, Mint 15, Fn keys dont work

Postby alne on Wed Dec 04, 2013 11:53 pm

I tried modifying GRUB parameters as per your suggestion, but nothing works...
I find out another interesting bit of information -
my Fn key is able to modify behavior of the arrow keys:
Fn + Arrow UP = 0x49 scancode, 103 keycode, xev 112 (Prior);
Fn + Arrow Down = 0x51 scancode, 109 keycode, xev 117 (Next);
Fn + Arrow Left = 0x47 scancode, 102 keycode, xev 110 (Home);
Fn + Arrow Right = 0x4f scancode, 107 keycode, xev 115 (End);

Pressing Fn key alone doesnt spit any scan or keycode, nothing shows up in xev either.
alne
Level 1
Level 1
 
Posts: 7
Joined: Thu Nov 28, 2013 1:14 pm

Re: Sony Vaio VGN-FJ170, Mint 15, Fn keys dont work

Postby haydennathan on Thu Dec 05, 2013 1:10 am

That's good i appreciate your information.
haydennathan
Level 1
Level 1
 
Posts: 1
Joined: Thu Dec 05, 2013 1:06 am

Re: Sony Vaio VGN-FJ170, Mint 15, Fn keys dont work

Postby roblm on Thu Dec 05, 2013 8:58 am

Could you try the following procedure to see if any scancodes are generated.

Press Ctrl+Alt+F1 to enter the virtual console tty1 and type: /lib/udev/findkeyboards
Get the input/event number of the AT keyboard.

Then type: sudo /lib/udev/keymap -i input/eventX
where X is the number you found in the previous step.

Press all the Fn+key combinations starting with Fn+F1 all the way through Fn+F12.
Press the Escape key.
You can't use the print screen function here, so use the command:
sudo screendump 1 > screenoutput.txt

Press Ctrl+Alt+F8 to exit the tty1 console. If this fails then try Ctrl+Alt+F7.
The file "screenoutput.txt" will be found in your "/home/user-name" directory. Post the result.

Also type these commands in the Terminal and post the output:
cat /sys/class/dmi/id/sys_vendor
cat /sys/class/dmi/id/product_name
Last edited by roblm on Thu Dec 05, 2013 9:26 pm, edited 1 time in total.
User avatar
roblm
Level 4
Level 4
 
Posts: 436
Joined: Sun Feb 24, 2013 2:41 pm

Re: Sony Vaio VGN-FJ170, Mint 15, Fn keys dont work

Postby alne on Thu Dec 05, 2013 9:27 am

here is the output of the screen in tty:
Code: Select all
alex@Vaio:~$ /lib/udev/findkeyboards
USB keyboard: input/event4
AT keyboard: input/event3
module: input/event7
alex@Vaio:~$ sudo screendump 1 > keyboards.txt
[sudo] password for alex:
alex@Vaio:~$ sudo /lib/udev/keymap -i input/event3
Press ESC to finish, or Control-C if this device is not your primary keyboard
scan code: 0x3B   key code: f1
got scan code event 0xF5 without a key code event
got scan code event 0xF5 without a key code event
got scan code event 0xF5 without a key code event
got scan code event 0xF5 without a key code event
got scan code event 0xF5 without a key code event
got scan code event 0xF5 without a key code event
got scan code event 0xF5 without a key code event
got scan code event 0xF5 without a key code event
got scan code event 0xF5 without a key code event
got scan code event 0xF5 without a key code event
got scan code event 0xF5 without a key code event
got scan code event 0xF5 without a key code event
got scan code event 0xF5 without a key code event
got scan code event 0xF5 without a key code event
got scan code event 0xF5 without a key code event
got scan code event 0xF5 without a key code event
got scan code event 0xF5 without a key code event
got scan code event 0xF5 without a key code event
got scan code event 0xF5 without a key code event
got scan code event 0xF5 without a key code event
got scan code event 0xF5 without a key code event
got scan code event 0xF5 without a key code event
scan code: 0x01   key code: esc
alex@Vaio:~$ sudo /lib/udev/keymap -i input/event4
Press ESC to finish, or Control-C if this device is not your primary keyboard
^[[[A^[^Calex@Vaio:~$
Display all 2380 possibilities? (y or n)
alex@Vaio:~$ sudo /lib/udev/keymap -i input/event7
Press ESC to finish, or Control-C if this device is not your primary keyboard
^[[[A^[^[^[^[^[^[^[^[^[^[^[^[^[^[^Calex@Vaio:~$
alex@Vaio:~$ sudo screendump 1 > screenoutput.txt

I tried to check all 3 keyboards (USB, AT and module). In AT keyboard I'm getting "got scan code event 0xF5 without a key code event" for all Fn + F key combnations. USB and module keyboards dont do anything when I press Fn+F key combo.

Here is the output for last commands you requested:
Code: Select all
alex@Vaio:~$ cat /sys/class/dmi/id/sys_vendor
Sony Corporation
alex@Vaio:~$ cat /sys/class/dmi/id/product_name
VGN-FJ170

If it will bew helpful I can post DSDT list.
Thank you!
alne
Level 1
Level 1
 
Posts: 7
Joined: Thu Nov 28, 2013 1:14 pm

Re: Sony Vaio VGN-FJ170, Mint 15, Fn keys dont work

Postby alne on Thu Dec 05, 2013 8:49 pm

Here is some information about my laptop:
Code: Select all
alex@Vaio:~$ lspci
00:00.0 Host bridge: Intel Corporation Mobile 915GM/PM/GMS/910GML Express Processor to DRAM Controller (rev 03)
00:02.0 VGA compatible controller: Intel Corporation Mobile 915GM/GMS/910GML Express Graphics Controller (rev 03)
00:02.1 Display controller: Intel Corporation Mobile 915GM/GMS/910GML Express Graphics Controller (rev 03)
00:1b.0 Audio device: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) High Definition Audio Controller (rev 03)
00:1d.0 USB controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB UHCI #1 (rev 03)
00:1d.1 USB controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB UHCI #2 (rev 03)
00:1d.2 USB controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB UHCI #3 (rev 03)
00:1d.3 USB controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB UHCI #4 (rev 03)
00:1d.7 USB controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) USB2 EHCI Controller (rev 03)
00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev d3)
00:1f.0 ISA bridge: Intel Corporation 82801FBM (ICH6M) LPC Interface Bridge (rev 03)
00:1f.2 IDE interface: Intel Corporation 82801FBM (ICH6M) SATA Controller (rev 03)
00:1f.3 SMBus: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) SMBus Controller (rev 03)
06:08.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ (rev 10)
06:09.0 CardBus bridge: Texas Instruments PCI7420 CardBus Controller
06:09.2 FireWire (IEEE 1394): Texas Instruments PCI7x20 1394a-2000 OHCI Two-Port PHY/Link-Layer Controller
06:09.3 Mass storage controller: Texas Instruments PCI7420/7620 SD/MS-Pro Controller
06:0a.0 Network controller: Intel Corporation PRO/Wireless 2200BG [Calexico2] Network Connection (rev 05)


Attached is disassembled DSDT file.

Here is a link to sony-laptop module wikihttp://www.linux.it/~malattia/wiki/index.php/Sony-laptop
Attachments
DSDT.zip
DSDT disasembly
(13.3 KiB) Downloaded 20 times
alne
Level 1
Level 1
 
Posts: 7
Joined: Thu Nov 28, 2013 1:14 pm

Re: Sony Vaio VGN-FJ170, Mint 15, Fn keys dont work

Postby roblm on Thu Dec 05, 2013 10:24 pm

Without scancodes we can't proceed any further because the kernel is not recognizing the Fn+key combination press events.

If I'm correctly understanding the information you gave, did you install the driver (Sony-laptop module) mentioned in your link?
Looking at these lines from the “Xorg.0.log” file in that link:

Code: Select all
Sony Vaio Keys: Device: "/dev/input/event4"
(II) XINPUT: Adding extended input device "Sony Vaio Keys" (type: KEYBOARD)

shows the Sony device recognized as a keyboard and it's input/event number.

Then a similar command that you used in tty1 is used below:

Code: Select all
sudo /lib/udev/keymap -i /dev/input/event4
Press ESC to finish
...
scan code: 0x10   key code: brightnessdown

The last line with the scan code / key code combination is exactly what I was looking for.

If you installed that driver and it was working correctly, then “Sony Vaio Keys” or something referring to it should have been displayed
after using the command: /lib/udev/findkeyboards
User avatar
roblm
Level 4
Level 4
 
Posts: 436
Joined: Sun Feb 24, 2013 2:41 pm

Re: Sony Vaio VGN-FJ170, Mint 15, Fn keys dont work

Postby alne on Thu Dec 05, 2013 11:45 pm

Hi roblm,
sony-laptop module v.0.6 is included in kernel by default.
I tried to see the event for sony function keys, but nothing gets detected:
Code: Select all
alex@Vaio:/$ sudo evtest
No device specified, trying to scan all of /dev/input/event*
Available devices:
/dev/input/event0:   Lid Switch
/dev/input/event1:   Power Button
/dev/input/event10:   AlpsPS/2 ALPS GlidePoint
/dev/input/event11:   HDA Intel Mic
/dev/input/event2:   Power Button
/dev/input/event3:   AT Translated Set 2 keyboard
/dev/input/event6:   Video Bus
/dev/input/event7:   Sony Vaio Keys
/dev/input/event8:   Sony Vaio Jogdial
/dev/input/event9:   PS/2 Mouse
Select the device event number [0-9]: 7
Input driver version is 1.0.1
Input device ID: bus 0x10 vendor 0x104d product 0x0 version 0x0
Input device name: "Sony Vaio Keys"
Supported events:
  Event type 0 (EV_SYN)
  Event type 1 (EV_KEY)
    Event code 113 (KEY_MUTE)
    Event code 114 (KEY_VOLUMEDOWN)
    Event code 115 (KEY_VOLUMEUP)
    Event code 138 (KEY_HELP)
    Event code 148 (KEY_PROG1)
    Event code 149 (KEY_PROG2)
    Event code 158 (KEY_BACK)
    Event code 161 (KEY_EJECTCD)
    Event code 183 (KEY_F13)
    Event code 184 (KEY_F14)
    Event code 185 (KEY_F15)
    Event code 202 (KEY_PROG3)
    Event code 203 (KEY_PROG4)
    Event code 205 (KEY_SUSPEND)
    Event code 212 (KEY_CAMERA)
    Event code 224 (KEY_BRIGHTNESSDOWN)
    Event code 225 (KEY_BRIGHTNESSUP)
    Event code 226 (KEY_MEDIA)
    Event code 227 (KEY_SWITCHVIDEOMODE)
    Event code 237 (KEY_BLUETOOTH)
    Event code 238 (KEY_WLAN)
    Event code 289 (BTN_THUMB)
    Event code 360 (KEY_VENDOR)
    Event code 372 (KEY_ZOOM)
    Event code 418 (KEY_ZOOMIN)
    Event code 419 (KEY_ZOOMOUT)
    Event code 464 (KEY_FN)
    Event code 465 (KEY_FN_ESC)
    Event code 466 (KEY_FN_F1)
    Event code 467 (KEY_FN_F2)
    Event code 473 (KEY_FN_F8)
    Event code 474 (KEY_FN_F9)
    Event code 476 (KEY_FN_F11)
    Event code 480 (KEY_FN_D)
    Event code 481 (KEY_FN_E)
    Event code 482 (KEY_FN_F)
    Event code 483 (KEY_FN_S)
    Event code 484 (KEY_FN_B)
  Event type 4 (EV_MSC)
    Event code 4 (MSC_SCAN)


Running
Code: Select all
sudo /lib/udev/keymap -i /dev/input/event7
doesnt show anything when I press fn key combinations unfortunately...
alne
Level 1
Level 1
 
Posts: 7
Joined: Thu Nov 28, 2013 1:14 pm

Re: Sony Vaio VGN-FJ170, Mint 15, Fn keys dont work

Postby roblm on Fri Dec 06, 2013 8:51 pm

I know that the sony-laptop module is already in the kernel because I saw it in this location:
/lib/modules/3.5.0-17-generic/kernel/drivers/platform/x86
but that module discussed in the link you gave appears to be a patch built by someone named Malattia, to correct the problem
of not being able to use the special function keys. That's what I was referring to when I asked if you installed it.

Let's see what the showkey utility outputs. Enter the tty1 virtual console and type: showkey -s

For now just test the 4 different Fn+key combinations that control brightness and volume. Press Fn+F3, Fn+F4, Fn+F5 and Fn+F6

Wait 10 seconds for the program to end.
Get a screenshot with the command: sudo screendump 1 > screenoutput.txt
User avatar
roblm
Level 4
Level 4
 
Posts: 436
Joined: Sun Feb 24, 2013 2:41 pm

Re: Sony Vaio VGN-FJ170, Mint 15, Fn keys dont work

Postby alne on Fri Dec 06, 2013 10:27 pm

Hi,
Unfortunately nothing is showing up on the screen...
Alex
alne
Level 1
Level 1
 
Posts: 7
Joined: Thu Nov 28, 2013 1:14 pm

Re: Sony Vaio VGN-FJ170, Mint 15, Fn keys dont work

Postby roblm on Sat Dec 07, 2013 5:50 pm

Would you press Fn+F3 through Fn+F6. Then open the “/var/log/dmesg” file with this command:
gedit /var/log/dmesg
Copy the contents. This is a very large file so in the Mint forum reply window select “Code” and paste the contents between the
two code words. Do the same for the “/var/log/Xorg.0.log” file.
User avatar
roblm
Level 4
Level 4
 
Posts: 436
Joined: Sun Feb 24, 2013 2:41 pm

Re: Sony Vaio VGN-FJ170, Mint 15, Fn keys dont work

Postby roblm on Wed Dec 11, 2013 1:54 pm

Here's another method you can try, which is in the link you gave, in the last section, which says:
Fn keys in X - the old way
The material in that link was last updated in 2011 but some goes back to 2007, so it may not work today. I'm puzzled by the
lines "XkbLayout" "jp" and "XkbModel" "jp106" because they refer to a Japanese keyboard.

If you want to try this then you would have to create an “xorg.conf” file first. Enter tty1 again.
Then type: sudo service mdm stop
Then type: sudo Xorg -configure
Ignore any error messages.
Then type: sudo service mdm start

The created file will be in your “/home/user-name” directory (for Mint 15). Copy it to /etc/X11 with this command:
sudo cp /home/user-name/xorg.conf.new /etc/X11/xorg.conf
substituting "user-name" with your real user name. Open the file with this command: gksudo gedit /etc/X11/xorg.conf
Copy these lines:

Code: Select all
Section "InputDevice"
        Identifier  "Vaio keys"
        Driver      "evdev"
        Option      "Name" "Sony Vaio Keys"
        Option      "XkbLayout" "jp"
        Option      "XkbModel" "jp106"
EndSection

Paste them after this section:

Code: Select all
Section "Module"
   Load  "glx"
EndSection

Then copy this line: InputDevice "Vaio keys" "SendCoreEvents"
and paste it in the section at the top named: Section "ServerLayout"
so it will look like this:

Code: Select all
Section "ServerLayout"
   Identifier     "X.org Configured"
   Screen      0  "Screen0" 0 0
   Screen      1  "Screen1" RightOf "Screen0"
   InputDevice    "Mouse0" "CorePointer"
   InputDevice    "Keyboard0" "CoreKeyboard"
   InputDevice    "Vaio keys" "SendCoreEvents"
EndSection

Section "Module"
   Load  "glx"
EndSection

Section "InputDevice"
        Identifier  "Vaio keys"
        Driver      "evdev"
        Option      "Name" "Sony Vaio Keys"
        Option      "XkbLayout" "jp"
        Option      "XkbModel" "jp106"
EndSection

Save the file, reboot and test the function keys.

If there is a problem and you can't get to the desktop, then reboot and select “Recovery Mode” at the GRUB boot menu. If
there is no menu, then reboot and hold down the shift key. In the menu select the line starting with "Root". When asked for
the root password just type your user password. First change the file permissions to read and write with this command:
mount --options remount,rw /
Then remove the "xorg.conf" file with this command: rm /etc/X11/xorg.conf
Press Ctrl+D to get back to the menu and select “Resume”.

Sometimes after rebooting you end up at the tty1 screen. Type this command to remove the “xorg.conf” file:
sudo rm /etc/X11/xorg.conf
Then type: startx

If this method doesn't work then, without removing the "xorg.conf" file, try again to get scancodes using the instructions in a
previous post.
User avatar
roblm
Level 4
Level 4
 
Posts: 436
Joined: Sun Feb 24, 2013 2:41 pm

Linux Mint is funded by ads and donations.
 

Return to Hardware Support

Who is online

Users browsing this forum: Google [Bot] and 17 guests