Enabling Intel VT On Sony Vaio
tags: intel-vt sony vaio virtualbox
05 Jun 2010 10:45
I created a 64-bit virtual machine for testing some cool stuff on some cool machine in our office, but wanted to transfer it to my laptop. How pissed I was to realize that 64-bit machine can be only emulated by VirtualBox when VT-X (or corresponding AMD's technology) is used (Intel's extension to CPUs especially for virtualization). Without them, you can only emulate 32-bit machines even if you have 64-bit Linux running or the host.
Sony for some reason disables the virtualization technologies in their laptops and give so poor BIOS UI, that you can't enable it. I've read that after someone actually hacked their BIOS to enable the feature, Sony released BIOS update that adds the option to enable VT, but not for my model (Vaio SZ-640N).
I found one wonderful howto here, but it had a few flaws:
- link to symcmos.exe was not valid anymore (just search for that file on random FTP servers, you'll find it quickly)
- I haven't handled to run FreeDOS from USB stick, so I downloaded CD image from FreeDOS site and burnt it into a DVD (no CD in my house, but that's not a problem)
- FreeDOS when run from CD fails to initialize USB sticks I've tried (3 of them). Additionally it crashes with an error "invalid opcode" after doing "InitDisks". I needed to have the symcmos.exe file available in FreeDOS LiveCD, so I created a small FAT16 partition on my main disk and put it there. It was accessible as disk C:. It seems FreeDOS handles partitions really well, because the partition was the last partition on my quite big disk, located on a extended partition and my partition table is not straight in a way that /dev/sda2 in the extended partition, while primary one /dev/sda3 is located before it. FreeDOS handled this, I had my FAT16 partition visible and I was able to run symcmos commands :-).
So that's it. Time to do experiments on the machine.
Comments: 0
Playing Unreal Tournament On Ubuntu Lucid
tags: linux tournament unreal
17 May 2010 07:16
I wanted to play Unreal Tournament on Ubuntu 10.04 (Lucid Lynx) 64-bit. Linux is theoretically supported by Unreal Tournament, by using custom installer. So this is how to do it:
Get Unreal Tournament
The most likely version to obtain is UT GOTY (Game Of The Year edition).
Get Installer
Go here:
http://www.liflg.org/?catid=6&gameid=51
There are two installers. Download both using BitTorrent client. For me the one witout "goty" worked.
Run installer like this:
sudo bash /path/to/unreal.tournament_436-multilanguage.run
Probably it won't run, because you don't have GTK 1.2. Bad news, GTK 1.2 isn't even available in system repository. The last Ubuntu version that shipped GTK 1.2 was Ubuntu Jaunty. My favorite trick to get packages from older distros is as follows:
sudo sed s/lucid/jaunty/g /etc/apt/sources.list -i
sudo aptitude update
sudo aptitude install -y libgtk1.2
sudo sed s/jaunty/lucid/g /etc/apt/sources.list -i
sudo aptitude update
Try to run the installer, it should work now.
Default options are generally OK, so you can keep them. Once "enter CD" dialog appears, you need to either enter the CD or mount the ISO image using the following command:
sudo mount /path/to/the/iso-file.iso /media/cdrom
Click OK, and the installer continues to run. If you're asked to enter CD2 and you don't have one, try the second installer (the one without "goty") from loki site.
Running UT
I had no luck in running UT:
quake@vaio ~ $ ut
Signal: SIGIOT [iot trap]
Aborting.
From this thread I've learned it could be solved by doing this:
cd /usr/local/games/ut/System
for i in ../Maps/*.uz ; do sudo ./ucc-bin decompress $i ; done
mv *.unr ../Maps
After doing this, you should be able, to run ut successfully.
Changing resolution
I was not able to change resolution (once I changed it, it was going back to 640x480 after a few seconds). Open file ~/.loki/ut/System/UnrealTournament.ini, locate "640" and "480" in it and change to desired resolution.
High speed
When I run UT it seemed going about 5 times faster than it should. After reading much about -cpuspeed option and playing with CPU downclocking I figured out that without sound it runs OK. After some experimenting it seems, that it's pulseaudio is causing it, once I killed it and prevented to run (it auto-respawns for some reason) UT finally worked at good speed.
sudo chmod -x /usr/bin/pulseaudio
killall pulseaudio
ut
The problem with this is that some process continuously tries to run pulseaudio, which causes CPU to be loaded and ut to run not smoothly.
So this should work:
sudo mv /usr/bin/pulseaudio /usr/bin/pulseaudio.original
echo -e '#!/bin/bash\nsleep 10000' | sudo tee /usr/bin/pulseaudio
sudo chmod +x /usr/bin/pulseaudio
killall pulseaudio
ut
Remember to do this after playing ut:
sudo mv /usr/bin/pulseaudio.original /usr/bin/pulseaudio
If you have some problems with sound after playing UT, log out and in again, and it should be OK.
NOTE: this trick should be equivalent to running pasuspender ut, but for some reason it does not work.
More tricks
When playing on LAN party we discovered more tricks:
To let UT correctly determine CPU speed, you need to set CPU frequency (using some applet or cpufrequtils) and disable additional cores (leaving one):
echo 0 | sudo tee /sys/devices/system/cpu/cpu1/online
echo 0 | sudo tee /sys/devices/system/cpu/cpu2/online
echo 0 | sudo tee /sys/devices/system/cpu/cpu3/online
echo 0 | sudo tee /sys/devices/system/cpu/cpu4/online
echo 0 | sudo tee /sys/devices/system/cpu/cpu5/online
echo 0 | sudo tee /sys/devices/system/cpu/cpu6/online
echo 0 | sudo tee /sys/devices/system/cpu/cpu7/online
(if you have 8 cores, cpu0 will be online, the rest offline).
Next trick is disabling desktop effects or window composing. For one person this meant much smoother graphics, for other it meant working sound (which is very weird, but yes, that's true).
UPDATE: Maverick Audio
It seems that on maverick the pulseaudio hack is not working, but here's what you can do instead:
- edit /usr/local/bin/ut (may be located somewhere else, find when you installed the game)
- find this line: ./$GAME_BINARY "$CMD_ARGS" "$@"
- replace with: padsp ./$GAME_BINARY "$CMD_ARGS" "$@"
- (make sure you have the padsp binary, just run try to run it)
- then just run ut and sound works :-)
UPDATE: this works, but gives significant audio lags (200-300 ms!). This basically sucks. So the other workaround is:
- having alsa-oss installed (program aoss)
- having a proper .asoundrc in home directory:
ctl.!default {
type hw
card 0
}
pcm.dmixer { #this virtual device does the mixing of
type dmix #the various signals
ipc_key 1024
slave {
pcm "hw:0,0"
period_time 0
period_size 1024
buffer_size 4096
rate 44100
}
bindings {
0 0
1 1
}
}
pcm.!default { #this means that applications use the mixer
type plug #by default, so you can hear everything
slave.pcm "dmixer"
}
- having 32 bit alsa-oss libs installed (getlibs -p alsa-oss)
You need /usr/lib32/libaoss.so. Once you have it backup /usr/lib/libaoss.so and link it to the 32 bit version: /usr/lib32/libaoss.so. Then edit the ut script like before but instead of padsp use aoss. This works for me. WARNING: this overrides all ALSA applications. If you want the default configuration (that routes the audio to pulseaudio), you'll need to change .asoundrc file name after playing UT.
Comments: 4
Maj
tags: polish
05 May 2010 18:45
Od lutego nie pisałem nic na blogasku, więc czas przerwać milczenie.
Aktualnie zajmuję się następującymi projektami:
- praca magisterska
- Wikidot
- kilka pobocznych rzeczy
Praca magisterska
Tematem mojej pracy są mobilne przeglądarki internetowe. Celem praktycznym będzie stworzenie używalnej mobilnej przeglądarki internetowej dla Linuksa z serwerem X11. O ile istnieją dobre przeglądarki mobilne na różne inne mobilne platformy (BlackBerry, iPhone, Android), to żadnej dobrze działającej nie udało mi się uruchomić na zwykłym Linuksie.
Wyspecyfikujmy wymagania przeglądarki:
- obsługa palcem
- przewijanie przez przeciąganie po ekranie
- duże guziki
- łatwe powiększanie i pomniejszanie
- utrzymywanie odpowiedniego poziomu interakcji (czytaj: wyeliminować kilkunastosekundowe zwiechy programu)
- ma być jak najszybsza (na ile to możliwe) i być zgodna ze standardami W3C (ale możemy poświęcić jakiś mało używany wodotrysk np. z CSS3, jeśli zyskamy sporo na wydajności)
Tworzenie przeglądarki, to trudna rzecz, więc nie będę zaczynał od zera. Wezmę przeglądarkę Arora i dopasuję ją do moich wymagań. Dlaczego Arora:
- oparta na silniku WebKit, co daje sporą przewagę wydajności nad choćby Firefoksem
- w miarę dobrze napisany kod, co sprawia, że się ją łatwo modyfikuje
- z testów wydajności (które przeprowadzam w swojej pracy) nie jest wprawdzie najszybsza, ale ma bardzo dobre wyniki
- napisana w Qt, co daje możliwość skompilowania również na Symbiana, QtE, Windows Mobile i być może na Androida.
Wikidot
Z racji pracy magisterskiej nie mogę się tak bardzo skupić na Wikidocie jakbym chciał, ale obecnie zajmuję się w wolnych chwilach monitorowaniem Wikidota (wykresiki, alerty mailowe itd), a ostatnio sen z powiek spędzał mi element [[html]], który niedawno wprowadziliśmy (głównie dzięki mnie) a który czasami nieprawidłowo ustawiał swoją wysokość w przeglądarce Firefox. Okazało się to winą Firefoksa, ale udało się to jakoś obejść. W skrócie mówiąc Firefox bardzo agresywnie cache'uje iframe'y (tzn. latające ramki), co sprawia, że nie zawsze wykonuje się zawarty w nich kod JavaScript. Aby temu zapobiec dodałem coś w stylu '?' + Math.random() do URL-a ładowanego w ramce. W ten sposób (o ile mamy dobrą funkcję Math.random w przeglądarce) za każdym razem generowany jest inny URL, co wymusza ponowne pobranie go z serwera. Skrypt się wykonuje i ramka prawidłowo zmienia swój rozmiar.
Inne rzeczy
Postanowiłem stworzyć miejsce w sieci, gdzie będę zbierał projekty, które wykonuję (takie portfolio) a także, gdzie będę mógł napisać, co potrafię robić. Powstało ono pod adresem: web9.pl. Być może kiedyś ten projekt przekształci się w firmę. Póki co, jest to głównie portfolio. Mimo wszystko zapraszam :-).
Z racji tworzenia mobilnej przeglądarki internetowej, jestem właścicielem otwartego telefonu OpenMoko Neo FreeRunner (który pracuje pod kontrolą systemu Linux). Jedną z najlepiej na nim działających dystrybucji jest QtMoko, oparte na QtExtended (dawniej Qtopia). Ostatnio testuję nowe testowe wydania tej dystrybucji, głównie pod kątem działania GPRS. Zrobiłem również małego demona, który aplikuje workaround na bug w kernelu i trzyma otwarte urządzenie ALSA-y, a wszystko po to, by umożliwić rozmawianie przez Neo za pomocą zestawu słuchawkowego Bluetooth (niestety rozmawianie bez zestawu jest bardzo trudne, bo mikrofon jest zbyt czuły, a głośnik za cichy).
Warto powiedzieć, że dzięki GPRS i GSM oraz fajnej aplikacji o nazwie NeronGPS, można używać Neo jako aplikacji do orientowania się na drogach. Niestety nie ma funkcji nawigacji, więc nie jest absolutnie świetna. Jednak lepiej z mapą i bez nawigacji, niż bez mapy i bez nawigacji.
Oprócz napisania pracy magisterskiej muszę powiedzieć, że sporo obowiązków nakładają na mnie studia. Muszę zaliczyć dwa przedmioty do wyboru, z czego na jeden aktualnie chodzę, a co do drugiego, to muszę się umówić na egzamin. Niestety i piąty rok musi czasem coś pozdawać.
Tak właśnie upływa mój maj. I szybko się to pewnie nie zmieni ;-)
Comments: 0
Changes? Not Really
tags: wikidot
28 Feb 2010 17:36
As announced on Wikidot blog, CEO of Wikidot.com is changing. The position of CEO of Wikidot has been hold by Pieter Hintjens, now changed by Michał Frąckowiak, the founder of Wikidot service.
Pieter was the Wikidot front-man for its community and organized good workflow for many community and internal projects. We learned how to talk to the community, how to solve problems and how to concentrate on important things. And we're going to keep being good at it.
With the addition of data forms Wikidot becomes one of the most interesting wiki platfarms (platform + farm) on the Earth. Using ListPages, _templates and forms we allow (almost) regular folks to create applications like CMS for their co-workers, clients or friends. Things usually done by programmers are now available for smart guys without need to find proper hosting, web framework or writing a line of computer code.
What I find most interesting in building applications on Wikidot is that the platform itself is quite bullet-proof. I mean when you forget to put semicolon at the end of some line, you don't get your application crashing because of syntax error. Moreover when making application you get storage with history and e-mail notifications about changes for free, which makes your data quite safe. In case someone destroys your site (which you are informed by e-mail), you can just revert the right version).
But Wikidot applications is not the most important thing Wikidot is used for. Many sites on Wikidot are just plain wiki sites with links to store and share knowledge of certain groups. They don't use advanced features like modules, includes, templates. They usually edit and save :-) from time to time uploading some file or image. What we want to do is to review all common operations people do most often and (really really) simplify them. Sophisticated applications are worth nothing if basic usage of service is not easy.
We want to introduce features people will appreciate, like [[html]] blocks for embedding completely custom HTML, like this:
[[html]]
<h1>Custom HTML</h1>
<p>Something else</p>
<img src="anything.png" alt="hello ;-)"/>
[[/html]]
This code will just inject the HTML (including JavaScript) into the page in that place. Seems easy to do, but in fact, to make it safe for your site, we needed to implement this as a frame, that autoresizes to keep the content fit inside.
We also want to introduce [[block]] syntax for sandboxing wiki texts, for example:
[[block]]
What put inside is parsed and rendered independently, so even if you put some random [[/div]]s or other nasty things, the page outside will be rendered nicely.
[[/block]]
This will be useful for site designers to use in template pages, like this:
[[table]]
[[row]]
[[cell]]
[[block]]
%%content%%
[[/block]]
[[/cell]]
[[cell]]
some other things.
[[/cell]]
[[/row]]
[[/table]]
Putting %%content%% in block tags you make sure user won't break the original layout (the table). Without block, user could put [[/cell]] inside of his text and thus break the layout.
To let our users know what happens on their sites, we want to make live feeds of activity available for most common start-places on the web — iGoogle, NetVibes, Facebook and Twitter. Most important news from YOUR sites will be next to other things you start your day from.
We have a bunch of other fresh ideas, which we'll be sharing on blog.wikidot.com.