Results 1 to 2 of 2

Thread: 5.0.1 CD sound config sometimes confused after boot

  1. #1
    Junior Member registered user
    Join Date
    Jan 2006
    Location
    Dartmouth, Nova Scotia, Canada
    Posts
    17

    5.0.1 CD sound config sometimes confused after boot

    Hi,

    I have a Dell D600 with an Intel Corporation 82801DB/DBL/DBM (ICH4/ICH4-L/ICH4-M) AC'97 Audio Controller (rev 01). Normally when I boot the 5.0.1 CD the soundcard is correctly detected and configured.

    However, if I boot while I have a USB webcam (046d:08b1 Logitech, Inc. QuickCam Notebook Pro, this webcam has a built in MIC) plugged in, and also an Edirol USB-MIDI converter plugged in, on occasion the sound does not get configured correctly and no startup sound is played, and "wavp" is unable to play a sound.

    When this happens, rather than the Intel sound card being registered as card0, the USB audio driver gets registered as card0. Whether this is cause or effect of the sound output problems I dunno, but I'm guessing cause.

    I am creating a CD for non-technies to use, and I don't want to confuse them by telling them not to plug in their USB devices until after booting is complete.

    Does anyone have a suggestion as to how I can coax the boot process into always picking the built-in sound card to be card0? (I can't really tie this to the Intel sound card specifically, since the CD will be used on other computers as well.)

    Thanks.

    Jim

  2. #2
    Junior Member registered user
    Join Date
    Jan 2006
    Location
    Dartmouth, Nova Scotia, Canada
    Posts
    17
    Well, I've come across enough of the answer to kludge a solution, so I'll write this up in case anyone else cares about it in the future.

    knoppix-autoconfig calls /etc/init.d/udev start (unless you told it not to).

    udev calls /sbin/udevsynthesize to generate events for files matching /sys/bus/*/devices/*/uevent
    /sys/class/*/*/uevent
    /sys/block/*/uevent
    /sys/block/*/*/uevent

    Among those are a device in /sys/bus/pci/devices/ corresponding to my PCI sound card
    and devices in /sys/bus/usb/devices/ corresponding to the USB audio devices I have
    plugged in.

    Each device is registered in quick succession by writing "add" to that file, which
    (presumably) makes udev take notice of the device and load drivers. A "queue" is formed in a (temporary) directory /dev/.udev/queue and as events are processed the files
    are removed from this directory.

    Unfortunately, "queue" is a mis-nomer, and events are not always handled in the order
    in which they are generated. Consequently, on occasion, the PCI sound card is not
    dealt with first, and one of the USB devices gets to be sound card 0, which is a Bad Thing
    in this case.

    I have a workaround which I think is horrible and ugly, but it seems to work, and thus it
    has some virtue. Here it is for anyone wanting to use it. The first change was my first
    attempt and did not work by itself, possibly I could remove it.

    The queue size of 3 below was chosen after a few tests, there is no scientific basis to it.

    Cheers.

    Jim


    Code:
    # Jim Diamond mod #1... list the USB devices last, so that PCI sound card events
    # come as much before USB  audio devices as possible
    for file in /sys/bus/[A-Za-tv-z]*/devices/uevent /sys/class/*/*/uevent \
                    /sys/block/*/uevent /sys/block/*/*/uevent \
                    /sys/bus/u*/devices/*/uevent ; do
      case "$file" in
        */device/uevent) ;;         # skip followed device symlinks
        */\*/*) ;;
    
        */class/mem/*)              # for /dev/null
        first="$first${IFS}$file" ;;
    
        */block/md[0-9]*)
        last="$last${IFS}$file" ;;
    
        *)
        default="$default${IFS}$file" ;;
      esac
    done
    
    # Jim Diamond mod #2: also don't let the queue get too full, else the USB devices
    # may still get registered as sound card 0.
    # 3 is a number seen to work in a number of tests; if too big, the USB device might
    # get card0, if too small there will be too many sleeps, slowing down the whole process.
    for file in $first${IFS}$default${IFS}$last; do
      [ "$file" ] || continue
      # echo "sending 'add' to $file"
      # lsmod | /usr/bin/head -8
      # echo =========================================
      echo 'add' > "$file" || true
      if [ `ls -1 /dev/.udev/queue | /usr/bin/wc -l` -gt 3 ]
      then
          # echo "sleeping for a second because queue has more than 3 items"
          sleep 1
      else
          # echo "not sleeping for a second"
          :
      fi
    done

Similar Threads

  1. Confused
    By samhainbaphomet in forum General Support
    Replies: 8
    Last Post: 02-04-2005, 11:04 AM
  2. very confused....
    By poundsmack in forum General Support
    Replies: 8
    Last Post: 10-23-2004, 10:02 AM
  3. sound config
    By jojo in forum Hdd Install / Debian / Apt
    Replies: 4
    Last Post: 01-29-2004, 12:18 AM
  4. Replies: 1
    Last Post: 01-09-2004, 01:47 PM
  5. sound config saving error
    By Kapz in forum Hardware & Booting
    Replies: 0
    Last Post: 08-05-2003, 05:22 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Intel Xeon E3-1270 v6 3.80GHz 4 Cores SR326 LGA1151 CPU Processor picture

Intel Xeon E3-1270 v6 3.80GHz 4 Cores SR326 LGA1151 CPU Processor

$46.00



Intel - Core i9-12900K Desktop Processor 16 (8P+8E) Cores up to 5.2 GHz Unloc... picture

Intel - Core i9-12900K Desktop Processor 16 (8P+8E) Cores up to 5.2 GHz Unloc...

$619.99



Intel - Core i7-12700K Desktop Processor 12 (8P+4E) Cores up to 5.0 GHz Unloc... picture

Intel - Core i7-12700K Desktop Processor 12 (8P+4E) Cores up to 5.0 GHz Unloc...

$419.99



Intel Xeon E5-2697A V4 2.6GHz CPU Processor 16-Core Socket LGA2011 SR2K1 picture

Intel Xeon E5-2697A V4 2.6GHz CPU Processor 16-Core Socket LGA2011 SR2K1

$39.99



E5-2697V4 INTEL XOEN SR2JV 18 CORE 2.30 GHz 45M 9.6 GT/s 145W PROCESSOR CPU picture

E5-2697V4 INTEL XOEN SR2JV 18 CORE 2.30 GHz 45M 9.6 GT/s 145W PROCESSOR CPU

$49.99



Intel Core i5-8500 3 GHz 8 GT/s LGA 1151 Desktop CPU Processor SR3XE picture

Intel Core i5-8500 3 GHz 8 GT/s LGA 1151 Desktop CPU Processor SR3XE

$49.99



AMD Ryzen 9 5950X 16-core 32-thread Desktop Processor picture

AMD Ryzen 9 5950X 16-core 32-thread Desktop Processor

$319.99



Intel - Core i9-14900K 14th Gen 24-Core 32-Thread - 4.4GHz (6.0GHz Turbo) Soc... picture

Intel - Core i9-14900K 14th Gen 24-Core 32-Thread - 4.4GHz (6.0GHz Turbo) Soc...

$619.99



Intel Core i5-12400 Desktop Processor With HeatSink picture

Intel Core i5-12400 Desktop Processor With HeatSink

$140.00



Intel Core i5-8500T SR3XD 2.10GHz Processor | Grade A picture

Intel Core i5-8500T SR3XD 2.10GHz Processor | Grade A

$55.00