>Is it possible to use/set environment variables to change the default ALSA device?
>you can use ALSA_PCM_CARD or ALSA_CARD to set the default card, either by name or by number. If both are set, ALSA_PCM_CARD takes precedence. The device on the card can be set in the variable ALSA_PCM_DEVICE.
Anyway, no pulseaudio, simple usb soundcard/dac based on Burr-Brown from TI[1] - and now (software) mixing of audio works across youtube/html5 audio in iceweasel (21.0~b6-1 from "deb http://mozilla.debian.net/ experimental iceweasel-beta"), vlc and flash audio in chromium[2]. All that was needed in the end, was the following ~/.asoundrc:
# Aliases for the devices. I don't use the onboard audio -
# terribly noisy. The names (after card) come from
# /proc/asound/cards - see [1]
pcm.nvidia { type hw; card NVidia; }
ctl.nvidia { type hw; card NVidia; }
pcm.usb { type hw; card DAC; }
ctl.usb { type hw; card DAC; }
# If all you want is use usb as default,
# uncomment this, and ignore the rest.
#pcm.!default pcm.usb
ctl.!default ctl.usb
# For software mixing - allowing several programs to play audio
# at the same time:
#dmix for software mixing - http://alsa.opensrc.org/Dmix
pcm.!default {
type plug
slave.pcm "dmixer"
}
pcm.dmixer {
type dmix
ipc_key 1024 # must be unique!
slave {
pcm "hw:DAC"
}
}
Now, I've also realized that the main reason I started fighting with
this, was the delay introduced by pulsaudio, which is only a problem for
me in vlc -- and that could've been fixed (probably) by using the
tools->Track synchronization menu options. Just in case anyone else has
synchronization issues.I currently don't do any gaming (except for Angband...) -- or other synchronization-sensitive multimedia.
[1] according to /proc/asound/cards: 0 [DAC ]: USB-Audio - USB Audio DAC Burr-Brown from TI USB Audio DAC at usb-0000:00:0b.0-3, full speed
[2] Apparently html5 audio (at least in videostreams) is broken in chromiumr. Flash video (from eg regular non-html5-youtube) works fine for me with this set up. Some more details at: http://code.google.com/p/chromium/issues/detail?id=178626
[edit: minor corrections]