Announcement

Collapse
No announcement yet.

Looking for clues on how to switch between multiple installed soundcards

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Looking for clues on how to switch between multiple installed soundcards

    This all started when in my new appartment I had to locate the cabinet of my main workstation so that it is a lot of work to reach down and replug headphones and loudspeakers, To addd stones to the burden,  I even bought a new external soundcard (for fun making music) so that I now have 3 soundcards, but only one of them is located so that I can easily shift the plugs around.

    Yes I am lazy  :P this is supposed to make good hackers, according to Larry Wall.

    What I want to do now is to figure out how I can route my audio output and input to various sound devices as I see fit, without rebooting and replugging. Currently the external USB audio thing is not really working, so I will write my examples like I want to switch between two soundcards. I guess teh principles will be mostly the same for adding the third one.

    By the way, I dualboot this machine with Windows Vista and when I use Vista I just go to the sound control panel and there I can switch between various output alternatives and input alternatives as default, while from most of my audio programs (like audigy, for example) I can also control input and output from an options menu within the application if I don't like the defaults. I think something like this should be possible to do in Kubuntu too.

    OK this is the problem:
    I have 2 soundcards on my system:
    Code:
    myuser@mymachine:~$ more /proc/asound/modules
     0 snd_ca0106
     1 snd_hda_intel
    
    myuser@mymachine:~$ more /proc/asound/cards
     0 [CA0106         ]: CA0106 - CA0106
                          Audigy SE [SB0570] at 0x9c00 irq 18
     1 [NVidia         ]: HDA-Intel - HDA NVidia
                          HDA NVidia at 0xfe020000 irq 20
    I want to put my big boom loudspeakers on the Nvidia card (1) and use the Audigy card (0) for my headphones  and never have to crawl to the back of the computer to unplug/replug again. I want to be able to shift the output from loudspeakers to headphones when I feel that is appropriate. I might even want to run two audio enabled applications at the same time, one with output to the headphones and the other to the loudspeakers, but I consider that a more advanced topic and we can live that for later.

    First, let me just point out that I already have configured my system to load the devices in the same order always. This is done by editing the file /etc/modprobe.d/alsa-base . As the last four lines, I have added:
    Code:
    # fixing ordering of soundcards,
    # so that it becomes static and not random
    options snd_ca0106 index=0
    options snd_hda_intel index=1
    This seems to work: I have never noticed that the numbering of the soundcards is random anymore.
    I think this is a good start, but I can't find out what to do to switch output from one soundcard to the other.
    It seems like my computer running Kubuntu is only willing to output to soundcard number 0 (the ca0106 aka soundblaster audigy). It should be possible to reconfigure this on the fly Please give me a hint on what to do about this. I have googled for too long but never really found the answer to exactly this question.

    EDIT/ADDED:
    I just looked at the ALSA webpages and finally managed to get at least alsaplayer direct output to a specific soundcard using this kind of syntax:
    Code:
     alsaplayer -o alsa -d hw:1,0  somefile.mp3
    This worked it sent the output to the HDA Nvidia card 1, 0 which is the analog output, while Amarok was playing another song on the CA0106 Soundblaster output.

    I don't really use alsaplayer for anything, so this was just nice as a proof of concept, but not completely what I am looking for.
    What I am looking for is primarily a way to redirect the main output for all sound to soundcard of choice.

    #2
    Re: Looking for clues on how to switch between multiple installed soundcards

    I think you need to look into Jack http://jackaudio.org/. I believe you can use the jack control to route each audio source to each output. I used it for a while and liked it, but really had no use for that much functionality. All the jack components can be installed through adept, so no compiling from source is necessary. Hope this is what you are looking for.

    namopereht

    Comment

    Working...
    X