No DRI on X.Org with a Radeon? Check your Virtual size.

28 October 2009

After I installed Fedora Rawhide on the eMac this week, I fired up X.Org, only to discover that…

(II) AIGLX: Screen 0 is not DRI2 capable
(II) AIGLX: Screen 0 is not DRI capable

So it had fallen back to a software 3D renderer, which is pretty crap. So to make a long story short, it was because my ‘Virtual’ screen size was too big. I typed xrandr, and got the following:

$ xrandr
Screen 0: minimum 320 x 200, current 1280 x 960, maximum 2048 x 2048

Because of various technical reasons, when the Virtual size is too big (which, evidently, 2048×2048 is), DRI gets disabled. So, to re-enable it, I put this into my xorg.conf:

Section "Screen"
        Identifier "Main Screen"
        Device "Radeon 7500"
        Monitor "eMac CRT"
        SubSection "Display"
                Virtual 1280 960 # put the highest resolution you intend to use here
        EndSubSection
EndSection

Obviously, edit the values to suit.

Multiseat tips

3 August 2009

Recently, I’ve set up multiseat on my system, which means that, unlike multihead, where the desktop is expanded to two monitors, two sets of monitors, keyboards, and mice are attached to the computer, but run separate desktop sessions, meaning the computer is acting like two separate computers.

The setup is very neat, and performance is surprisingly good. For all but the most graphically and processor-intensive applications, the fact two people are logged on to the machine is not even noticeable, from a performance point of view.

Some helpful guides on setting such a system up are:

However, there are a few gotchas when setting it up. Hopefully this list will be of help.

  • Multiseat is very buggy. Test one X server at a time (by manually launching it with the right parameters), and do it from a remote computer over an SSH session, because your display will probably get corrupted, making your console temporarily unusable if you make even the slightest mistake.
  • If the display is corrupted, and you are restarting X several times, and it doesn’t look like it’s going to work, it’s probably a good idea to reboot (do it safely, by either remotely rebooting, hitting Ctrl+Alt+Delete, or by using the Raising Skinny Elephants trick), because there’s a good chance your problems will be solved after a reboot.
  • If you are using NVIDIA cards with the nv or nouveau driver, while I commend you for supporting free software, I have never got those drivers working with multiseat. I recommend running the proprietary driver (and different driver versions have different glitches with multiseat — if you are having problems, try an older — or newer — driver).
  • Don’t mix-and-match video cards of different brands. A 3Dfx and NVIDIA card won’t play nicely, for example, but an NVIDIA and NVIDIA card may. Also, there are weird bugs with certain models. For example, my GeForce 7600GT and GeForce 6200 don’t work well together, but the GeForce Go 6150 and GeForce 6200 work fine.
  • If you are using an ATI Radeon, then use the Xephyr method. Radeons cannot support the use of the Screen keyword in separate layouts.
  • If you are getting issues with the screen scrolling or rotating of sorts (like a sideways badly tuned old-style television), then try adding no-scroll to your kernel boot parameters.
  • When launching X.Org (or in your gdm.conf configuration), the -novtswitch and -sharevts options that are described in all multiseat tutorials can sometimes cause more harm than good, and may even be unnecessary. For example, if you use -sharevts, your keystrokes may silently be duplicated to a hidden login prompt which could wreak havoc on your system.
  • In the [daemon] section of gdm.conf, set VTAllocation=false to stop GDM from appending its own arguments to the X.Org command line. Specify vt7 (or whatever VT you want X.Org to run on) manually on the X command line — and make sure both X servers are set to the same VT.
  • Sound is a pain to get working. Make sure PulseAudio is either running system-wide, or make PulseAudio use dmix:0 instead of hw:0 as a device (yes, I know Lennart would cringe, but at least it’s more reliable). If you created a second user to test with, don’t forget to add him/her to the audio group!

IPv6 over PPP over a null-modem connection

26 June 2009

I just did my first null-modem serial link today. And yes, I did IPv6. On each computer I ran:

# pppd nodetach noauth local /dev/ttyS0 115200 ipv6 ,

Then, each computer came up with a ppp0 interface that was down by default (for some reason, pppd doesn’t like to bring it up if it’s IPv6-only). So I ran this on one machine:

# ifconfig ppp0 up
# ifconfig ppp0 add fc00:23::1
# ip route add fc00:23::2 dev ppp0

And then on the other machine, the reverse:

# ifconfig ppp0 up
# ifconfig ppp0 add fc00:23::2
# ip route add fc00:23::1 dev ppp0

Then the glorious:

$ ping6 fc00:23::2
64 bytes from fc00:23::2: icmp_seq=1 ttl=64 time=12.0 ms
64 bytes from fc00:23::2: icmp_seq=2 ttl=64 time=11.8 ms
64 bytes from fc00:23::2: icmp_seq=3 ttl=64 time=9.87 ms

Serial is cool.

Update: Added the ‘local‘ keyword in case pppd has ‘modem‘ specified by default in /etc/ppp/options

Freelancer on VirtualBox: you heard it here first

