Insecrure Screensavers with Xorg 1.11+
New Open Source Poulsbo Driver in 2.6.39 staging
Understanding the Necessity of Wayland
In 1984 the MIT started X11.
In 1991, XFree86 started out of the X386 server based on the X11 platform.
In 2003, Xorg took over from XFree86 after a license dispute.
In 2008, Wayland was started to overhaul the entire system and keep only what's necessary for the desktop today, using only today's modern infrastructure in a leightweight architecture.
Quick Fix for Your Multimedia Keys
atkbd.c: Unknown key pressed (translated set 2, code 0xf7 on isa0060/serio0).then you need to look up the right number in include/linux/input.h e.g.here. E.g.
atkbd.c: Use 'setkeycodes e077' to make it known.
#define KEY_BRIGHTNESSDOWN 224And use that number with setkeycodes, e.g. for my system:
#define KEY_BRIGHTNESSUP 225
setkeycodes e077 224 # brightness downAnd now your system (e.g. KDE or Gnome) should immediately recognize the keys. Post the information to your distribution and it should be included in future releases. Just write the commands (without sudo) into /etc/rc.local to make them permanent for now.
setkeycodes e078 225 # brightness up
setkeycodes 0xee 212 # webcam
setkeycodes 0xe4 240 # touchpad -> unknown
setkeycodes e076 238 # wifi + bluetooth
If you get stuck, here's a good guide.
Moblin 2.1 IVI FC Release tested on the MSI Wind U110 (GMA 500/Poulsbo)
Well, it's not a lot:
- The resolution was set to 800x600. No other resolutions were detected (xrandr -q)
- The colors were distorted. It looked like 256 colors but randomly exchanged.
- The touchpad was not working. The mouse moved in seemingly opposite or random directions and kept skipping back and forth. I had to use an external mouse to do anything at all.
- The sound wasn't working, thought that might possibly be fixed by disabling power saving, just like in Ubuntu
- Wifi wasn't working. I could not add networks or configure the wifi. " Join other Network" was greyed out. The iwconfig tools have to be started manually from /sbin. They found a network, but I didn't bother to try to set it up with wpa_supplicant manually. A path is not set. wpa_supplicant was already running with 99% cpu usage when I boot.
- Switching to the console and back is impossible. It completely and irreversibly crashes the graphics until a reboot.
- ACPI showed tons of errors in dmesg.
- Trying to suspend crashed the system.
- I wonder if there's an application in the distribution that can take advantage of VAAPI accelerated video decoding. There is a video player. But I had no easy access to the hard drive's partitions (ntfs).
utterly unusable.
The psb driver set up according to my howto works flawlessly compared to that! It interesting how difficult it seems to be for Intel to get its own chipset to work in its own distribution with its own driver.
But, yes. Moblin was very snappy. ;-) (I think that just shows just how cool XFCE is, though.)
How to set up X and VAAPI Accelerated HD Video on the MSI Wind U110 (GMA500 - Poulsbo) and Ubuntu Karmic 9.10
I've finally managed to get it running. Here is what I did. First you need to get Ubuntu 9.10 running with poulsbo. The first steps 1.-4. describe how to set up the driver for X. The second part (5.-10.) describes how to set up VAAPI and mplayer to get video acceleration. (There is already an early stage GMA500 driver for Ubuntu 10.04.)
The image shows the phoronix test suite benchmarking when I play Grey.ts in a loop (-loop 0) with mplayer and vaapi but without sound (-nosound) on my netbook. During the entire time, the CPU frequency is also downscaled to 800 Mhz. Compare to phoronix vdpau benchmark on a core 2 duo system (which obviously shows even less cpu usage, because the CPU is much more powerful) or the Atom and Nvidia ION benchmark on Phoronix.
sudo add-apt-repository ppa:gma500/ppa && sudo apt-get update
2.a. Check if you can load the psb module: sudo modprobe psb. If you see this in dmesg instead of a switch to the correct resolution,
"kernel BUG: unable to handle kernel NULL pointer dereference at (null)" (2.6.31)
Section "Device"Identifier "GMA500"Option "AccelMethod" "EXA"# someone suggested UXA? but that's for the i965 driversOption "DRI" "on"Option "MigrationHeuristic" "greedy"Option "IgnoreACPI" "yes"Driver "psb"EndSection
Section "DRI"Mode 0666EndSection
If the system goes to DPMS standby and from there switches to other modes (DPMS suspend, etc.), then my screen actually turns on again (showing all black with backlight active). So make sure you chose only one setting for DPMS. A constantly running screen is not good at all.
VAAPI Video Acceleration setup
wget http://www.splitted-desktop.com/~gbeauchesne/libva/pkgs/i386/libva1_0.31.0-1+sds8_i386.deb
http://www.splitted-desktop.com/~gbeauchesne/libva/pkgs/i386/libva-dev_0.31.0-1+sds8_i386.deb&& sudo dpkg -i libva1_0.31.0*i386.deb
sudo ln -s /usr/X11R6/lib/modules/dri/psb_drv_video.so /usr/lib/va/drivers/
sudo apt-get install mplayer libmad0
ln -s libx264.so.67 libx264.so.65
sudo apt-get build-dep mplayersudo apt-get install libdrm-devwget http://www.splitted-desktop.com/~gbeauchesne/libva/pkgs/i386/libva-dev_0.31.0-1+sds8_i386.deb && sudo dpkg -i libva-dev_0.31.0-1+sds8_i386.debmaybe: sudo apt-get -f install
mplayer -fs -vo vaapi -va vaapi ~/HDtest.avi
sudo make install.
Update: It turns out deinterlacing not working is not due to VAAPI, but a limit in the psb driver. It works with the current iegd driver and other drivers from AMD and NVIDIA (press the D putton in mplayer I think). If I could just get one of those iegd drivers... Thanks Gwenole from splitted-desktop.com for answering my email and of course for writing the mplayer-vaapi patches in the first place! He seems to be the absolute VAAPI expert.
Also some experiments show that I can attach an external screen and watch videos with VAAPI on it. That means I should be able to actually use the netbook for decoding HD video and displaying it on an external screen. (But it does not work for me with except in mirror or single display mode.) Only thing missing now is a digital display port to connect a FullHD display... ;)
You might also be interested in Surround Sound and Battery Life
And I did get a USB surround sound card working wonderfully now. Also here's some advice I wrote on decreasing your power consumption.
X Video finally works - Poulsbo and Linux on the MSI Wind U110 - Fix for BUG: kernel NULL pointer dereference at 00000000
"kernel BUG: unable to handle kernel NULL pointer dereference at 00000000" (2.6.28)
"kernel BUG: unable to handle kernel NULL pointer dereference at (null)" (2.6.31)
if (edid)
....
e.g.
/* if (edid)
drm_add_edid_modes(output, edid); */
My script for making the psb module out of the package:
KERNEL=/lib/modules/`uname -r`/
make KERNELRELEASE="$(uname -r)" LINUXDIR="/lib/modules/$(uname -r)/build" DRM_MODULES=psb || exit 1;
sudo cp drm.ko $KERNEL/kernel/drivers/gpu/drm/drm.ko
sudo mkdir -p $KERNEL/updates/dkms
sudo cp psb.ko $KERNEL/updates/dkms/psb.ko
ls -l $KERNEL/kernel/drivers/gpu/drm/drm.ko $KERNEL/updates/dkms/psb.ko
sudo depmod -a
Automatically switch to connected External Display on Boot with XRandR
Well, I've written a one-liner that fixes that problem. If the external display is attached, it will automatically switch over to it and display the internal display. Otherwise it boots normally (leaving the internal display enabled).
I put the script into the Xsession.d directory so it gets started for every user on boot: /etc/X11/Xsession.d/98vgaonly and made it executable.
The actual script line is this:
xrandr -q | grep 'VGA connected' && xrandr --output LVDS --off --output VGA --auto
It checks if the line 'VGA connected' was found in xrandr's query and then asks your X server to turn off the internal output and use the external one with automatic resolution detection.
So to automatically switch to a connected VGA during boot just execute:
echo 'xrandr -q | grep \'VGA connected\' && xrandr --output LVDS --off --output VGA --auto' | sudo tee /etc/X11/Xsession.d/98vgaonly && sudo chmod a+x /etc/X11/Xsession.d/98vgaonly
You may have to change the name of the outputs for your setup. xrandr -q will let you know what's available. It would probably be possible to somehow call this script automatically when plugging in a monitor, but I've not figured out how. xrandr only works when called from inside the running X session in my experience.
If you want to know more about XRandR, check this recent article.
Any comments are welcome!
Blanking External Monitor to Save Energy with Xorg
I've just found out that my external monitor remains on for quite a while in the suspend and off modes (xset dpms force off). The only one that it accepts is standby. Then it turns off right away. And the internal one as well. So that's fine for me. But good to know, isn't it? ;-)
And btw. if you want to use it in a script you have to issue the xset command twice and sleep in between for about 6 seconds. Otherwise they're not really off. Don't ask me why...
NVIDIA Brings Fast GPU Video Acceleration to Linux
Then came XvMC and it was not really convincing, because the impact was not too fast and it only worked during playback Mpeg2 AFAIK, not during transconding.
Now came NVIDIA (admittedly a couple weeks after AMD, but therefore publicly and including patches for mplayer) and finally brought out really nice and efficient video acceleration for linux.
My favorite Linux Performance News Site Phoronix checked it out and you can see quite an improvement (CPU usage with first OpenGL, then XVideo and then Nvidia's "VDPAU"(Video Decode and Presentation API).
I hope AMD and Intel will finally come out with some progress in this area, too. Next I would like to see support for encoding, e.g. in Xvid and then maybe even tasks such as gzip, bzip2 (the latter ones didn't even show multi-core support in my tests).
Disabling Touchpad on Demand
There's now an alternative to using the shared memory of the synaptic driver to enable and disable the touchpad:
xinput set-int-prop "SynPS/2 Synaptics TouchPad" "Synaptics Off" 8 1 (enable)
xinput set-int-prop "SynPS/2 Synaptics TouchPad" "Synaptics Off" 8 0 (disable)
This should work out of the box in Ubuntu 8.10 (Intrepid). But it doesn't. At least not for me. But this works for me:
xinput set-int-prop "SynPS/2 Synaptics TouchPad" "Synaptics Off" 8 0
xinput set-int-prop "SynPS/2 Synaptics TouchPad" "Synaptics Off" 8 1
Nice! :)
Ubuntu 8.10 No-Go for Dual Head
Don't upgrade your Ubuntu to 8.10 if you want to use a dual head setup. There second screen will reguarly turn off for a second while there is an edid ddc scan shown in the Xorg.log. (The bug is not really fixed or fix not in main repository yet. Or I've found a different one. -> It's still not working!)
And the whole system will stutter during that time. That makes video playback very annoyingly slow and usage an external monitor impossible. I'll let you know when I find a fix.
KDE 4.1 with Multi-Head
Intel put up a short howto, but it shouldn't be that different for other drivers. The important part goes like this:
Section "Device"
Identifier "Configured Video Device"
Driver "intel"
Option "FramebufferCompression" "off" # on for battery, off for multi-display
Option "monitor-LVDS" "internal"
Option "monitor-VGA" "external"
EndSection
Section "Monitor"
Identifier "internal"
EndSection
Section "Monitor"
Identifier "external"
Option "RightOf" "internal" #the left display is the primary one
EndSection
Section "Screen"
Identifier "Default Screen"
Monitor "internal"
Device "Configured Video Device"
SubSection "Display"
Virtual 2560 1024
# this should be as large as both displays next to each other
EndSubSection
EndSection
Section "ServerFlags"
# Option "Xinerama" "true" # crashes
Option "AIGLX" "false" # crashes multi-head
EndSection
After doing that, (instead of crashes and frustration) you're rewarded with very nice customization options in KDE 4.1.2: You can set the wallpaper for each screen, put different plasma applets at different locations, etc.
If you're using the intel driver I can also recommend disabling AIGLX in the ServerFlags Section of your xorg.conf to make the setup more stable. After supend/resume I regularly have to set reconfigure the screen setup with xrandr and then switch back and forth between X and the console to turn my external monitor back on.
I wonder how the new X server version in Kubuntu 8.10 will be.
Multiseat Display Manager Out Now
I have always wondered when a software such as the MDM would come out, as the Unix and X architecture is already perfectly prepared for cases as this and even over Network it is already possible.
Now you need only one computer with several displays, keyboards and mice to let several users e.g. surf the internet at the same time.
I will post my experiences as soon as I get to trying it out. For the curious of you here is a link to installing instructions, packages for debian and ubuntu are provided, as well as the sources of couse.
Update: The packages is very large at 20K, but unfortunately at this point available only as i386 package...
Update2: I've quickly assembled a Ubuntu 8.04 package for AMD64 systems ;-).
Minimal X Environment
xfonts-base xterm xutils xauth icewm
Then you should be able to login with nxclient, if you set it to use the custom environment with a virtual desktop and to execute /usr/bin/icewm.
Helping Windows Users with UltraVNC Single Click and ssvnc from Linux
xtightvncviewer -listen 0 -encodings "hextile copyrect"
Replace the 0 with the display number, e.g. 0 for port 5500 or 400 for 5900. (port = 5500 + x) You need to have the package xtightvncviewer installed for this to work in Ubuntu. The color parameter does not work properly in this configuration.
Or give ssvnc a try. It works even with SCIII (uvnc Single Click via SSL), supports different color depths and much more!
And if you've got a current wine version, you might as well use the original ultravnc viewer. It works fine by now.
I usually use ssvn and the following script to start the vnc listener and quit it when finished.
VNC=$HOME/src/ssvnc/bin/tightvncviewer
$VNC -listen 487 -use64 & # 64 colors
read -p "Press enter when finished"
killall tightvncviewer vncviewer
NX Remote Control Software.
It only needs one free port - the SSH port 22. And you can get your free server for Linux or Solaris(limited to two users). The two users which can use NX are chosen when you first connect as a certain user. If you want to free one user slot, just delele the user from NX:
/usr/NX/bin/nxserver --userdel user123
Another cool thing: Instead of the whole desktop environment you can also just run a single program. That makes it really easy to run a Linux program in a Windows environment. It supports printing over cups and has (rudimentary) sound and video support.
And this is not paid advertisement, I actually really like the software. And I think it's great the small company publish the library under the GPL. Of course you have to pay for enterprise level tools. But hey, they got to make money as well. ;)
New Intel Xorg Driver Released
I wish there was an updated package available for hardy. You can probably use the intrepid package again, though. It has version number 2.3.2. Then you can leave the EXA acceleration enabled without the related problems with e.g. Opera.
Locking your Screen with dbus from the command line in Gnome, KDE4 and others.
--print-reply /ScreenSaver org.freedesktop.ScreenSaver.Lock
This will work with KDE4 and should as well work with newer Gnome versions. Tested with KDE 4.1 beta1. It needs the display variable to be set and be run as the appropriate user.
e.g. su $user -c "DISPLAY=:0 dbus-send... "
In Ubuntu 8.04 you can change your /etc/acpi/resume.d/90-xscreensaver.sh to lock the screen on resume like this:
#!/bin/sh
# now, we should poke xscreensaver so you get a dialog
#if pidof xscreensaver > /dev/null; then
for x in /tmp/.X11-unix/*; do
displaynum=`echo $x | sed s#/tmp/.X11-unix/X##`
getXuser;
if [ x"$XAUTHORITY" != x"" ]; then
export DISPLAY=":$displaynum"
su $user -c "(xscreensaver-command -deactivate)"
su $user -c "dbus-send --session --dest=org.freedesktop.ScreenSaver \
--type=method_call --print-reply /ScreenSaver \
org.freedesktop.ScreenSaver.Lock"
fi
done
#fi
Opera+Intel X Shared Memory Problem Fixed
It turns out it is an issue in the X driver. Thanks to develcuy for the fix! You simply change the accelaration mode from EXA to XAA in the xorg.conf file:
in /etc/X11/xorg.conf
you insert in
Section "Device"
Identifier "Configured Video Device"
Option "AccelMethod" "XAA" # not EXA
It's also supposed to help with some memory issues. I will see if that maybe fixes my problems with plasma x shared pixmap cache I just posted about earlier. Even though its the older one of the two x acceleration infrastructures, the intel driver's support of it seems much more stable and fast.
Update:
It turns out there is a better fix for this issue, just upgrade to the newest driver package.
Update2:
The new driver package does not always fix the issue. I hope that these fixes will not be required for Kubuntu 8.10.

