Baruch Even's blog

A geeks blog

Fri, 25 May 2007

MSI S420 sound
Category: Contribs

A while ago I bought an MSI laptop, model S420. The sound didn't work but normally I don't really need it anyway so it was never an important issue. A few days ago I started using powertop to understand why my laptop can live on battery for less than two hours. One problem I have with powertop is that I don't get enough information on the C-states of the CPU, they are controlled by the BIOS so I went to the MSI website to hunt for a BIOS upgrade. During the course of this hunt I found an old patch for sound drivers for other models of MSI laptops and in them I found hints for my own sound card. Some guesswork and a single try and I found a patch that makes the sound work me.

I didn't find an explanation or a changelog for the bios upgrades so I didn't try them yet but the patch to get the sound working is following. It is for kernel 2.6.22-rc2 but it should easily be adapted to other kernels, it's just a one-liner. The patch was accepted (in variation) into the ALSA repository and will probably show up in kernel 2.6.23.

--- 2.6-rc2/sound/pci/hda/patch_realtek.c	2007-05-19 13:56:54.000000000 +0300
+++ 2.6.22-rc2/sound/pci/hda/patch_realtek.c	2007-05-25 00:42:42.000000000 +0300
@@ -6389,6 +6389,7 @@
 	SND_PCI_QUIRK(0x1462, 0x4314, "MSI", ALC883_TARGA_DIG),
 	SND_PCI_QUIRK(0x1462, 0x4319, "MSI", ALC883_TARGA_DIG),
 	SND_PCI_QUIRK(0x1462, 0x4324, "MSI", ALC883_TARGA_DIG),
+	SND_PCI_QUIRK(0x1462, 0x3729, "MSI", ALC883_TARGA_DIG),
 	SND_PCI_QUIRK(0x1462, 0xa422, "MSI", ALC883_TARGA_2ch_DIG),
 	SND_PCI_QUIRK(0x1025, 0, "Acer laptop", ALC883_ACER),
 	SND_PCI_QUIRK(0x161f, 0x2054, "Medion laptop", ALC883_MEDION),
Comments ()

Wed, 17 Aug 2005

Uncompressed OpenOffice Documents
Category: Contribs

It's a well known fact that OpenOffice documents are just zip files of XML documents. I wanted to be able to keep them in a version control repository and preferred to keep the text files in the VCS instead of the binary zip file, for this I create a small script coffice to compress the text files to a zip file, run OpenOffice and uncompress it back after OOo exits.

This is suboptimal since I need to exit from OpenOffice to be able to commit the file, but it's a quick enough hack.

Another problem is that the XML files are all a single line so normal diffs are meaningless as it is now. One way to deal with it will be to reindent the XML files to a readable form. I'll leave that to another session.

Comments ()