Aug 14, 2012

Ubuntu no sound fix for USB audio

Update 14/08/2012 - please see Edit2 below for a solution. 

Ubuntu 11.10 seems to be quite a step back in terms of usability. Things which worked in 10 are broken now. One of the things that was driving me crazy was the audio was not working sometimes.

My system uses a USB audio system (Bose Companion 5). I believe this issue is there on other systems using USB audio also.

When I used to boot, the system would come up but there was no audio. The audio would start once I would slide the volume slider down and up. But if I start VLC video player, the sound would go away all together and the only way it would work was to reboot the system. This was nuts.

After a lot of searching, i finally got the solution from Ubuntu Forums . Here's the relevant part of the solution.It involves un-installing and re-installing the audio systems.

Open a terminal and enter the following:
sudo apt-get remove --purge alsa-base
sudo apt-get remove --purge pulseaudio
sudo apt-get clean && sudo apt-get autoremove
sudo apt-get install alsa-base
sudo apt-get install pulseaudio


For some reason while removing alsa-base it removes the ubuntu-desktop. So you need to install it again.
sudo apt-get install ubuntu-desktop

Now reboot your system. Once it comes up you will see that the audio icon on the top bar is no longer there. But now all sound should be working without fiddling around.

Drop me a comment if you had this problem and this change worked for you.

Edit: Seems there is still some reboot issue as pointed out by Albin in the comments below. Once you reboot - you will need to go to Settings -> Sound and slide the volume indicator up and down to get the sound. :(

Edit 2 : 14/Aug/2012

I entered a bug for this as I got frustrated. And then after googling extensively I finally got a solution of setting usb audio as primary sound device and it seems to work.

Essentially you need to do the following steps :


1. Edit the file /etc/modprobe.d/alsa-base.conf . Since this is a system file you will need to sudo to get this done. e.g. 
$sudo vim /etc/modprobe.d/alsa-base.conf
2. Scroll down to the end. Now you have to change the line which says 
options snd-usb-audio index=-2
to 
options snd-usb-audio index=-1
Reboot and it should work. 

11 comments:

  1. I had the same problem as you and tried your solution. Unfortunately, after doing all steps above and rebooting, I was still forced to adjust the volume down and up before getting any sound.

    After looking at what's beeing installed at the last step (ubuntu-desktop) I saw a interesting package called pulseaudio-module-gconf.

    After
    sudo apt-get remove pulseaudio-module-gconf
    and rebooting the sound works without fiddling for me.

    For the record I'm using the following setup:
    Ubuntu 11.10 x64 (Linux albin-desktop 3.0.0-16-generic #29-Ubuntu SMP Tue Feb 14 12:48:51 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux)
    and GNOME Shell 3.2.2.1. And the Bose Companion 5.

    Thanks a lot for you instruction! Wouldn't solved it without it.

    //Albin

    ReplyDelete
    Replies
    1. I too am getting that fiddling around with the volume sometimes. Let me try your suggested solution and update here...

      Delete
    2. Sorry, now realized my fix did not work at all!
      Must have been a lucky reboot the first time because i did not have to adjust the volume that single time :( After a couple of more reboots it now does not seem to work without adjusting the volume. Really annoying!
      Sorry for fooling you.

      Delete
    3. Yes. I confirm this issue. I have updated the post with the problem. Lets see if we can find a solution.

      Delete
  2. Yeah. This is really annoying. I never had this problem with Ubuntu 10. I think its something to do with Unity.

    ReplyDelete
  3. I think it's pulseaudio. I followed these instructions: https://bugs.launchpad.net/ubuntu/+source/linux-ubuntu-modules-2.6.22/+bug/201518/comments/8

    For me the breakage was recent, on all my laptops running 11.10 64bit.

    ReplyDelete
  4. Seems like the latest update has fixed the problem. I dont know exactly which update, but nowdays I do not have to fiddle with the volume slider.

    ReplyDelete
  5. the problem seems to have resurfaced after upgrading to Ubuntu 12.04 :(

    ReplyDelete
  6. Thanks for the article. Really helpful!
    Just one thing though.. I had to change to
    options snd-usb-audio index=-2 to 0 instead of -1
    for it to work.
    Also I added options snd-hda-intel model=auto index=1 so that it's the next prefered device

    ReplyDelete
  7. Thanks Vibhu and Anestis. I tried all of the suggestions.

    I am using 12.04 and I can see the Bose Companion 5 in the PulseAudioControl app. I can see the volumes going up and down when a song is playing. But nothing is play. I have tried about of the -1, -2, 0 suggestions in the /etc/modprobe.d/alsa-base.conf file. No luck :o(

    ReplyDelete
  8. I get the problem on and off. I still havent gotten a good and reliable solution, and there is a bit of hit and trial involved. Here are a few things I try:

    1. keep the bose system on when booting up. I suspect that since there is no voltage in the USB, maybe ubuntu does not detect it is connected?
    2. as soon as Ubuntu boots up, log in and start the music application. I use Audacious nowadays.
    3. If there is no sound still, use the volume dropdown and wiggle the volume bar a bit.
    4. use the 'sound setting' to see if the default audio device is Bose.

    I know, it is quite frustrating. I am just not getting a reliable solution here, and my skills with audio and usb programming is not that great that I can propose a fix to the Ubuntu sound code base.

    ReplyDelete