Saturday, June 11, 2011

Accidental success - Working DRI on iBook G4

I upgraded the Ubuntu installation my iBook G4 recently to 10.10 version (Maverick Meerkat). Ubuntu has worked pretty well on this laptop considering that powerpc is not officially supported architecture.
Compared to 10.04 the video/graphics performance is certainly better in 10.10. There are no blocking artifacts in video playback with totem/VLC. The one thing I wanted to test is if DRI works. Unfortunately it does not work by default. AFAIK this is because the radeonfb driver is built in the kernel and it doesn't allow the radeon driver to take over. This also means that hardware acceleration is not enabled.


onkar@iBook:~$ dmesg |grep radeon # radeonfb module loaded, not radeon
[    0.629237] radeonfb 0000:00:10.0: enabling device (0006 -> 0007)
[    0.824915] radeonfb 0000:00:10.0: Invalid ROM contents
[    0.824925] radeonfb (0000:00:10.0): Invalid ROM signature 0 should be 0xaa55
[    0.824934] radeonfb: Retrieved PLL infos from Open Firmware
[    0.824942] radeonfb: Reference=27.00 MHz (RefDiv=12) Memory=190.00 Mhz, System=183.00 MHz
[    0.824947] radeonfb: PLL min 12000 max 35000
[    1.734848] radeonfb: Monitor 1 type LCD found
[    1.734852] radeonfb: EDID probed
[    1.734856] radeonfb: Monitor 2 type no found
[    1.734870] radeonfb: Using Firmware dividers 0x000600ad from PPLL 0
[    1.873860] radeonfb: Dynamic Clock Power Management enabled
[    1.916986] radeonfb: Backlight initialized (radeonbl0)
[    1.916991] radeonfb (0000:00:10.0): ATI Radeon 5c63 "\c"
[    6.978088] [drm] radeon defaulting to kernel modesetting.
[    6.978102] [drm] radeon kernel modesetting enabled.
[   72.399727] radeonfb 0000:00:10.0: Invalid ROM contents
[   72.399919] radeonfb 0000:00:10.0: Invalid ROM contents
onkar@iBook:~$ glxinfo |grep -i render # No hardware acceleration
direct rendering: Yes
OpenGL renderer string: Software Rasterizer
    GL_NV_conditional_render, GL_NV_depth_clamp, GL_NV_fragment_program,
onkar@iBook:~$ ls -l /dev/dri*
ls: cannot access /dev/dri*: No such file or directory
onkar@iBook:~$ cat /proc/fb
0 ATI Radeon 5c63


After looking through some search results in google I decided to try a simple kernel parameter - video=ofonly.
And it works. Following is result of same commands after booting.


onkar@iBook:~$ dmesg |grep radeon # radeon module loaded, radeonfb nowhere in the scene
[    5.863269] [drm] radeon defaulting to kernel modesetting.
[    5.863283] [drm] radeon kernel modesetting enabled.
[    5.863409] radeon 0000:00:10.0: enabling device (0006 -> 0007)
[    5.898390] radeon 0000:00:10.0: Invalid ROM contents
[    5.898411] radeon 0000:00:10.0: Invalid ROM contents
[    5.898419] [drm:radeon_get_bios] *ERROR* Unable to locate a BIOS ROM
[    5.898454] [drm:radeon_agp_init] *ERROR* Unable to acquire AGP: -19
[    5.898477] radeon 0000:00:10.0: VRAM: 128M 0x98000000 - 0x9FFFFFFF (32M used)
[    5.898485] radeon 0000:00:10.0: GTT: 512M 0x78000000 - 0x97FFFFFF
[    5.898550] [drm] radeon: irq initialized.
[    5.898751] [drm] radeon: 32M of VRAM memory ready
[    5.898757] [drm] radeon: 512M of GTT memory ready.
[    5.920977] [drm] radeon: ring at 0x0000000078000000
[    5.921436] [drm] radeon: ib pool ready.
[    6.566905] fb: conflicting fb hw usage radeondrmfb vs OFfb ATY,Via_B - removing generic driver
[    6.568244] fb1: radeondrmfb frame buffer device
[    6.568431] [drm] Initialized radeon 2.5.0 20080528 for 0000:00:10.0 on minor 0
onkar@iBook:~$ glxinfo |grep -i render # Direct rendering working, cheers. :-)
direct rendering: Yes
OpenGL renderer string: Mesa DRI R200 (RV280 5C63) 20090101 PowerPC/Altivec TCL DRI2
onkar@iBook:~$ ls -l /dev/dri*
total 0
crw-rw----+ 1 root video 226,  0 2011-06-08 22:15 card0
crw-rw----  1 root video 226, 64 2011-06-08 22:15 controlD64
onkar@iBook:~$ cat /proc/fb
0 OFfb ATY,Via_A
1 radeondrmfb


