Page 1 of 9 123 ... LastLast
Results 1 to 10 of 82

Thread: Howto: about sound in Hoary & Linux

  1. #1
    Join Date
    Jan 2005
    Location
    paris, france
    Beans
    124
    Distro
    Ubuntu 7.04 Feisty Fawn

    Howto: about sound in Hoary & Linux

    Foreword

    The following howto has been posted by ploum on the French Ubuntu forums.

    I have been answering sound questions "many" times on the Ubuntu forum, after having myself asked why sound did not work any more after upgrading from Warty to Hoary.
    I have found this howto interesting, and thought it might also be interesting for everyone here, that's why I translated and adapted it. Please forgive any translation that sounds "Frenchy" ! This howto is partly redundant with other threads related to sound issues, such as for example http://www.ubuntuforums.org/showthread.php?t=8882.
    However, it is original in the sense that it also describes sound features in Linux in general.

    Introduction

    Many questions are related to sound. In many cases, there is no hardware problem, but simply a lack of understanding how the system works.
    Here are some technical explanations. It's a bit complicated, so if you really do not get the point, please go straight to the next topic.

    Technical Explanations

    OSS: Open Sound System
    The Linux kernel is sending the sound to the sound card, by using the appropriate sound driver. A long time ago, the system which allowed to do that was OSS. Many drivers have been developed for OSS. Applications thus use the OSS interface to send sound to the driver.

    ALSA: Advanced Linux Sound Architecture
    OSS is not technically perfect, so a better system has been developed, namely ALSA. As a consequence, programs making use of sound have to be rewritten in order to be able to use ALSA instead of OSS. That's why, for example, xmms has an OSS plugin and an ALSA plugin. (The output plugin can be chosen in xmms, in options -> preferences).
    Nevertheless, for older applications to go on working, a compatibility layer exists in ALSA. It ensures OSS applications believe they do use OSS while they actually use ALSA (as for example the flash plugin).

    ESD: Enlightened Sound Daemon
    In theory, only one sound can be played, since there is only one loud speaker. In order to play many sounds, one uses a sound mixer. That's the role of ESD. Applications send their sounds to ESD, the latter mixes these sounds, sends the result to OSS, which transmits it to ALSA.

    In case you have a problem, read this before you post on the forum

    One must be aware that only one application can use the sound card. In the default configuration, ESD (which is itself an application) is launched on startup and has access to the sound card.
    In most cases, you cannot get sound simply because ESD blocks the access to the sound card.

    The first thing to do is thus to kill ESD (use the command: killall esd), and then to have a look at what applications use the sound card:
    Code:
    lsof /dev/dsp
    tells you which programs use OSS
    Code:
    lsof /dev/snd/*
    tells you which program use ALSA

    Before you post, please check that all this is empty, and tell it in your post.

    Howto properly configure the sound

    A good thing to do is to tell ESD not to run when one does not need it. Do (assuming gedit is your prefered editor):
    Code:
    sudo gedit /etc/esound/esd.conf
    and edit it so that it looks like
    Code:
    [esd]
    auto_spawn=1
    spawn_options=-terminate -nobeeps -as 2 -d default
    spawn_wait_ms=100
    # default options are used in spawned and non-spawned mode
    default_options=
    Restart your session, and normally you should not have problems with games such as frozen-bubble. You just have to stop the music two seconds before you start the game.

    You still have some problems !

    Please follow these steps:

    1) Check your loud speakers, if they are properly plugged in, etc...

    2) Check the sound volume ! In alsamixer, MASTER, PCM must be at some high value value, and without MM above or under.

    3) If the music seems to play properly but you hear nothing, check the above two points. If Linux does not detect the sound card, it NEVER plays any sound ! and LWAYS gives an error ! Check that your computer does not have two sound cards, and plug your loud speakers on the other one (using a particular sound card is another problem).

    4) If you get an error message of the type: "Not found or busy", check with "lsof" (see above)

    5) In any other desperate situation, post on the forum and give:
    - the precise error type
    - the precise model of your sound card
    - the result of "lsmod|grep snd"

    Howto go further: listening many sounds at the same time, without ESD !

    Now it becomes more technical and so also facultative. But it can be of interest for more than one person.
    !!! BE CAREFUL !!! You should try the following only if you already managed to get proper ALSA sound (for example xmms manages to play with the ALSA plugin).
    It is not clear that the following will work for any sound card.

    The first thing to be done is to tell ESD to use ALSA instead of OSS:

    Code:
    sudo apt-get install libesd-alsa0
    One now creates the asound file:
    Code:
    sudo gedit /etc/asound.conf
    which should look like
    Code:
    pcm.card0 {
    type hw
    card 0
    }
    
    pcm.!default {
    type plug
    slave.pcm "dmixer"
    
    }
    
    
    pcm.dmixer {
    type dmix
    ipc_key 1025
    slave {
    pcm "hw:0,0"
    period_time 0
    period_size 1024
    buffer_size 4096
    periods 128
    rate 44100
    }
    bindings {
    0 0
    1 1
    }
    }
    Then one restarts ALSA:
    Code:
    sudo /etc/init.d/alsa restart
    Restart your session (that's for ESD), and there you are, you should in principle be able to hear all the "click click" of the interface, to listen to music with xmms, and to play a video with totem, everything at the same time (applications must use ESD or ALSA, ALSA being a better choice).

    The only dark point: OSS applications can still only have access to the sound card one after the other, which is the case of the flash plugin. Thus it is necessary to switch off all sound before launching a flash animation. Sometimes one even has to restart the navigator.

    If someone knows a trick to make flash use ALSA or ESD, please tell us ! About this, you can go and see the post by wrochal in this thread

    For people having two sound cards: You should have a look at the posts by MonoLT in this thread, and at his thread called 'HOWTO Set sound if you have 2 soundcards', http://www.ubuntuforums.org/showthread.php?t=27186
    Last edited by dusu; April 15th, 2005 at 12:14 PM. Reason: updating the howto, including links to other posts and threads
    When I apt-get something, I feel I'm good...
    with a single o

  2. #2
    Join Date
    Jan 2005
    Location
    Laurel, MD
    Beans
    40
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: Howto: about sound in Hoary & Linux

    Thanks for the guide. I now have delay free video and audio. (With the default Ubuntu sound settings I was getting a couple second delay with all sounds.)

    Although not a desperate situation, a few other problems present themselves after taking the steps you described.

    • Some games still have no sound (an example would be Frozen Bubble)
    • The volume applet (as well as the multimedia keyboard buttons) no longer work to control the sound volume. Is there a way to change these so they control the ALSA mixer main volume?


    Thanks for the help

    By the way, my sound card is unknown in my Dell Inspiron 8600 laptop, but I assume it's built in to the Intel 82801 motherboard.

    Here is the lsmod|grep snd output.
    Code:
    snd_intel8x0           32352  0
    snd_ac97_codec         74144  1 snd_intel8x0
    snd_pcm_oss            52132  0
    snd_mixer_oss          19680  1 snd_pcm_oss
    snd_pcm                94696  3 snd_intel8x0,snd_ac97_codec,snd_pcm_oss
    snd_timer              25060  1 snd_pcm
    snd                    55012  6 snd_intel8x0,snd_ac97_codec,snd_pcm_oss,snd_mixer_oss,snd_pcm,snd_timer
    soundcore              10016  1 snd
    snd_page_alloc          9732  2 snd_intel8x0,snd_pcm

  3. #3
    Join Date
    Dec 2004
    Location
    Belgium
    Beans
    115
    Distro
    Dapper Drake Testing/

    Re: Howto: about sound in Hoary & Linux

    Quote Originally Posted by ChamPro
    • Some games still have no sound (an example would be Frozen Bubble)
    • Those games use OSS. I don't know why, but it seems that you don't have OSS.

      Quote Originally Posted by ChamPro
    • The volume applet (as well as the multimedia keyboard buttons) no longer work to control the sound volume. Is there a way to change these so they control the ALSA mixer main volume?
  4. Quote Originally Posted by ChamPro
    Right Click > Preferences on the volume applet.

    Select the ALSA mixer in the dropdown menu.
Advanced reply Adv Reply  

  • #4
    Join Date
    Nov 2004
    Beans
    107

    Re: Howto: about sound in Hoary & Linux

    Great guide!

    I've always wondered about all the differences but mostly got the gist of it, this helps clear things up finally.

    How long has it been the main sound system (I'm thinking it was new in 2.6?)? What are the advantages? Why do things like Doom 3 still use OSS if ALSA is so much better? Why doesn't Hoary use ALSA (probably same reason)?

    Sorry so many questions but I've honestly never fully understood sound on Linux.

  • #5
    Join Date
    Apr 2005
    Location
    São Paulo - Brazil
    Beans
    3

    Thumbs up Re: Howto: about sound in Hoary & Linux

    Dear,

    Solution for Sound in Flash, create link

    sudo ln -s /usr/lib/libesd.so.0 /usr/lib/libesd.so.1

    Bye,

  • #6
    Join Date
    Dec 2004
    Location
    Belgium
    Beans
    115
    Distro
    Dapper Drake Testing/

    Re: Howto: about sound in Hoary & Linux

    Quote Originally Posted by wrochal
    Dear,

    Solution for Sound in Flash, create link

    sudo ln -s /usr/lib/libesd.so.0 /usr/lib/libesd.so.1

    Bye,
    Doesn't work for me

    Could you explain a bit more why it would work ?

  • #7
    Join Date
    Mar 2005
    Beans
    219

    Re: Howto: about sound in Hoary & Linux

    Worked for me.. I now have sound in Flash!

    Thanks,

    Art

  • #8
    Join Date
    Apr 2005
    Location
    Tallinn, Estonia
    Beans
    7

    Question Re: Howto: about sound in Hoary & Linux

    It could sound strange but my problem was no sound with Rhythmbox and Xine only. Totem and XMMS (with ALSA plugin) could play sound. No system sounds and GAIM too. I thought this guide could help me return sound (my fav player is Rhythmbox not XMMS) but actually nothing works now only XMMS (ALSA).

    I have 2 sound cards. Volume control uses the right one (Ensoniq AudioPCI). (look attached picture) But when I type "alsamixer" command I see that default is another one (SiS SI7012) (look attached picture). Does anyone know how to fix this? Maybe this could solve many other users' problems?
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	Screenshot-1.png 
Views:	887 
Size:	704.0 KB 
ID:	787  

  • #9
    Join Date
    Jan 2005
    Location
    paris, france
    Beans
    124
    Distro
    Ubuntu 7.04 Feisty Fawn

    Re: Howto: about sound in Hoary & Linux

    Hi MonoLT,

    did you try alsamixer -c1 to have access to the other sound card ? (By default alsamixer performs -c0)
    Don't know if this helps...
    When I apt-get something, I feel I'm good...
    with a single o

  • #10
    Join Date
    Apr 2005
    Location
    Tallinn, Estonia
    Beans
    7

    Re: Howto: about sound in Hoary & Linux

    Thank you dusu.

    That helped me to understand my problem a bit more. With "alsamixer -c1" I see that my card is Ensoniq "AudioPCI" (just what I need) but chip is set to "SigmaTel" (that's ethernet card if I'm not mistaken). So maybe you know how to associate my card (Ensoniq) with needed chip? Or I'm doing something wrong.

  • Page 1 of 9 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
    •