Audio under FreeBSD 5.x on a Sony VAIO Laptop
After installing FreeBSD 5.1 on my Sony VAIO PCG-R505GC laptop, I quickly noticed that the sound only worked when the some other device using the same IRQ as my sound card was active. For example, both my USB ports and the ethernet jack used IRQ 9, the same as the sound card. When there was heavy traffic on the internet connection or I was using a USB mouse, I could hear the sound. Once the activity stopped, however, so did the sound.
Problem
How to get sound working on a Sony VAIO laptop running FreeBSD 5.x
Solution
The problem has to do with the PCI driver for FreeBSD 5.x < 5.2 improperly routing interrupts for PCM devices. There is a problem report on FreeBSD's website with a fix, but it's relatively difficult to find. Here is a link to the report:
The report contains a diff for sys/dev/pci/pci.c. After
applying the diff, just rebuild the kernel and everything works fine.