Caveats:
1. In boot sequence, after few text messages the screen goes completely blank for about 1 minute. It looks as if the screen is dead. But in the end the gdm shows up fine.
2. The consoles accessed through Ctrl + Alt + F1-F6 are no more available. When trying to access them the screen simply freezes and mouse cursor disappears. Good thing is that pressing Ctrl + Alt + F7 makes the display alive.

Notes:
The same kernel parameter does not work on Debian (testing). After the message about 'conflicting fb hw usage' appears on screen the boot process stops completely.

Next steps:
1. Now that hardware acceleration works, try Ubuntu 11.04 with it's infamous Unity interface (using live CD for now).
2. Try to rebuild the kernel to make radeonfb a module instead of being built in the kernel. Then check if DRI works without the special kernel parameter.

Thursday, April 28, 2011

Advantages of cycling

It was about an year ago that I realized I was becoming one of those typical IT guys in India, the ones with pot belly, weak hearts/lungs and no time for improvement. So I decided that riding a bicycle was probably easiest way to change the situation for better. Better late than never.
After taking advice from some friends I bought one Schwinn Frontier Sport bike from Lifecycle store in Pune. It's a mountain bike with 7x3 gear combination. On the contrary to the website information mine is actually blue. It is really light weight, sturdy and comfortable to ride considering that it does not have rear suspension. The tires are pretty tough too. Along with cycle I also bought a helmet, hand pump, eye gear, head light and tail light. Most of the accessories are from bTwin. The whole deal costed about Rs. 15k.

Since I brought the cycle I have been trying to ride it to office at least on alternate days covering about 40-60km/week. But the maddening heat these days in Pune makes it hard to keep this frequency without sweating a lot. So I hope to increase the frequency after summer finishes.
Anyway, here are some of the advantages of cycling I observed in last few months.
1. Cycling is the cheapest and easiest way to save your health. Saving the environment is just a positive side effect.
2. Cycling also happens to be the second cheapest way of commuting. The first one, walking, is not practical for long distances.
3. Considering the fuel expenses saved the cost of cycle is recovered within two years. All the saving after that is pure profit.
4. Cycles have by default very low maintenance (almost zero).
5. You don't need to carry a license, vehicle registration card or 'pollution under control' certificate to ride cycle. In other words trafic police has no reason to check up on you other than your breaking traffic rules.
6. You don't have to gear down the bike to stop, although it is recommended.
7. There are two more ways to get out of a traffic jam, walking with your bike and carrying your bike.
8. On the road your slow speed doesn't cause traffic problems as nobody bothers staying behind you. :-P
9. Most people on road will applaud/praise you for taking the efforts to ride a bike. Some may berate you as if you are insulting them by being on same road as them, but this probably happens only in Pune.
10. Other bike riders are likely to start a conversation with you about your experience. Some of them become your friends. :-)
11. You get to go on the some sections of road that are restricted to pedestrians because you can walk with your bike. ex. The crossing below the Wakad overbridge in Pune.
12. When riding bike, you will notice more things about the road than you usually do. For example, opposite the HDFC branch in Hinjewadi there is a shop named 'Baba Ramdeo Mobile Shop'. :-D

In related news:
1. In Infosys' huge campus in Pune they keep cycles to go around within campus.
2. I heard that about 25 employees of Geometric company took some sort of 'Go Green' initiative and commuted to office on cycle last week.

That's all for now. Will share more experiences later.

Tuesday, February 22, 2011

gnusim8085 maintenance - 1.3.7 released

After one year since last release, lots of laziness/busy schedules and some coding in between we have finally managed to release 1.3.7 version of our beloved app. Please read (and link/forward) the release
announcement here - https://launchpad.net/gnusim8085/+announcement/7810

Binaries for old versions of Debian/Ubuntu will soon be available on downloads page. For other distributions we rely on respective package maintainers to update the packages.