News for hackers. Stuff that matters.
Re:Linux is not about choice (2008) by eliasmacpherson on Monday May 06, 2013 @05:52PM (#5665016)
Am on debian squeeze, and am not able to find out how to switch between soundcards as the default. Sure I can fire up VLC or Audacity and select within, but the default movie player picks the default sound card and I can't see a way to change it. A minor gripe, probably user error on my part. Also youtube etc use the default soundcard.
Re:Linux is not about choice (2008) by 15charusername on Monday May 06, 2013 @06:43PM (#5665246)
I'm sure there will be a GUI way to switch the default but I tend to use environmental variables when I want to launch a program out of a non-default device

>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.

http://alsa.opensrc.org/FAQ026

Re:Linux is not about choice (2008) by e12e on Tuesday May 07, 2013 @05:47AM (#5667242)
I've been fighting with audio on my Debian Squeeze system for a while, but I now think I've finally gotten everything to work. One caveat -- I've yet to try a lot of music listening, so perhaps the addition of the dmix-module does criple the sound a bit -- hard to tell as long as my only other audio source is record player -- if my hi-fi cd player hadn't died a while back an a/b test would've been easier.

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]