Programmer’s Log Programmers Writing Stuff – Garry Bodsworth

28Apr/100

Binary blobs…

I discovered a way to consistently crash xorg using the nvidia driver.  Open webkitgtk, close it, wait fiver seconds, open it again, rinse and repeat for 15 minutes.  Boom xorg explodes.  Go look at the logs and you have a stack trace telling you something went wrong. As far as I can tell it is running out of texture memory. Bizarrely it doesn't do this for videos.

The nvidia driver itself is really quite good in the grand scheme of things providing things like tear-less, hardware accelerated video. It's still more consistent and better quality than the open-source ones (obviously owning all the IP and information helps).

But this is the problem with binary blobs you can't tell what is going on inside until the state is spat out in the event of failure. I generated the bug report using the nvidia supplied tool and looked at it myself, and there was no information in there that would give a clue as to why. If the internals were exposed you could look at where the memory was going like in the days of GEM memory leaks on Intel.

I guess open-source has its own set of advantages and limitations, as well as the closed-source approach, but damn, I hate losing many hours trying to at first reproduce then diagnose it, let alone being able to make an attempt to fix it.

16May/090

DisplayLink Open Source

Yesterday Displaylink released Linux source code for its USB display adapters. The project is LGPL and available on FreeDesktop. The project itself is called libdlo and is available from this link with the Git repository here. You can see DisplayLink's announcement here.

At the moment it is a low-level library for speaking to the device and is not yet wrapped in a Xorg driver. The code itself supports ASIC devices and only the USB versions (if that means something to you then you have probably worked for DisplayLink at some point).

The code itself is impressively documented, and means people should be able to get something up and running pretty fast. I'm sure some interesting and exciting projects will come out of this.

Well done to DisplayLink on doing this - this is going to be a really good thing for getting content onto displays. USB is a really good solution - imagine daisy-chaining lots of displays controlled by a single computer.

13Apr/090

nVidia + Linux + ACPI = Borked

It's a simple equation and has cost me a day of trying to get ACPI suspend/hibernate working on Linux. It took me long enough to realise it was the nVidia driver causing the issue.

Whenever I tried suspend or hibernate I would get a black screen with a flashing cursor in the top left. After working out it was the nVidia driver I tried all the remedies I could find on the Internet by other people with the same bug. What I discovered was this problem has been around for going on at least three years and no solution is being worked on.

The obvious articles are here, here, here, here, and here.

All solutions provide slightly different but the same solution, you need to set NvAGP in your xorg.conf to either 0 or 1 and optionally use agp=off for your kernel. I tried various concoctions and none of them worked.

I think I worked out what the problem is though. If your motherboard chipset is not nVidia (I think they call them nForce) then NvAGP will never work because mine always drops back to agpgart. This must be why most of the success is seen on laptops where the IGP must be using nVidia chipsets. My motherboard has a VIA chipset (old and crusty I know) with a GeForce 8500GT hence my complete and utter lack of success.

Like I said this problem has been around for quite a while and the chipset problem could be why the only responses I have read from nVidia is that they are unable to reproduce it. So for me it will be a new sensible graphics card with hopefully fairly open drivers.

Tagged as: , No Comments
4Jan/0912

Ubuntu 8.10 – It’s Great But With A Couple Of Problems

I am in the process of making my desktop computer into a work computer by removing Windows XP and going down the Ubuntu (8.10 Intrepid Ibex) route.

I thought I'd share some of the problems I had just in case some other people find my solutions useful since from my Googling I notice quite a few people have some issues. I think also I made the problem a bit worse because I am using 64-bit on my Core2Duo.

Problem #1 : Can't get my nVidia GeForce 6600GT to work with the nVidia binary blobs. I was using the latest out of the repositories and then tried the latest from nVidia and all I got was a blank screen and some not very helpful logs. I was getting seriously annoyed after hours of hacking at X configuration files and different nVidia drivers, almost to the point I was going to go out and buy an ATi in the hope open source or at least better drivers would be forthcoming.
Solution #1 : The way I ended up having to solve it was using the Beta 1.80 drivers from nVidia. Definitely not an ideal solution because I have now discovered problem #2.

Problem #2 : Songbird 1.0.0 won't work. There are two places to get 64-bit debs for Songbird which are both listed here. It won't start though - bah! On closer investigation glibc is complaining about and invalid free() call. In the callstack you can see the culprit is the nVidia driver. So now I have to ask myself do I want Songbird or a proper nVidia driver, but Firefox does work with no problems for me. There is also a report of the problem at the Songbird customer service site.

Problem #3 : Sound didn't work for my motherboard. I knew the chip and driver required which was a snd-via82xx (serves me right for using such a cheapskate sound solution). So a quick sudo nano /etc/modules and adding the driver name to the end of the file fixed that problem. It just needed a restart for the kernel to pick up the change.

But, enough about problems, I am very impressed now I have the basic system up and running. The desktop effects are extremely nice and non-intrusive. You need to install the "Advanced Desktop Effects Settings (ccsm)" and "Compiz Fusion Icon" to gain access to the UI for customisation. I did a few minor tweaks mainly to switch off wobbly windows and enable the Expose-a-like "Scale". In general the user interface all looks great. If you don't have the graphics card problems I have there is a good set of instructions here on getting the drivers and running Compiz.

I also installed Flash 10 (for x64) and it worked flawlessly. I even managed to watch the Dr Who announcement on the iPlayer Watch BBC One Now option. Flash does eat CPU but it seems to work fine apart from the fullscreen option on iPlayer. And obviously Firefox is as good as ever. I've installed Screenlets and used the widget layer available in Compiz for the OSX-like Dashboard.

What I did next was to install Virtualbox 2.1 using the repository method (to override the ones available from Ubuntu). Then I proceeded to install Windows XP that was on this machine in the VM. After finding the right disk installation was faster than when it was actually on the hardware as were reboots. I am really impressed with this. It even activated first time!

Now I have a properly working system I can say that the 12 hours I spent (mostly trying to fix the unfixable) doing this was more than worthwhile because it boots fast, lets me work fast, and is completely controllable. The only hope I have is that there are some mature open-source video drivers (with 3D) out there in the future because then I will know which cards to buy for minimal hair loss. Also I swear the Ubuntu installation takes about ten minutes maximum compared to the unwieldy Windows installation.

12Aug/080

OpenGL 3.0 Specification Now Available

I used to track what was going on in OpenGL very closely because I was in the CAD/CAM industry and 3D graphics are important there. It doesn't seem that the changes were as radical as everyone was expecting as it was mentioned that there was a new object model being designed (I seem to remember blogging about it nearly two years ago).

You can see the proposed specification from the OpenGL Pipeline Newsletter 004.

Apparently certain developers are furious about it with some very long and vitriolic discussions. If you really want to inflict them on your brain you can see them here, here, and here. It seems the games developers are making the CAD industry scapegoats for any of the problems with the process.

It may not be the radical change but it is at least incremental, and provides a basis to deprecate and add some functionality. I still like the simplicity of using OpenGL, but then again I was never trying out any of the cutting edge features available on the graphics cards. OpenGL and OpenGL|ES are still being used on the Mac, Linux/Unix derivatives, Nintendo (DS and Wii), Playstation, and the iPhone.

You can check out a summaries here and here for the main changes with the full spec here (PDF).