• Posts
  • RSS
  • ◂◂RSS
  • Contact

  • Handling Identical USB Sound Cards

    September 10th, 2021
    jammer, tech  [html]
    My Pi Sound Box has two output channels, each on a USB sound card. One has a mic input and runs my whistle synth, the other has no audio input and runs fluidsynth. This worked fine, up until my first gig out (busking in the park) where it decided to swap the devices: my whistle card moved from hw:0,0 to hw:1,0, and vice-versa.

    Here's someone else with the same problem in 2011.

    Cheap USB devices don't have a serial number, and these two sound cards present identically. On the other hand, it's possible to identify them by their location in the USB tree:

    $ for x in /sys/bus/usb/devices/*/product; do
        echo $x $(cat $x)
      done
    /sys/bus/usb/devices/1-1.2.1.3/product USB Audio Device
    /sys/bus/usb/devices/1-1.2.1/product 4-Port USB 2.0 Hub
    /sys/bus/usb/devices/1-1.2.2/product HP Elite USB Keyboard
    /sys/bus/usb/devices/1-1.2.4/product AXIS-49 2A
    /sys/bus/usb/devices/1-1.2/product 4-Port USB 2.0 Hub
    /sys/bus/usb/devices/1-1.3/product USB Audio Device
    /sys/bus/usb/devices/usb1/product DWC OTG Controller
    

    (lsusb --tree can do this too, but it's harder to read)

    Since this is based on physical ports, it will be consistent across reboots.

    It looks like you can write udev rules to tell the system how to map 1-1.2.1.3 to hw:*,0 (docs). Unfortunately, this was getting well beyond what I considered fun, so I gave up. I added a key combination to swap the outputs (commit), so if I notice it's wrong while setting up at a gig I can fix it. Possibly at some point I'll come back and deal with udev?

    Comment via: facebook, lesswrong

    Recent posts on blogs I like:

    What I've been doing instead of writing

    I’ve been too busy with work to write much recently, but in lieu of that, here’s a batch of links to other stuff I’ve been doing elsewhere. The thing I’m most excited about: Wave raises $200m from Sequoia, Stripe, Founders Fund and Ribbit at a $1.7b valuati…

    via benkuhn.net September 11, 2021

    Meet a Historian: Michael Taylor on Why We Need Classics

    Note from the Editor: This week, Michael Taylor joins us to present A Defense of Classics. The last decade or so has seen Classics (the study of Mediterranean antiquity or more narrowly the study of Greece and Rome) in a hard sort of quandary. On the one …

    via A Collection of Unmitigated Pedantry September 10, 2021

    What’s Frustrating About Bus Redesigns

    The transit vlogger Alexandra Rose said something deeply disturbing and yet true on Twitter: More and more I think that bus network redesigns are too often just managed decline. I was really into zero cost change redesigns a few years ago, less so recentl…

    via Pedestrian Observations September 5, 2021

    more     (via openring)


  • Posts
  • RSS
  • ◂◂RSS
  • Contact