marcmagus: (regexp)
Magus ([personal profile] marcmagus) wrote2007-04-05 11:55 am
Entry tags:

New Computer: Intro, Sound Card

About a week ago I bought a new computer, and I've started setting it up with Gentoo. It occurred to me that it would be nice to keep a log of any tricky things I've had to do to get it functioning the way I want it to, that it might be good to put it somewhere not on the computer in case I need to refer to it again, and that it might be nice to put it somewhere public in case anybody else runs into the same difficulty. For now, I'm going to blog about these discoveries here. Some day I may compile it somewhere else for nicer reference.

Details will be lj-cut for people skimming.

The computer in question is an eMachines T3604 Minitower I purchased from CompUSA.com. I paid $399.99 for it, free shipping, plus $20 sales tax. $160 rebate from CompuUSA, $50 rebate from eMachines. ($399.99 + 20 - 160 - 50 = $209.99)

Quick specs from CompUSA:

  • Intel Celeron D Processor 356 (3.33GHz) (533 MHz Bus) (512 KB L2 Cache)
  • 512 MB PC2-4200 (533MHz) DDR2-SDRAM [Max 2GB]
  • 120 GB SATA-300 7200 RPM Hard Drive
  • 16X DVD / 48X32X48 CD-RW Combo Drive
  • Motherboard Intel Graphics Media Accelerator (GMA) 950 (PCI Express x16)
  • CompUSA product information
  • eMachines product information

The machine shipped with Windows Vista, so the very first thing I did when I got it plugged in was to boot it from a Gentoo CD and wipe the hard drive. I haven't checked if this gives me a way to transfer the Vista license if somebody actually wants it, but I may give it a try.


I said I was going to talk about interesting things which came up during the process of setting this thing up, so here's the first. When I got to the point where I could give it a try, I realized that my sound card wasn't working. Once I got past the fact that the output was muted by ALSA by default (oops, don't forget to check that), I realized that it was making a sound much like a record skipping, and the program making the sound would freeze. I think it was playing the same (first) fraction of a second of audio endlessly, with a fraction of a second pause, and it wasn't moving beyond that or reporting success back to the playing application. Very annoying to listen to, and of course not desirable.

Step 1: Make sure I have the right driver.

I used lspci -v to get all the information the kernel could about the audio card (I'd done this already in setting up the kernel, but didn't write it down), and did some hunting to confirm that I'd made the right selection. Some Googling on key strings from that and looking around the Gentoo Wiki (great resource, btw) gave me a couple of things to try, mostly to do with updating to the very latest version of ALSA, compiling ALSA as modules, and using the external version of ALSA to get an even more recent version than that shipped with the kernel. Unfortunately, none of this helped.

[magus@cabinet ~]$ sudo lspci -v
Password:
[...]
00:1b.0 Audio device: Intel Corporation 82801G (ICH7 Family) High Definition
Audio Controller (rev 01)
        Subsystem: Gateway 2000 Unknown device 6051
        Flags: bus master, fast devsel, latency 0, IRQ 9
        Memory at 301c0000 (64-bit, non-prefetchable) [size=16K]
        Capabilities: [50] Power Management version 2
        Capabilities: [60] Message Signalled Interrupts: 64bit+ Queue=0/0
Enable-
        Capabilities: [70] Express Unknown type IRQ 0

Step 2: Driver configuration

Back to the Google, with increasing levels of detail on the audio card (actually a combo card with audio, video, bus controller, and tons of other stuff all in one, it looks like). Eventually I pulled out the chipset used in the card from Intel's website, and searched on that, too. That got me to something which suggested hunting through the per-module options in ALSA. (Good thing I'd recompiled as a module at this point, I can insert and remove the module 30 different ways without having to reboot every time.) There's some neat information contained in ${linux-source}/Documentation/sound/alsa/ALSA-Configuration.txt Including a whole bunch of interesting options to pass to the module, none of which made any difference.

Step 3: Kernel logs

At some point during all of this, I noticed a couple of suspicious lines in the kernel logs:

Apr  4 20:07:30 [kernel] PCI: If a device doesn't work, try
"pci=routeirq".  If it helps, post a report
[...]
Apr  4 20:42:45 [kernel] pci_get_subsys() called while pci_devices is still
empty
[...]
hda_intel: azx_get_response timeout, switching to polling mode...

I tried searching on the last one first, which was unfortunate, as it led me mostly along the "tweak the module config" route. However, I did see a few links to people who'd had IRQ problems and had success booting with "pci=noacpi". At some point, that caught my attention and I noticed the "pci=routeirq" line in the logs. Shockingly enough, rebooting with this option passed to the kernel seems to have fixed it. Scanning the web seems to suggest that this is an indication that there's a flaw in the hda_intel driver.

Oh, one quick tip: "chgrp wheel" everything in /var/log which is root:root and not world readable, possibly also doing a "chmod g+wx" on them as well, and reading logs becomes a lot more pleasant. No more need to sudo just to read through a logfile. Don't make them writable, of course. (Anybody know of a good reason not to do this?)

[identity profile] kiddens.livejournal.com 2007-04-05 08:39 pm (UTC)(link)
Does "pci=noacpi" turn off power management just for components on the pci bus or does it turn off all of acpi? It's a desktop, so you probably don't care about power management much, but it might be worth taking a pass at some of the other boot options available if you care about this.
http://www.mjmwired.net/kernel/Documentation/x86_64/boot-options.txt

When I was setting up my mythtv box, dealing with ALSA was the single worst problem I had to overcome. Congrautlations on getting through it.

[identity profile] theoldwolf.livejournal.com 2007-04-06 01:56 am (UTC)(link)
This is a useful idea. I'll be reading and learning as you continue the process.