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