View Single Post
  #2   (View Single Post)  
Old 1st May 2008
Carpetsmoker's Avatar
Carpetsmoker Carpetsmoker is offline
Real Name: Martin
Old man from scene 24
 
Join Date: Apr 2008
Location: Eindhoven, Netherlands
Posts: 2,080
Thanked 198 Times in 156 Posts
Default

Here is a script that will load the sound drivers one by one, detect which one you're using, and add it to /boot/loader.conf.

This will work on any version of FreeBSD.

Code:
#!/bin/sh
#
# Detect sound driver

for driver in /boot/kernel/snd_*; do
  driver=$(echo ${driver} | sed 's|/boot/kernel/snd_||')
  if [ ${driver} = "driver.ko" ]; then
    continue;
  fi

  kldload snd_${driver}
  if [ -c /dev/mixer0 ]; then
    echo "I'm smelling 'snd_${driver}'"
    echo "snd_${driver}_load=\"YES\"" >> /boot/loader.conf
    exit 0
  fi
  kldunload snd_${driver}
done
Attached Files
File Type: sh snd.sh (374 Bytes, 122 views)
__________________
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things.
Reply With Quote