SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2014-05-05 00:20:25

Alad
Software Satan
Registered: 2014-02-20
Posts: 1,512

Set the default ALSA card interactively with Asoundconf

When using multiple sound cards with ALSA, choosing the default has to be done manually, either with modprobe.d or ~/.asoundrc. Some time ago the tool asoundconf would do this interactively. It was later removed from alsa-utils.

I've repackaged a modified asoundconf with asoundconf-gtk to restore this functionality.

Note: while it says "trusty", the packages only contain python scripts and (outdated sad ) manpages. Works with anything that can install a .deb.

https://launchpad.net/~the-changing-sid … -1_all.deb
https://launchpad.net/~the-changing-sid … -1_all.deb

If you have an existing ~/.asoundrc, backup it first!

To use, run asoundconf-gtk and select your default soundcard. Then reload ALSA

sudo alsactl kill rescan

(only for new applications) or

sudo alsa force-reload

More options with:

asoundconf

I should add that to properly set the default card in PulseAudio, you need gnome-control-center  ( roll ) or mate-media-pulse, which recently got to sid.

Last edited by Alad (2014-05-05 17:13:38)

Offline

Help fund CrunchBang, donate to the project!

#2 2014-05-05 02:14:34

mynis01
#! Die Hard
From: 127.0.0.1
Registered: 2010-07-02
Posts: 2,005

Re: Set the default ALSA card interactively with Asoundconf

Instead of restarting the whole alsa daemon, you should be able to run "sudo alsactl kill rescan". This should be a bit more graceful from what I understand. Myself, I just keep a bunch of different .asoundrc files in my home directory (like .asoundrcTV, .asoundrcQuakelive, .asoundrcPulse, etc.) and overwrite the main one and rescan it when needed. Your solution is a lot more elegant though smile It probably wouldn't actually be a bad idea to merge this into the next #! and put it in the default obmenu, you should PM corenominal about it.

Offline

#3 2014-05-05 05:46:41

Alad
Software Satan
Registered: 2014-02-20
Posts: 1,512

Re: Set the default ALSA card interactively with Asoundconf

Thanks, done and done.

Offline

#4 2014-05-05 14:00:42

mynis01
#! Die Hard
From: 127.0.0.1
Registered: 2010-07-02
Posts: 2,005

Re: Set the default ALSA card interactively with Asoundconf

Alad wrote:

Thanks, done and done.

Did you test it to make sure that command worked on your system? I've only used it on arch.

Offline

#5 2014-05-05 16:23:19

Alad
Software Satan
Registered: 2014-02-20
Posts: 1,512

Re: Set the default ALSA card interactively with Asoundconf

Well it sets the default card in alsamixer, but sounds keep playing on the previous card. That's expected I guess - restarting the application plays it on the correct card.

Last edited by Alad (2014-05-05 17:17:33)

Offline

#6 2014-08-10 17:00:06

Alad
Software Satan
Registered: 2014-02-20
Posts: 1,512

Re: Set the default ALSA card interactively with Asoundconf

Wrote a replacement, as asoundconf is bloat. Just run defsound default, and select the right card.

https://github.com/AladW/scripts/blob/master/defsound

Last edited by Alad (2014-08-10 17:02:10)

Offline

#7 2014-09-22 10:18:50

tonyoptical
#! CrunchBanger
Registered: 2009-09-08
Posts: 226

Re: Set the default ALSA card interactively with Asoundconf

acme@acme:~/bin$ ./defsound.sh
./defsound.sh: Zeile 10: Syntaxfehler beim unerwarteten Wort `('
./defsound.sh: Zeile 10: `is_active() {'
./defsound.sh: Zeile 16: Syntaxfehler beim unerwarteten Wort `}'
./defsound.sh: Zeile 16: `}'

Offline

#8 2014-09-22 10:35:10

Alad
Software Satan
Registered: 2014-02-20
Posts: 1,512

Re: Set the default ALSA card interactively with Asoundconf

^ lol, I forgot a brace  :8

Offline

#9 2014-10-21 21:10:16

johnwayne
Member
Registered: 2014-10-20
Posts: 13

Re: Set the default ALSA card interactively with Asoundconf

so I removed pulse audio and I'm using ALSA, with works fine... except when I plug in my earphones.
Any idea what's causing that ?

Offline

#10 2014-10-21 21:29:03

Head_on_a_Stick
CatMod
From: A world of pure imagination
Registered: 2014-01-21
Posts: 4,797

Re: Set the default ALSA card interactively with Asoundconf

@johnwayne: please don't cross-post (is there an echo in here?).
Original post: http://crunchbang.org/forums/viewtopic. … 64#p400664

Offline

#11 2014-10-24 13:45:26

Snap
#! Die Hard
Registered: 2013-10-22
Posts: 567

Re: Set the default ALSA card interactively with Asoundconf

Alad wrote:

Wrote a replacement, as asoundconf is bloat. Just run defsound default, and select the right card.

https://github.com/AladW/scripts/blob/master/defsound

Thanks a bunch, Alad!  cool

Offline

#12 2014-11-17 01:40:54

daggoth
Member
From: New Zealand
Registered: 2012-01-18
Posts: 39

Re: Set the default ALSA card interactively with Asoundconf

Alad wrote:

Wrote a replacement, as asoundconf is bloat. Just run defsound default, and select the right card.

https://github.com/AladW/scripts/blob/master/defsound

Thanks Alad, defsound worked okay for me, and programs like mplayer and mpv now work fine. But what is the best way to make that alsa default setting system-wide rather than just for the current user?

On my system, mpd is a system daemon which runs as user "mpd". Yet user "mpd" isn't typically setup with login rights or a home folder. So running defsound as my normal user fixed sound for everything except mpd. Of course, I did get mpd going after editing /etc/mpd.conf. Even so, setting a systemwide alsa default would be simpler for me in the future.

Offline

#13 2014-11-22 14:39:13

Alad
Software Satan
Registered: 2014-02-20
Posts: 1,512

Re: Set the default ALSA card interactively with Asoundconf

You can put what's in ~/.asoundrc.def in /etc/asoundrc , or change the module loading order. There might be more to it, but I'm afraid I'm not familiar with mpd.

Last edited by Alad (2014-11-22 14:39:38)

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.
Server: acrobat

Debian Logo