Page 1 of 8 123 ... LastLast
Results 1 to 10 of 79

Thread: Multiple Sound Cards

  1. #1
    Join Date
    Apr 2008
    Beans
    4,377
    Distro
    Ubuntu 9.10 Karmic Koala

    Multiple Sound Cards

    Multiple Sound Cards/Hardware Devices

    Many people here seem to be under the impression that Ubuntu does not support more than one sound card and that having more than one sound card will create insoluble difficulties. This is not true. Setting up for multiple sound cards/devices takes little time and a little understanding about how to do it, that's all. You can have your multiple sound devices up and running in 10 minutes or less by following these directions. If you have any usb devices this will help you.

    If your sound card is listed in System/Preferences/Sound, you can make use of it. You can use as many sound cards as you can fit in or on your computer. You can use them separately, or combine them into a number of useful configurations. Many semi-solutions have been available with ALSA for quite a while but this generally involves skillful editing of the asoundrc file and does not address the problematic issue of synchronization of sound device clocks. A gradual drift in clock timing makes these ALSA solutions only partly successful. There are some high end professional audio cards like the Hammersmith and M-Audio line that have provisions for clock timing synchronization, but they are far beyond the needs and pocketbooks of most users. This is about setting up your system so controlling multiple sound devices is easy and convenient.

    Assigning Default Devices
    A common problem that arises with multiple pci sound cards/devices is that they are not always assigned the same device number on each boot. This can result in an undesirable change in the default ALSA sound device. In order to remedy this problem we can explicitly assign the default device numbers of our sound card drivers by adding lines at the end of the /etc/modprode.d/alsa-base file like this (These are mine):
    Code:
    options snd_hda_intel index=0
    options snd_cmipci index=1
    options snd_atiixp index=2
    options snd_usb_audio index=3
    This way each device will always be numbered the same.

    You can use:
    Code:
    cat /proc/asound/modules
    to discover your sound device driver module names and their order. The code is the the driver names, not the sound card names so be sure to use the driver names or you will get errors when ALSA starts up. You can change the order around as you desire. There is more on assigning cards here

    http://alsa.opensrc.org/index.php/MultipleCards

    For multiple usb devices

    http://alsa.opensrc.org/index.php/Mu...SBAudioDevices

    Changing Your Default Sound Card
    The biggest problem with multiple sound cards seems to be that many people do not know how to direct their applications to use one or the other.
    If you are using just ALSA the easiest way to choose between multiple sound cards is to get:

    asoundconf-gtk

    This little application can be found in System/Preferences as Default Sound Card. Open it and choose your default sound card. All your applications going through ALSA will now use this card. But, to use your other sound card, you must change the default again and this will effect all your applications and they must be restarted for the changes to take place.

    If you are using PulseAudio, you can choose pulseaudio in Default Sound Card and use the PulseAudio Volume Control to direct your application to whichever sound card you want to use while they are playing and without restarting them.

    Using Multiple Sound Cards with PulseAudio
    If you still have bad feelings about PulseAudio, it is due more to an incomplete implementation in the default Ubuntu installation than the Pulse Audio program itself or its developers. If you would like to get PulseAudio working properly and have all your applications use it so you can use more than one sound card more effectively, you can follow my guides here:

    http://ubuntuforums.org/showthread.php?t=997506

    If you need more extensive help you can go here

    http://ubuntuforums.org/showthread.php?t=843012

    If you do not have your sound set up so all your applications play through PulseAudio and have applications that bypass PulseAudio or are using OSS4, then the following will not necessarily give you positive results. If you are using jackd, there is some information in the second guide above that may also be helpful to understanding this issue.

    PulseAudio will automatically detect and make available any sound card which ALSA can find and has a driver for. Unfortunately, PulseAudio is currently unable to detect secondary audio devices that ALSA does not detect as Device 0. This includes digital outputs, secondary dacs, and sound devices incorporated into some newer video cards. These can still be controlled from the ALSA mixers but PulseAudio is unable to detect and use them at this time. This has been fixed in Pulseaudio 0.0.15 which is unfortunately not available for Ubuntu users yet. But there is a way to add support in Pulseaudio for these devices manually. Directions for doing so are here

    http://ubuntuforums.org/showthread.php?t=776958

    Controlling Playback and Devices with Multiple Sound Cards
    The PulseAudio Volume Control will list all the the devices it can detect in the Output Devices tab. It will also list all applications that are currently using the Pulse Audio sound server in the Playback window. You can right click on any application in that window and choose Move Stream to move it to another device. It is that simple. You can also control the volume of both individual playback streams and the output devices by moving the sliders. You can select any listed output device as the default by right clicking on it.

    Another way to control the volume of any device you are using is to select it with the Volume Control applet on your panel. You can use your mixer directly or you can select the mixer in the Volume Control by right clicking and choosing Open Volume Control/File/Change Device. This will allow you to choose and control any hardware or virtual device. To use your multimedia keys for control you need to select the device in System/Preferences/Sound/Default Mixer Tracks.

    Simultaneous Output

    In the PA Device Chooser/Configure Local Sound Server/Simultaneous Output there is a check box for Simultaneous Output to all local sound cards. If you select it this will add a new Output Device in the PA Volume Control listings
    Simultaneous output to ALSA PCM.......(all your sound hardware devices).......
    You can select this device in the PA Volume Control just like any other and it will direct streams to all your sound devices simultaneously so you can have sound in your speakers and usb headset etc at the same time.

    Combining Sound Cards
    PulseAudio also has provisions for making and using more versatile virtual devices like module-combine and module-oss-mmap.To use these, we must edit the etc/pulse/default.pa file to call the modules.

    This is how you can manually create a virtual device that will allow you to output to two sound cards at the same time using module-oss-mmap and module-combine:

    Open etc/pulse/default.pa in an editor as sudo.

    Code:
    sudo gedit /etc/pulse/default.pa
    At the end of the file, add these lines
    Code:
    load-module module-oss-mmap device="/dev/dsp" sink_name=output0
    load-module module-oss-mmap device="/dev/dsp1" sink_name=output1
    load-module module-combine sink_name=combined master=output0 slaves=output1
    set-sink-default combined
    You can have more than one slave sink attached to the combined sink, and hence combine any number of sound cards.

    Using Multiple Sound Cards for Surround Sound
    You can also use multiple sound cards for surround sound by combining them and remapping the outputs.

    Code:
        load-module module-oss-mmap device="/dev/dsp" sink_name=output0 channel_map=left,right channels=2
        load-module module-oss-mmap device="/dev/dsp1" sink_name=output1 channel_map=rear-left,rear-right channels=2
        load-module module-combine sink_name=combined master=output0 slaves=output1 channel_map=left,right,rear-left,rear-right channels=4
    The channel mappings for the sinks must be explicit to make sure everything is routed correctly. Once again, you can use any number of cards as slaves, explicitly mapping their outputs. module-oss-mmap can also be used to remap the outputs of a single sound card.


    If you have any questions or problems or additions or comments, please feel free to post here.

    Best Regards,

    Mark

    EDIT: 02/22/09 Major edit
    Last edited by markbuntu; February 27th, 2009 at 07:23 PM.

  2. #2
    Join Date
    Dec 2007
    Beans
    500

    Re: Multiple Sound Cards

    Every once in a while(about weekly, sometimes two or three times a week), I boot into silence and have to change the sound configuration to get it working again. I have onboard sound - HDA Intel, and an SB Audigy(ca0106) and sometimes switching 'Sound Preferences => 'Default Mixer Tracks' from HDA to ca0106 fixes it, sometimes switching 'Multimedia Systems Selector' => 'Default Output'from ALSA to Autodetect, sometimes to ESD or OSS.

    Any idea what might be causing the loss of sound?


    64 bit Ubuntu Hardy
    Last edited by stoneage; September 27th, 2008 at 06:25 AM. Reason: Adding information

  3. #3
    Join Date
    Apr 2008
    Beans
    4,377
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: Multiple Sound Cards

    The most likely reason is that your computer is assigning different irqs to your sound card sometimes when it boots up. If you follow the part above labeled Assigning Default Devices you can avoid that problem by specifically setting the device numbers of your card so they are consistent over reboots.

  4. #4
    Join Date
    Dec 2007
    Beans
    500

    Re: Multiple Sound Cards

    Thanks for the information, I hope it is that simple, it has been going on for over a year.

    aplay -l gives me:-

    Code:
    card 0: CA0106 [CA0106], device 0: ca0106 [CA0106]
      Subdevices: 0/1
      Subdevice #0: subdevice #0
    card 0: CA0106 [CA0106], device 1: ca0106 [CA0106]
      Subdevices: 0/1
      Subdevice #0: subdevice #0
    card 0: CA0106 [CA0106], device 2: ca0106 [CA0106]
      Subdevices: 0/1
      Subdevice #0: subdevice #0
    card 0: CA0106 [CA0106], device 3: ca0106 [CA0106]
      Subdevices: 1/1
      Subdevice #0: subdevice #0
    card 1: Intel [HDA Intel], device 0: ALC883 Analog [ALC883 Analog]
      Subdevices: 0/1
      Subdevice #0: subdevice #0
    card 1: Intel [HDA Intel], device 1: ALC883 Digital [ALC883 Digital]
      Subdevices: 1/1
      Subdevice #0: subdevice #0
    So if I add:-

    Code:
    options snd_ca0106 index=0
    options snd_ca0106 index=1
    options snd_ca0106 index=2
    options snd_ca0106 index=3
    options snd_hda_intel index=4
    options snd_hda_intel index=5
    to alsa-base, would that be right?

  5. #5
    Join Date
    Apr 2008
    Beans
    4,377
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: Multiple Sound Cards

    No, you should just have to list each card once.

    options snd_ca0106 index=0
    options snd_intel index=1

  6. #6
    Join Date
    Apr 2008
    Beans
    4,377
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: Multiple Sound Cards

    I made a serious error in the OP. You need to use

    Code:
    cat /proc/asound/modules
    to determine how to edit etc/modprobe.d/alsa-base

    I am so sorry for anyone I have misled. Anyway, it is fixed.

  7. #7
    Join Date
    Dec 2007
    Beans
    500

    Re: Multiple Sound Cards

    cat /proc/asound/modules lists:-

    organic@organic-desktop:~$ cat /proc/asound/modules
    0 snd_ca0106
    1 snd_hda_intel


    Is there anything else it could be? It has been a problem since installing Gutsy then continued after updating to Hardy, so I'm considering a clean install for Intrepid but would rather know what the problem is.

    Thanks for your assistance.

    EDIT - Whoops; sorry, I misread that. I have added
    options snd_ca0106 index=0
    options snd_intel index=1

    to /etc/modprobe.d/alsa-base and will post back in a few days to update if it solves it. Thanks again.
    Last edited by stoneage; September 28th, 2008 at 05:24 PM.

  8. #8
    Join Date
    Aug 2008
    Beans
    38
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: Multiple Sound Cards

    Markbuntu, I followed your suggestion that I come here from
    http://ubuntuforums.org/showthread.p...60#post5877560
    And I am at least marginally in over my head here.

    To save time for those who wonder what this is about, My sound system went dead apparantly when I got gnome-ppp installed and a few other things that got my usb modem working on my new laptop.

    I did try using the cat command in an attempt to clairify my situation and turned up the following responses.

    First, In terminal mode I tried what is between the ####'s:
    ##############
    user1@dell-desktop:~$ cat /proc/asound/modules
    0 snd_hda_intel
    user1@dell-desktop:~$
    ##############

    Second, in terminal mode I tried what is between the XXXXX's:
    XXXXXXXXXXXXXXX
    user1@dell-desktop:~$ cat /etc/modprobe.d/alsa-base
    # autoloader aliases
    install sound-slot-0 /sbin/modprobe snd-card-0
    install sound-slot-1 /sbin/modprobe snd-card-1
    install sound-slot-2 /sbin/modprobe snd-card-2
    install sound-slot-3 /sbin/modprobe snd-card-3
    install sound-slot-4 /sbin/modprobe snd-card-4
    install sound-slot-5 /sbin/modprobe snd-card-5
    install sound-slot-6 /sbin/modprobe snd-card-6
    install sound-slot-7 /sbin/modprobe snd-card-7

    # Cause optional modules to be loaded above generic modules
    install snd /sbin/modprobe --ignore-install snd && { /sbin/modprobe --quiet snd-ioctl32 ; : ; }
    install snd-pcm /sbin/modprobe --ignore-install snd-pcm && { /sbin/modprobe --quiet snd-pcm-oss ; : ; }
    install snd-mixer /sbin/modprobe --ignore-install snd-mixer && { /sbin/modprobe --quiet snd-mixer-oss ; : ; }
    install snd-seq /sbin/modprobe --ignore-install snd-seq && { /sbin/modprobe --quiet snd-seq-midi ; /sbin/modprobe --quiet snd-seq-oss ; : ; }
    install snd-rawmidi /sbin/modprobe --ignore-install snd-rawmidi && { /sbin/modprobe --quiet snd-seq-midi ; : ; }
    # Cause optional modules to be loaded above sound card driver modules
    install snd-emu10k1 /sbin/modprobe --ignore-install snd-emu10k1 $CMDLINE_OPTS && { /sbin/modprobe -Qb snd-emu10k1-synth ; }
    install snd-via82xx /sbin/modprobe --ignore-install snd-via82xx $CMDLINE_OPTS && { /sbin/modprobe -Qb snd-seq ; }

    # Load saa7134-alsa instead of saa7134 (which gets dragged in by it anyway)
    install saa7134 /sbin/modprobe --ignore-install saa7134 $CMDLINE_OPTS && { /sbin/modprobe -Qb saa7134-alsa ; : ; }

    # Load snd-seq for devices that don't have hardware midi;
    # Ubuntu #26283, #43682, #56005; works around Ubuntu #34831 for
    # non-Creative Labs PCI hardware
    install snd /sbin/modprobe --ignore-install snd && { /sbin/modprobe -Qb snd-seq ; }
    # Prevent abnormal drivers from grabbing index 0
    options bt87x index=-2
    options cx88_alsa index=-2
    options saa7134-alsa index=-2
    options snd-atiixp-modem index=-2
    options snd-intel8x0m index=-2
    options snd-via82xx-modem index=-2
    options snd-usb-audio index=-2
    options snd-usb-usx2y index=-2
    options snd-usb-caiaq index=-2
    # Ubuntu #62691, enable MPU for snd-cmipci
    options snd-cmipci mpu_port=0x330 fm_port=0x388
    user1@dell-desktop:~$

    XXXXXXXXXXXXXXX

    I see some indication in the last stuff above about modem and usb ports, but I don't really grasp the significance. I specifically note the modem and usb entries because my modem is a usb modem since Dell did not see fit to build in a modem on the Studio laptop 1535 they sold me.

    Can anyone here see what I should do next.

  9. #9
    Join Date
    Apr 2008
    Beans
    4,377
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: Multiple Sound Cards

    I don,t have more than a minute here but the 0 before snd_hda)intel indicates the module has been disabled, maybe by ppp.
    Look in

    /etc/modprode.d/alsa-base

    and remove the 0 from in front of the snd_had_intel if you can find it. I will be back after work and give you a hand if no one else can.

  10. #10
    Join Date
    Aug 2008
    Beans
    38
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: Multiple Sound Cards

    Quote Originally Posted by markbuntu View Post
    ... the 0 before snd_hda)intel indicates the module has been disabled, maybe by ppp.
    Look in

    /etc/modprode.d/alsa-base

    and remove the 0 from in front of the snd_had_intel if you can find it. ...
    I did a search of /etc/modprobe.d/alsa-base using gedit. no phrase containing "had" can be found, let alone "snd_had_intel"

Page 1 of 8 123 ... LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •