You are not logged in.

#1 2011-06-17 09:17:26

Zucca
Member
From: KUUSANKOSKI, Finland
Registered: 2009-02-26
Posts: 135

ALSA default device - changing it

So...
I have three ways to output audio from my system.
- Laptop speakers / pluggable analog device (both work as same device, if something is plugged in, hardware automatically turns off the speakers, as in most laptops)
- HDMI audio
- Bluetooth audio

I'd like to have a simple (K.I.S.S.) way to
a) change the output source or
b) set the prority (order) and let the system automatically choose which output to use.

In case of B if no bluetooth audio device is found then try HDMI if that fails too then use speakers/analog output.
I'm not sure if it's even possible to recognize if HDMI is plugged or not...

In case of A some kind of control panel / applet would be nice.


K.i.s.s. <3

Offline

#2 2011-06-17 09:33:21

Cdh
Member
Registered: 2009-02-03
Posts: 1,098

Re: ALSA default device - changing it

Have you tried asoundconf?
http://aur.archlinux.org/packages.php?ID=23382

asoundconf list
asoundconf set-default-card <one from the list>

It changes the ~/.asoundrc to include ~/.asoundrc.asoundconf and then sets the default card in ~/.asoundrc.asoundconf

But as this is plain alsa it will only affect newly started programs and maybe newly started audio output actions.


When using pulseaudio you could use pavucontrol to change output streams from one device to the other on the fly.


฿ 18PRsqbZCrwPUrVnJe1BZvza7bwSDbpxZz

Offline

#3 2011-06-17 10:20:46

Zucca
Member
From: KUUSANKOSKI, Finland
Registered: 2009-02-26
Posts: 135

Re: ALSA default device - changing it

Cdh wrote:

Have you tried asoundconf?
http://aur.archlinux.org/packages.php?ID=23382

asoundconf list
asoundconf set-default-card <one from the list>

It changes the ~/.asoundrc to include ~/.asoundrc.asoundconf and then sets the default card in ~/.asoundrc.asoundconf

But as this is plain alsa it will only affect newly started programs and maybe newly started audio output actions.

Thanks. I think that is a good solution anyways. smile I think I'll create menu items or something to have it "clickable".

Cdh wrote:

When using pulseaudio you could use pavucontrol to change output streams from one device to the other on the fly.

My experiences with Pulseaudio are far from K.I.S.S.. sad


K.i.s.s. <3

Offline

#4 2011-06-17 10:41:20

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: ALSA default device - changing it

Zucca wrote:

prority (order)

ALSA has no concept of "priority" AFAIK. The program should be sensibly choosing the right PCM itself.

Personally I use a little script.

Offline

#5 2011-06-17 11:58:23

Zucca
Member
From: KUUSANKOSKI, Finland
Registered: 2009-02-26
Posts: 135

Re: ALSA default device - changing it

Unfortunatelu asoundconf does not work at all. and it lists sound cards only. I have only one choice: intel. There's no mention about my bluetooth device. I have set it up globally on /etc/asound.conf And it works too if I specify it on command line for mplayer for example.
As for the script it might be best solution, but it sure isn't pretty. :\


K.i.s.s. <3

Offline

#6 2011-06-17 13:45:47

Cdh
Member
Registered: 2009-02-03
Posts: 1,098

Re: ALSA default device - changing it

Hm... maybe bluetooth audio is a bit different from normal alsa soundcards.

I think should give pulseaudio a try, even when it is not so KISS. Pulseaudio now begins to work as it should have all the time from when it was introduced as default in ubuntu...


฿ 18PRsqbZCrwPUrVnJe1BZvza7bwSDbpxZz

Offline

#7 2011-06-21 18:28:04

Zucca
Member
From: KUUSANKOSKI, Finland
Registered: 2009-02-26
Posts: 135

Re: ALSA default device - changing it

I think I'll create a script that works similar to asoundconf but rather creates a config file which sets a certain device as default alsa device.
If you run

aplay -L

you can see the list of devices. And this bluetooth set is also listed there as I have configured it in ~/.asoundrc.
It will be dirty hack/kludge, but I'd rather use it than begin to lose my nerves with pulse audio (once again).


K.i.s.s. <3

Offline

Board footer

Powered by FluxBB