Set default audio device - usb dac

The problem

I'm having a hell of a time getting my Fiio E10k (usb dac) to be the default playback device.
If you have any insight into this, it would be much appreciated...

Temp Solution

Atm, I have to call "amixer -c 3" as root to switch it every time I boot.
It works just fine once I do this.

Configs !@#$@#%!

/usr/share/alsa/also.config
...
defaults.ctl.card 3
defaults.pcm.card 3
defaults.pcm.device 0

Context Info

  • Debian 8
  • Awesome wm (over top Cinnamon)
  • alsa
  • Fiio E10k (usb dac)

  • aplay -l
    **** List of PLAYBACK Hardware Devices ****
    card 0: PCH [HDA Intel PCH], device 0: ALC1150 Analog [ALC1150 Analog]
    Subdevices: 1/1
    Subdevice #0: subdevice #0
    card 0: PCH [HDA Intel PCH], device 1: ALC1150 Digital [ALC1150 Digital]
    Subdevices: 1/1
    Subdevice #0: subdevice #0
    card 1: NVidia [HDA NVidia], device 3: HDMI 0 [HDMI 0]
    Subdevices: 1/1
    Subdevice #0: subdevice #0
    card 1: NVidia [HDA NVidia], device 7: HDMI 1 [HDMI 1]
    Subdevices: 1/1
    Subdevice #0: subdevice #0
    card 1: NVidia [HDA NVidia], device 8: HDMI 2 [HDMI 2]
    Subdevices: 1/1
    Subdevice #0: subdevice #0
    card 1: NVidia [HDA NVidia], device 9: HDMI 3 [HDMI 3]
    Subdevices: 1/1
    Subdevice #0: subdevice #0
    card 3: Audio [DigiHug USB Audio], device 0: USB Audio [USB Audio]
    Subdevices: 1/1
    Subdevice #0: subdevice #0
    card 3: Audio [DigiHug USB Audio], device 1: USB Audio [USB Audio #1]
    Subdevices: 1/1
    Subdevice #0: subdevice #0

Would pavucontrol do the trick? Or does it strictly have to be alsa, not having pulseaudio as an option?

well.... I'm only using Alsa. It's installed and works perfectly once I set the device manually. It's just a pain to do it as root every time I boot.

I feel like I must just be missing something in the config, or maybe the USB device isn't available yet when the config file is called?

Well I'm not familiar at all using alsa as I'm lazy, but I guess one solution would be to run 'sudo amixer -c 3' automatically when you log in; place the script.sh in /etc/profile and add the /path/to/script.sh to the /etc/sudoers file so it can run without a password.

Debian doesn't have sudo....

To do the script idea though, I guess I would need to dive head first into the systemD script structure. I tried once before but got a bit lost/overwhelmed by the spaghetti network of scripts. I wasn't sure where the proper place would be to insert my own.

apt-get install sudo - then you have sudo ;)

apt-get install pavucontrol (should install pulseaudio as a dependancy) then you can control the audio straight from a GUI - no need to for unnecessary scripts.

They are called unit. Unit files are loaded from two locations. From lowest to highest precedence they are:
- /usr/lib/systemd/system/: units provided by installed packages
- /etc/systemd/system/: units installed by the system administrator

That being said, here you can find documentation on how to write systemd unit files.

1 Like

Sorry... but, weakening my system with sudo and tossing out ALSA for some other software is not a solution to my problem. I'm not interested in "just install this totally different package".

Thanks! I will begin reading.

I feel trolled lol

my condolences.

Deb 8 comes with sudo out of the box, shell scripts have nothing to do with systemd, pulseaudio doesn't 'replace' alsa and running commands with sudo is more limited (read: secure) than using actual root... or maybe I got the worst case of alzheimers ever.

This very much depends on how sudo is setup and how the command is wring and script written. Its not always more secure!

@eidolonFIRE

Do you always have the USB DAC installed?

Try this.

/etc/asound.conf

pcm.!default {
    type hw
    card 3
}

ctl.!default {
    type hw           
    card 3
}

You might also consider pulseaudio if you remove the DAC now and then or use miltiple sources, it handles things better than ALSA, that said.. Both can be a pain to configure, if you need to configure them. I've had a good time with pulse the past couple years. But I also dont really use window managers, so sometimes less on the stack is better.

@Baz is correct though on the audio, pulse doesnt replace ALSA, its similar to Jack it uses ALSA to talk to the hardware.

1 Like

sigh... didn't work.

I still have to set it manually as root after login.

amixer -c 3

do you have a ~/.asoundrc?

nope

for the life of me I still cannot get this to work...

I understand Debian Jessie has switched around some stuff with alsa? I think most of the stuff I've been finding are all old.