Announcement

Collapse
No announcement yet.

Changing default ALSA soundcard in Karmic, now with asoundconf gone

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

    Changing default ALSA soundcard in Karmic, now with asoundconf gone

    It appears asoundconf was removed from alsa-base in Karmic "in anticipation of the new GNOME volume control + pulse being more useful, allowing users to more easily control which sound card is used." While I'm not sure I agree with the decision to remove a terminal script controlling ALSA directly in favor of a new GNOME/Pulse solution, I worked around the issue by extracting asoundconf from the Jaunty package. Regardless;

    Is there any chance of Kubuntu also getting a similar GUI way of manging the default ALSA device? System Settings -> Multimedia is all good and well for Phonon/xine apps, but doesn't help Firefox, Flash ...speaker-test. Perhaps just something as easy as right-clicking Kmix and, above "Select Default Mixer", "Select Default Device"? That would require adding a "Default ALSA card" device to Device Preference in System Settings -> Multimedia to allow Phonon apps to also honor such a change, if told to.

    edit: grammar
    KDE, I heart thee.

    #2
    Re: Changing default ALSA soundcard in Karmic, now with asoundconf gone

    I don't run Karmic, and perhaps I missed something, but doesn't asoundconf work anymore?
    Take the name of the card you want from the output of this:
    Code:
    asoundconf list
    and place it in this:
    Code:
    asoundconf set-default-card name

    Comment


      #3
      Re: Changing default ALSA soundcard in Karmic, now with asoundconf gone

      Nevermind!!! I just realized what I said. /blush
      That is indeed unbelievable that they would take out such basic functionality. I guess I didn't actually think that what you said could possibly be true.

      Comment


        #4
        Re: Changing default ALSA soundcard in Karmic, now with asoundconf gone

        Hi,

        Code:
        apt-cache search asoundconf
        asoundconf-gtk - Applet to select the default ALSA sound card
        Does this package install and resolve your problem?

        Distributor ID: Ubuntu
        Description: Ubuntu Trusty Tahr (development branch)
        Release: 14.04
        Codename: trusty

        Comment


          #5
          Re: Changing default ALSA soundcard in Karmic, now with asoundconf gone

          asoundconf-gtk is just a frontend for the asoundconf script.

          Code:
          $ asoundconf-gtk
          sh: /usr/bin/asoundconf: not found
          You need to make sure asoundconf is active!
          By default, asoundconf's configuration file is ~/.asoundrc.asoundconf
          and must be included in ~/.asoundrc. Open this file to make sure it is!
          If I extract asoundconf and put it there, it starts. It's still the same workaround as before, though.

          I found this.

          I've decided that the best course of action looks to be that asoundconf-gtk is removed from Karmic, and I prepare a package for Debian, source name `asoundconf` that includes the original asoundconf script, and asoundconf-ui[1]. This would supersede asoundconf-gtk, producing binaries for gtk (asoundconf-gtk) and qt (asoundconf-qt). asoundconf-ui currently provides infrastructure for qt3, but I'm not sure whether to include that. Jordi Mallach doesn't think this is too bad an idea, but I've subscribed the ubuntu-audio team to get their opinion. Hopefully the Debian package should be published before FeatureFreeze, and that can just be simply synced over.

          [1] https://code.launchpad.net/asoundconf-ui
          KDE, I heart thee.

          Comment


            #6
            Re: Changing default ALSA soundcard in Karmic, now with asoundconf gone

            I finally found a way to do this.

            http://forum.vectorlinux.com/index.php?topic=4888.0

            Instructions need to be modified a bit for karmic.

            Where it says to add a line to /etc/modprobe.d/sound, you need to add that line to /etc/modprobe.d/alsa-base.conf

            so my /proc/asound/modules looked like this:

            Code:
             0 snd_ctxfi
             1 snd_hda_intel
            To make the hda_intel (onboard card) default, I added this line just before the '# Prevent abnormal drivers from grabbing index 0' line in /etc/modprobe.d/alsa-base.conf

            Code:
            options snd_ctxfi index=1
            And reboot.
            Bingo! Alsa now works right; it plays through the internal sound card.






            We only have to look at ourselves to see how intelligent life might develop into something we wouldn't want to meet. -- Stephen Hawking

            Comment


              #7
              Re: Changing default ALSA soundcard in Karmic, now with asoundconf gone

              That does not do it completely for me:

              I have two sound cards. One built-in into the system and another one which is a USB card. After a clean install of Karmic, the system picks the built-in as card "0" and the USB card as "1". I wanted to swap them hoping to fix he fact that I can't get any sounds coming out out flash videos played on Firefox.

              Once I set the index to "1" for the built-in and after reboot, a cat to /proc/asound/modules only shows one card (the USB card) but the built-in is gone *and* the USB card remains "1"...

              At least the greeting sound when I login/logout now works fine and goes through the USB card but Firefox is still not able to produce sounds.

              Any advice on how to move from here would appreciated...

              Code:
              $ cat /proc/asound/modules
               1 snd_usb_audio
              Code:
              $ cat /etc/modprobe.d/alsa-base.conf
              # 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 $CMDLINE_OPTS && { /sbin/modprobe --quiet --use-blacklist snd-ioctl32 ; /sbin/modprobe --quiet --use-blacklist snd-seq ; }
              #
              # Workaround at bug #499695 (reverted in Ubuntu see LP #319505)
              install snd-pcm /sbin/modprobe --ignore-install snd-pcm $CMDLINE_OPTS && { /sbin/modprobe --quiet --use-blacklist snd-pcm-oss ; : ; }
              install snd-mixer /sbin/modprobe --ignore-install snd-mixer $CMDLINE_OPTS && { /sbin/modprobe --quiet --use-blacklist snd-mixer-oss ; : ; }
              install snd-seq /sbin/modprobe --ignore-install snd-seq $CMDLINE_OPTS && { /sbin/modprobe --quiet --use-blacklist snd-seq-midi ; /sbin/modprobe --quiet --use-blacklist snd-seq-oss ; : ; }
              #
              install snd-rawmidi /sbin/modprobe --ignore-install snd-rawmidi $CMDLINE_OPTS && { /sbin/modprobe --quiet --use-blacklist 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 --quiet --use-blacklist snd-emu10k1-synth ; }
              install snd-via82xx /sbin/modprobe --ignore-install snd-via82xx $CMDLINE_OPTS && { /sbin/modprobe --quiet --use-blacklist 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 --quiet --use-blacklist saa7134-alsa ; : ; }
              # Prevent abnormal drivers from grabbing index 0
              options snd_hda_intel index=1
              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-us122l 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
              # Keep snd-pcsp from being loaded as first soundcard
              options snd-pcsp index=-2
              # Power down HDA controllers after 10 idle seconds
              options snd-hda-intel power_save=10 power_save_controller=N

              Comment


                #8
                Re: Changing default ALSA soundcard in Karmic, now with asoundconf gone

                Right, you can't use this method for a USB card. The reason is the system is going to detect the builtin as the default card during bootup, or else it will act as though there is no sound card. You need to set your /etc/modprobe.d/alsa-base.conf back the way it was, and then proceed differently.

                The rough outline is:
                Boot your system with the internal card as default.
                Plug in your usb device.
                In SystemSettings > Multimedia, move the listings for the USB device to the top (if you want it as the default device).
                Start pavucontrol. In the configuration tab, make usr your usb device is turned on, and set for the features you want (analog stereo, ior whatever your device is).
                Start playing something with alsaplayer, amarok, or whatever. Check the pavucontrol Output Devices tab and make sure your device is listed, that it is not muted, and that it has some volume. The volume indicator for the device should be jumping around with the sound.
                Check KMix, make sure the tab for your device has the pcm channel, and that it is turned up.
                (It sounds like, from your post, that up to here it's pretty much working right)
                Now you need to open the Playback tab in pavucontrol, and see where pulseaudio is sending the sound. There will be a separate entry for each playback program, and flashplayer will be a different playback listing from alsaplayer. So you need to shut down alsaplayer, open firefox and start a youtube video. An entry for the flash player should appear in Playback, and you need to set that to send the audio to your usb device.

                That's the general plan for getting stuff to work with pulseaudio. See if this gets you anywhere. The main thing is to make sure that flash is showing up in the Playback tab in pavucontrol.
                We only have to look at ourselves to see how intelligent life might develop into something we wouldn't want to meet. -- Stephen Hawking

                Comment


                  #9
                  Re: Changing default ALSA soundcard in Karmic, now with asoundconf gone

                  I reverted my sound card config (internal=0 usb=1) and installed pulseaudio and pavucontrol (which apparently don't come with Kubuntu). After some fiddling with pavucontrol, kmix and SystemSettings->Multimedia (making pulseaudio the "preferred") I end up having sound working through the usb sound card when I used Amarok *and* Flash Videos in Firefox. Finally!!!

                  Thanks!

                  Comment


                    #10
                    Re: Changing default ALSA soundcard in Karmic, now with asoundconf gone

                    Originally posted by doctordruidphd
                    I finally found a way to do this.

                    http://forum.vectorlinux.com/index.php?topic=4888.0

                    . . .

                    Bingo! Alsa now works right; it plays through the internal sound card.
                    Thank you, doctordruidphd. This worked perfectly for me. One simple line of code saved so much work, and it works universally for all users!

                    I found this page after trying to manually configure sound devices for all programs, and being frustratingly unsuccessful in Firefox. It shouldn't be this hard to play flash videos in Kubuntu 9.10!

                    Comment


                      #11
                      Re: Changing default ALSA soundcard in Karmic, now with asoundconf gone

                      Originally posted by Zorael
                      Is there any chance of Kubuntu also getting a similar GUI way of manging the default ALSA device?
                      Not a GUI-method, but I just found a way to change the default ALSA sound card on Kubuntu 9.10 without installing any additional packages or changing the ALSA module load order. This works for USB cards, multiple cards using the same module etc. (I have a USB webcam w/ mic and a USB headset and want the headset to be default. Both use the snd_usb_audio module so it is difficult to get this right by changing module load order.)
                      • List ALSA cards (cat /proc/asound/cards)
                      • Determine the name (part within brackets) of the one you want as default. Use the name instead of card number to not be dependent on module load order.
                      • Edit ALSA global configuration (eg: sudo vi /etc/asound.conf)


                      Example asound.conf for a USB headset named "Headset" in the ALSA device list:
                      Code:
                      pcm.!default {
                        type hw
                        card Headset
                      }
                      ctl.!default {
                        type hw
                        card Headset
                      }
                      On a multi-user box the default card can be overridden on a per-user basis in ~/.asoundrc

                      Test the setup by eg. starting alsamixer and check that the mixer for the selected card appears as default.

                      Source: ALSA FAQ026

                      Comment


                        #12
                        Re: Changing default ALSA soundcard in Karmic, now with asoundconf gone

                        Thanks, doctordruidphd!

                        I have been looking for this for the better part of the day. Your rough outline for a USB soundcard did the trick!

                        Apparently searching on "kubuntu switch sound cards" isn't the right way to search, because it took me ages to find this solution...

                        Comment

                        Working...
                        X