10 April 2009

You can now play Freelancer under Linux with 100% compatibility by running it under VirtualBox with Direct3D acceleration!

Freelancer in VirtualBox

Thanks to the OpenGL support in VirtualBox, and the awesome WineD3D work by Robert Millan, Freelancer, which is a 2003 Direct3D 8.1 game, runs perfectly in VirtualBox.

All you need is the latest VirtualBox (2.1 or 2.2 will do), a copy of Windows to run inside it, and the latest WineD3D for Windows. I tested on both XP and Vista — it ran smoother on Vista (ironically), but both were playable.

Freelancer has worked in Wine on Linux without virtualisation for some years now, but multiplayer support is something that has never worked properly. With virtualisation, Freelancer can use the native Windows networking, and thus works perfectly with multiplayer.

(Well, actually, if you use Windows Vista, you have to disable IPv6, otherwise multiplayer doesn’t work, but that’s a different story.)

The game runs much smoother than back when I ran it in VMware: the speed was inconsistent, and I used to get booted off multiplayer servers for allegedly using “speed mods”. With VirtualBox, performance is extremely consistent. (Although Moore’s Law may have something to do with that.)

Have fun!

Playing with Haiku

10 March 2009

A good many years ago, I played around with BeOS R5 Personal Edition, which was a fun and different little operating system from the late ’90s and early ’00s. I first encountered this operating system when it was bundled on a free CD that came with an issue of the PC PowerPlay magazine.

BeOS R5 Personal Edition was fun to play with, but rather limited, owing to the fact that it installed itself into a 512MB loop partition, of which the size couldn’t be adjusted. Also, unfortunately, the hardware on which I ran it wasn’t supported very well (in particular, I had no networking), so I stopped using it after a while.

A couple of years ago, I heard about the Haiku project, which is an open source clone of BeOS that aims to be binary compatible with its applications. Back then, it was quite unstable, had absymal hardware support, and didn’t run very well under virtualisation.

Well, that’s all changed. Though Haiku hasn’t reached 1.0 yet, its daily builds are very impressive. I have been testing Haiku during the last couple of days, doing my usual hacking, and it has not crashed once. Seriously — my Haiku system has not crashed yet. The same could not be said of it two years ago, or even one year ago.

Apparently BeOS (and thus Haiku) uses a microkernel architecture, which is quite cool. They also appear to be the starters (PDF) of the *Kit fad.

Even my Hackintosh system gets unstable after about 18 hours of use (I suspect memory corruption from the video driver), and my Gentoo system will regularly refuse to launch applications (I suspect something is blocking in klauncher) or shut down (udev likes to hang). Haiku has now met the bar in terms of stability, in my opinion.

Haiku supports 2D acceleration on my GeForce 7600GT (also tested on a GeForce 8600, which does not support acceleration yet), and supports my nForce network adapter (it currently uses a driver ported from FreeBSD, although there is also a previous port of forcedeth) brilliantly. One bug forces me to jump through a hoop to get DVI video working, however. The video resolution (GMA950, 1024×600) and Atheros network of my Eee 901 were also supported out-of-the-box, although Haiku has no wireless LAN support yet.

Getting up and running is child’s play. Haiku is distributed in raw HDD images and VMware images. The raw images can be dd‘ed straight to a USB flash drive or hard drive partition and booted, or run in QEMU.

Yep, booting Haiku off a flash drive is as easy as dd‘ing the image onto the drive. (Haiku only supports USB 2.0, not 1.1 at this present time, but I doubt there are many computers with USB 1.1 around that can boot off USB.)

Haiku natively supports SMP (Symmetric Multi Processing), which BeOS also had way back as long ago as 1995. (The BeBox sold between 1995 and 1996 shipped with dual PowerPC processors.)

I’m not sure if it’s just a gimmick, but you can turn off one or more of your processors using the ProcessController applet. If you try and turn off all your processors, however, you are chided:

"This is the last active processor...you can't turn it off!" (Button is captioned "That's no fun!")

That’s an improvement over the original BeOS, where if you turned off all your processors, the system would instantly lock!

Haiku ships with Firefox 2.0 and VLC 0.8.6c, and is fairly POSIX-compliant. Most stock-standard Unix apps should compile fine on Haiku. Haiku is currently shipped as being compiled with GCC 2.95.3, but GCC 4.1.2 and 4.4.3 versions can be compiled from source.

Standard UI font family is good old DejaVu, which I have grown to know and love, and uses FreeType for rendering and hinting. (Binary distributions are shipped without subpixel font rendering, for fear of patent infringement, but support can be compiled in manually.)

The one area which I have had no success in yet is audio. When running under VirtualBox or QEMU, I can emulate an AC’97 audio card. I can play music files, but the resulting audio are garbled and barely recognisable. On my physical systems (Intel HDA), the sound card is not detected at all. Update: If you compile OSS 4.1rc4, audio then works.

Still, it is very fun to play with. Oh, one tip for those of you trying out Haiku: hold down Shift as you drag on the title bar of an application.