Kjetil's Information Center: A Blog About My Projects

Compaq Deskpro XL 5133 with Red Hat 5.2

I decided to install the classic Red Hat Linux 5.2 distribution on my classic Compaq Deskpro XL 5133 machine. The 5.2 version is one of the more well known from the late 90's, and several others have used this to experience the past. It is using the 2.0.36 version of the Linux kernel.

Before any of the SW installation could take place, the on-board battery had to be changed to be able to keep the system configuration intact. Luckily the battery is a Lithium type, so it doesn't leak, but it was soldered in place. I changed it with a CR2032 battery holder, which works fine.

CR2032 battery holder replacement


After configuring the system with the special Compaq floppy disks (there is no BIOS setup menu!) I was able to install Red Hat 5.2 using the CD-ROM without any trouble. The machine has a Matrox Millennium VGA card which works fine in X Windows and a on-board AMD PCnet32 Ethernet controller working out of the box.

The troublesome part was getting the audio to work, which is classified as "Compaq Deskpro XL Business Audio", but is in reality a "Microsoft Sound System" compatible chip of the AD1847 type:

AD1847JP SoundPort Chip


When playing any audio, it would stutter and the following error would appear:

Sound: DMA (output) timed out - IRQ/DRQ config error?
          

I tried all kinds of different IRQ and DMA settings, but to no avail. To troubleshoot further I setup a QEMU emulated environment also with Red Hat 5.2 to be able to quickly recompile the ad1848.o module device driver.

I figured out that in vanilla Linux 2.0.36 the sound drivers are not modularized, and Red Hat had actually applied a patch to modularize them. So this exact setup had to be re-recreated. The original sources can be found here as "kernel-2.0.36-0.7.src.rpm". But these still needs to be patched, where I did the following:

tar -xvzf linux-2.0.35.tar.gz
gunzip 2.0.36-pre-patch-14.gz
gunzip sound.diff.gz
patch -p0 < 2.0.36-pre-patch-14
patch -p0 < sound.diff
mv linux linux-2.0.36
patch -p0 < kernel-2.0.36-sound-new.patch
cp kernel-2.0.36-i386.config linux-2.0.36/.config
          

Yes, the original sources is actually Linux 2.0.35, but with a patch to bump it up to 2.0.36!

After enabling debugging flags, I eventually found out that this stock driver is detecting the audio chip wrongly as a "OPTi 82C930" chip, which in turn causes the IRQ status to be read from the wrong register!

Here is my own patch to fix this problem and enabling the debug:

--- ad1848.c.orig    2020-08-30 12:42:45.362175159 +0200
+++ ad1848.c    2020-08-30 12:42:52.142175232 +0200
@@ -37,6 +37,9 @@
 
 #include "soundmodule.h"
 
+#define DEBUGXL
+#define DDB
+
 #define DEB(x)
 #define DEB1(x)
 #include "sound_config.h"
@@ -1532,10 +1535,19 @@
     {
         if ((tmp1 = ad_read(devc, i)) != (tmp2 = ad_read(devc, i + 16)))
         {
-            DDB(printk("ad1848 detect step F(%d/%x/%x) - OPTi chip???\n", i, tmp1, tmp2));
-            if (!ad1847_flag)
-                optiC930 = 1;
-            break;
+            if (deskpro_xl)
+            {
+                DDB(printk("Deskpro XL, so assuming AD1847\n"));
+                ad1847_flag = 1;
+                break;
+            }
+            else
+            {
+                DDB(printk("ad1848 detect step F(%d/%x/%x) - OPTi chip???\n", i, tmp1, tmp2));
+                if (!ad1847_flag)
+                    optiC930 = 1;
+                break;
+            }
         }
     }
 
@@ -1688,7 +1700,10 @@
                         }
                         else
                         {
-                            devc->model = MD_4231;
+                            if (! deskpro_xl)
+                            {
+                                devc->model = MD_4231;
+                            }
                         }
                 }
             }
@@ -1708,6 +1723,7 @@
     if (devc->model == MD_1848 && ad1847_flag)
         devc->chip_name = "AD1847";
 
+    DDB(printk("ad1848_detect() - '%s' (%d)\n", devc->chip_name, devc->model));
 
     return 1;
 }
          

Or you can download my recompiled version here.

The /etc/conf.modules section ended up being like this for the driver:

alias sound ad1848
alias midi opl3
options opl3 io=0x388
options ad1848 io=0x530 irq=9 dma=1,0 type=2 deskpro_xl=1
          


Compaq Deskpro XL 5133


Topic: Configuration, by Kjetil @ 01/11-2020, Article Link