-
HOWTO: Hear multiple sounds using Both ESD & ALSA
Hello there,
This is just a clean and better organised guide of varunus's HowTo located here. So primarily all the credits go to him.
This HowTo will give you instruction on enabling software mixing, to avoid application problems like Audacity needing killall esd to work as well as Skype [now Skype will no longer crash if you receive a message or a call (when it try to play sound in fact)], so let's get to work shall we ?? :-P.
- We need to install libesd-alsa0 so
Code:
sudo apt-get install libesd-alsa0
- We need to create /etc/asound.conf, so
Code:
sudo gedit /etc/asound.conf
Insert into it:
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 2048 #1024
buffer_size 32768 #4096
#periods 128
rate 48000 #44100
}
bindings {
0 0
1 1
}
}
- We need to change /etc/esound/esd.conf contents so:
Code:
sudo mv /etc/esound/esd.conf /etc/esound/esd.conf_backup
sudo gedit /etc/esound/esd.conf
Insert into it:
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=
- Now You need to change ubuntu sound server to alsa (you can leave it ESD but better use alsa because it has better sound handling):
Code:
gstreamer-properties
Change both (in the Audio Tab not the Video) from ESD to ALSA so it looks just like the picture:
http://img104.echo.cx/img104/3140/sc...temssel.th.png
All that's left now is to restart your computer (after restart you must hear sound) to enable these changes. Also configure XMMS or Beep-media-player (or any player) to use ALSA instead of eSound/ESD. If you hear a strange sound, just change everything back to ESD. If everything worked correctly, now Audacity & Skype will work normally and all the program will play sound using either Alsa or ESD.
* If you couldn't play any sounds using ALSA then your /etc/asound.cond & /etc/esound/esd.conf needs some more advanced tweaking (or your sound card just won't support it).
* The codes above are to be done inside a terminal window.
Thanks to varunus for the original HowTo and to Vaportrail for the correct /ets/asound.conf contents.
Enjoy everyone :D.
-
Re: HOWTO: Hear mutliple sound using Both ESD & ALSA
Thanks so much for posting this. I'd given up and was using polypaudio.
The method you presented worked great!
-
Re: HOWTO: Hear mutliple sound using Both ESD & ALSA
Quote:
Originally Posted by Xian
Thanks so much for posting this. I'd given up and was using polypaudio.
The method you presented worked great!
no problem, i just made it clearer :D
-
Re: HOWTO: Hear multiple sounds using Both ESD & ALSA
-
Re: HOWTO: Hear multiple sounds using Both ESD & ALSA
you might find that realplayer still doesn't work after switching to alsa. this is because it is looking for /dev/dsp which is the oss device. Fortunately, alsa includes oss emulation. to enable it, just type
Code:
modprobe -v snd-pcm-oss
this will create the /dev/dsp device, routed to alsa.
Realplayer (and other oss only apps, no doubt) then works.
If that works fine, then just add snd-pcm-oss to the file /etc/modules
it will be loaded automatically at boot.
-
Re: HOWTO: Hear multiple sounds using Both ESD & ALSA
excellent! Finally a fix for sound problems! Developers - Please fix it this way in the next release!
nix
-
Re: HOWTO: Hear multiple sounds using Both ESD & ALSA
Quote:
Originally Posted by dukeinlondon
you might find that realplayer still doesn't work after switching to alsa. this is because it is looking for /dev/dsp which is the oss device. Fortunately, alsa includes oss emulation. to enable it, just type
Code:
modprobe -v snd-pcm-oss
this will create the /dev/dsp device, routed to alsa.
Realplayer (and other oss only apps, no doubt) then works.
If that works fine, then just add snd-pcm-oss to the file /etc/modules
it will be loaded automatically at boot.
It worked without that here.
-
Re: HOWTO: Hear multiple sounds using Both ESD & ALSA
period_size 2048 #1024
buffer_size 32768 #4096
Using these values caused my SDL games to go out of sync. If I use the smaller values, the sync is fixed but some videos have scratchy sound. ](*,)
-
Re: HOWTO: Hear multiple sounds using Both ESD & ALSA
Gandalf:
Just wanted to say that your HOWTO worked for me too. Thanks! :)
-
Re: HOWTO: Hear multiple sounds using Both ESD & ALSA
Quote:
Originally Posted by kb00heda
Gandalf:
Just wanted to say that your HOWTO worked for me too. Thanks! :)
no problem
-
Re: HOWTO: Hear multiple sounds using Both ESD & ALSA
Thank's Gandalf,
after this modifications i can hear music with the BeepMediaPlayer and can start a video with gxine without a delayed audio :) . But i have still the problem with the RealPlayer. If i see a video with the RealPlayer all other sounds are down. The BeepPlayer shows the problem report "Can't open audio, please check the plugin...". Dukeinlondon's tip had no result. Any other tip's?
Regards
Michael
-
Re: HOWTO: Hear multiple sounds using Both ESD & ALSA
you're the man!! thanks
\\:D/ \\:D/ a lot ...
-
Re: HOWTO: Hear multiple sounds using Both ESD & ALSA
Works great for me too. Only weird thing I noticed that when you hit test in the default-source section of gstreamer-properties I get this message "Failed to construct test pipeline for 'ALSA - Advanced Linux Sound Architecture'" I think this is a specific issue with the test function, because everything else is working beautifully. Thanks Gandalf.
-
Re: HOWTO: Hear multiple sounds using Both ESD & ALSA
when i did this im unable to hear the system sounds and xmms vlc sounds, just skype sounds.
What did i do wrong?
-
Re: HOWTO: Hear multiple sounds using Both ESD & ALSA
Quote:
Originally Posted by manadskort
when i did this im unable to hear the system sounds and xmms vlc sounds, just skype sounds.
What did i do wrong?
I'm having the same issue right now, apparently there's a 'thing' where two different applications can't be writing to the same sound server. You'd think that would be possible... I mean even DirectX can do that.
-
Re: HOWTO: Hear multiple sounds using Both ESD & ALSA
While this method DOES work, I noticed that my avis and mpgs all play choppy. Having multiple sounds play is great, but not at the cost of video framerates.
Excellent tut, but not for me.
-
Re: HOWTO: Hear multiple sounds using Both ESD & ALSA
Quote:
Originally Posted by joekr
While this method DOES work, I noticed that my avis and mpgs all play choppy. Having multiple sounds play is great, but not at the cost of video framerates.
Excellent tut, but not for me.
Is this consistent for people?
What are the advantages of doing this, i thought they used Alsa by default anyway? When programs use dev/dsp does it no longer lock out everything else from using the sound device (like flash)?
I really just hope we can get polypaudio in the next version, seems a lot better.
-
Re: HOWTO: Hear multiple sounds using Both ESD & ALSA
Well I just gave in and tried it. Everything works pretty good but some things I still have issues with, namely stuff that uses /dev/dsp (vmware) will hog all the sound. Anyway to point stuff to use ESD instead or something?
-
Re: HOWTO: Hear multiple sounds using Both ESD & ALSA
After following this guide my SDL games ran horribly slow :-| so I just had to revert the process ](*,)
-
Re: HOWTO: Hear multiple sounds using Both ESD & ALSA
it's weird for some it doesn't work :o it works with every program/game for me :o
-
Re: HOWTO: Hear multiple sounds using Both ESD & ALSA
Quote:
Originally Posted by Gandalf
it's weird for some it doesn't work :o it works with every program/game for me :o
thanks for the great how to :).
When the system is heavy loaded, the sounds starts to sound wierd on skype, and sometimes i looses the connection.
Isnt that wierd?
I would be very happy if someone could tell me how to hear xmms sounds at the same time with the skype sounds.
-
Re: HOWTO: Hear multiple sounds using Both ESD & ALSA
Hello, I'm going to post my asound.conf file if others are having issues. The main reaon I'm posting is, looking over yours Gandalf, I don't think yours is setup for fullduplex operation. The only mixing going on with yours is for output not input. Now, I'm definately not an expert on creating these, but someone who seemed to know a fair amount about these configs on #alsa helped me.
Code:
pcm.card0 {
type hw
card 0
# mmap_emulation true
}
#pcm.dmix0 {
# type dmix
# ipc_key 34521
# slave {
# pcm "card0"
# }
#}
pcm.dmix0 {
type dmix
ipc_key 1024 ## needs to be a power of 2
slave {
pcm "hw:0"
period_time 0
period_size 1024
buffer_size 8192
# format S16_LE
rate 44100 ## not necessary
}
#slowptr true
}
pcm.dsnoop0 {
type dsnoop
ipc_key 2048
slave {
pcm "card0"
# rate 48000
}
}
pcm.asym0 {
type asym
playback.pcm "dmix0"
capture.pcm "dsnoop0"
}
pcm.pasym0 {
type plug
slave.pcm "asym0"
}
# 'dsp0' is espected by OSS emulation etc.
pcm.dsp0 {
type plug
slave.pcm "asym0"
}
ctl.dsp0 {
type hw
card 0
}
pcm.!default {
type plug
slave.pcm "asym0"
}
ctl.!default {
type hw
card 0
}
With this config, I can run multiple xmms's, beeps, rhtyhm or pretty much whatever while recording at the same time. You can test yours by running a player and then launching arecord from the cli.
About the rate setting, the person helping me with my config insisted that I don't need it, but when running esd, sound would be scratchy without it. Again, not being an expert on these things, I think it's beneficial to have the rate at your sound cards native rate, most cards are 48000 so change that if needed.
Also you might find sdl games no longer have sound here's a fix:
* SDL - now time to change behaviour of apps which uses SDL to play sound. SDL tries to use hw:0, and without intervention, it fails to open audio device. But SDL uses AUDIODEV environment variable, so it placed such file to /etc/profile.d/, example dmix_sdl.sh:
export AUDIODEV=default
and finally mplayer can be modified within the gui (gmplayer) but mplayer alone won't read that. Here's my ~/.mplayer/config
vo="xv"
ao="alsa:device=default"
The vo="xv" will set mplayer to use xv hardware overlay for video so most of you will want that as well if you haven't set it as such. I'm mainly use totem but it's nice to have mplayer working with this setup.
And the gstreamer-properties test with this setup will work for both playback and recording.
As gandalf said, with certain sound setups you might have issues, if so look at this page and search for your soundcard (it's where I got most of my info)
http://alsa.opensrc.org/index.php?page=DmixPlugin
and here at the same site their quick n dirty dmix esd arts sdl how to
http://alsa.opensrc.org/index.php?pa...nd+dirty+HOWTO
My final comment on this is two issues. This works for 99% of apps out there, but some older apps don't map properly, for ex I couldn't get quake3/et and teamspeak to play nice, but this is because my onboard sound only has software mixing, those with hardware mixing shouldn't have issue.
The other thing is I like to use the gnome option for another user to login without logging me out. But running esd in the one login holds the card, so the other user gets no sound. Again not sure if this is the case with hardware mixing cards. If someone could test that out, I'm curious.
-
Re: HOWTO: Hear multiple sounds using Both ESD & ALSA
Excellent how-to. Most of my games (UT2004, SimCity 3000U, Enemy Territory) required that I kill esd before being able to play with sound, and I always had to reboot afterward to get sound in Ubuntu back. After following this guide, the sound works flawlessly in everything. No more killing esd and rebooting! Thanks :D
-
Re: HOWTO: Hear multiple sounds using Both ESD & ALSA
Quote:
Originally Posted by Rehevkor
Excellent how-to. Most of my games (UT2004, SimCity 3000U, Enemy Territory) required that I kill esd before being able to play with sound, and I always had to reboot afterward to get sound in Ubuntu back. After following this guide, the sound works flawlessly in everything. No more killing esd and rebooting! Thanks :D
no problem, just for your record, no need to reboot ubuntu juste type esd in a console will turn on ESD again
-
Re: HOWTO: Hear multiple sounds using Both ESD & ALSA
-
Re: HOWTO: Hear multiple sounds using Both ESD & ALSA
is it just me?
I cant play music with xmms at the same time that im using skype.
-
Re: HOWTO: Hear multiple sounds using Both ESD & ALSA
Oh and for sdl games, install libsdl1.2debian-alsa
You could install the esd version but both will work and this way you can have sdl games work in another window manager where you might not be running esd.
It defaulted to libsdl1.2debian-oss. Not sure exactly why that doesn't work when alsa has oss emulation.
But really, can we not purge oss completely from a distribution yet?
-
Re: HOWTO: Hear multiple sounds using Both ESD & ALSA
-
Re: HOWTO: Hear multiple sounds using Both ESD & ALSA
Quote:
Originally Posted by Gandalf
no problem, just for your record, no need to reboot ubuntu juste type esd in a console will turn on ESD again
Well, I did that, but it would just play a series of pc speaker beeps and the interface sounds in Ubuntu still wouldn't play. It would only work if I rebooted.
Fortunately, I don't have to worry about that now :)
-
Re: HOWTO: Hear multiple sounds using Both ESD & ALSA
I have a soundblaster 24bit live on board card. Is this guide working for it also?
-
Re: HOWTO: Hear multiple sounds using Both ESD & ALSA
I tried this guide to get my M-Audio USB Quattro playing back w/o scratchy sound through ESD... worked wonderfully for the audio.
Unfortunately it seems to break my USB Best Data 56k modem, using the slmodem-2.9.10_USB package...
I've confirmed this a couple of times. Being new to linux, I reformatted, reinstalled Hoary. Modem works until I use this guide, then it doesn't!
Sound is great, but not quite as important as my internet connection. Is there a way the two can be reconciled or any clue as to why this would happen?
-
Re: HOWTO: Hear multiple sounds using Both ESD & ALSA
Quote:
Originally Posted by mortram
I tried this guide to get my M-Audio USB Quattro playing back w/o scratchy sound through ESD... worked wonderfully for the audio.
Unfortunately it seems to break my USB Best Data 56k modem, using the slmodem-2.9.10_USB package...
I've confirmed this a couple of times. Being new to linux, I reformatted, reinstalled Hoary. Modem works until I use this guide, then it doesn't!
Sound is great, but not quite as important as my internet connection. Is there a way the two can be reconciled or any clue as to why this would happen?
is there any configuration file of this modem drivers? if yes try to make it use Alsa instead of ESD
-
Re: HOWTO: Hear multiple sounds using Both ESD & ALSA
it's not configured for ALSA or ESD, there's no sound output. It's not that the switch to ALSA breaks the sound on the modem, it breaks the modem itself, which only spits out NO CARRIER messages after the switch to ALSA and won't pick up the line or dial. here's the makefile if that's of any consequence:
################################################## #########################
#
#
# Makefile -- modem Makefile.
#
# Copyright(c) 2003, Smart Link Ltd. (www.smlink.com)
# All rights reserved.
#
# Author: Sasha K (sashak@smlink.com)
#
#
################################################## #########################
#
################################################## #########################
KERNEL_DIR:=/lib/modules/$(shell uname -r)/build
# tools
INSTALL:=install
all: modem
#all: modem drivers
modem:
$(MAKE) -C $@ all
install: all install-drivers
$(INSTALL) -D -m 755 modem/slmodemd ${DESTDIR}/usr/sbin/slmodemd
$(RM) -rf ${DESTDIR}/var/lib/slmodem
$(INSTALL) -d -D -m 755 ${DESTDIR}/var/lib/slmodem
uninstall: uninstall-drivers
$(RM) ${DESTDIR}/usr/sbin/slmodemd
$(RM) -rf ${DESTDIR}/var/lib/slmodem
drivers:
$(MAKE) -C drivers KERNEL_DIR=$(KERNEL_DIR)
install-drivers: drivers
$(MAKE) install -C drivers KERNEL_DIR=$(KERNEL_DIR)
uninstall-drivers:
$(MAKE) uninstall -C drivers KERNEL_DIR=$(KERNEL_DIR)
# misc rules
sub-dirs:= modem drivers
.PHONY: $(sub-dirs) all old clean dep install
clean dep: %: %-sub-dirs
%-sub-dirs:
$(foreach dir,$(sub-dirs),$(MAKE) -C $(dir) $(patsubst %-sub-dirs,%,$@) && ) echo "done."
-
Re: HOWTO: Hear multiple sounds using Both ESD & ALSA
appears to be something called in the asound.conf, I tried commenting/uncommenting sections to see what happened (the expressions themselves make almost no sense to me other than the sample rates, etc.). It seems with the asound, I can either get the modem & no sound, the modem and scratchy sound, or great sound and no modem.
I found the polypaudio packages in Synaptic and installed those... on reboot the sound is clear and the modem's working, so I guess I've found my solution.
Thanks for the suggestions and the tutorial.
-
Re: HOWTO: Hear multiple sounds using Both ESD & ALSA
so far, most everything i've tried work - xmms, totem, flash, OS sounds. the only thing that doesn't work is mplayer.
when i try to open anything with mplayer, i get "Could not open/initialize audio device -> no sound." error.
for settings, i have tried blank ao, ao=alsa, and ao=alsa:device=default
does anyone know how to fix this?
-
Re: HOWTO: Hear multiple sounds using Both ESD & ALSA
Quote:
Originally Posted by NeoChaosX
period_size 2048 #1024
buffer_size 32768 #4096
Using these values caused my SDL games to go out of sync. If I use the smaller values, the sync is fixed but some videos have scratchy sound. ](*,)
So nobody can help me with this issue?
-
Re: HOWTO: Hear multiple sounds using Both ESD & ALSA
Same problems here: mplayer does not work and games that use SDL sounds freeze if another application with sound is on.
Any solutions :???:
I tried the ones posted in this forum, no success...
-
Re: HOWTO: Hear multiple sounds using Both ESD & ALSA
-
Re: HOWTO: Hear multiple sounds using Both ESD & ALSA
Quote:
Originally Posted by Gandalf
Hello there,
This is just a clean and better organised guide of varunus's HowTo located
here. So primarily all the credits go to him.
This HowTo will give you instruction on enabling software mixing, to avoid application problems like Audacity needing killall esd to work as well as Skype [now Skype will no longer crash if you receive a message or a call (when it try to play sound in fact)], so let's get to work shall we ?? :-P.
- We need to install libesd-alsa0 so
Code:
sudo apt-get install libesd-alsa0
- We need to create /etc/asound.conf, so
Code:
sudo gedit /etc/asound.conf
Insert into it:
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 2048 #1024
buffer_size 32768 #4096
#periods 128
rate 48000 #44100
}
bindings {
0 0
1 1
}
}
- We need to change /etc/esound/esd.conf contents so:
Code:
sudo mv /etc/esound/esd.conf /etc/esound/esd.conf_backup
sudo gedit /etc/esound/esd.conf
Insert into it:
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=
- Now You need to change ubuntu sound server to alsa (you can leave it ESD but better use alsa because it has better sound handling):
Code:
gstreamer-properties
Change both (in the Audio Tab not the Video) from ESD to ALSA so it looks just like the picture:
http://img104.echo.cx/img104/3140/sc...temssel.th.png
All that's left now is to restart your computer (after restart you must hear sound) to enable these changes. Also configure XMMS or Beep-media-player (or any player) to use ALSA instead of eSound/ESD. If you hear a strange sound, just change everything back to ESD. If everything worked correctly, now Audacity & Skype will work normally and all the program will play sound using either Alsa or ESD.
* If you couldn't play any sounds using ALSA then your /etc/asound.cond & /etc/esound/esd.conf needs some more advanced tweaking (or your sound card just won't support it).
* The codes above are to be done inside a terminal window.
Thanks to
varunus for the
original HowTo and to
Vaportrail for the correct /ets/asound.conf contents.
Enjoy everyone :D.
I follow this tutorial and now I lost all the sounds. How to undo these changes?
Thanks
-
Re: HOWTO: Hear multiple sounds using Both ESD & ALSA
Quote:
Originally Posted by hyapadi
I follow this tutorial and now I lost all the sounds. How to undo these changes?
Thanks
well delete /etc/asound.conf
cp /etc/esound/esd.conf_backup to /etc/esound/esd.conf
and remove the apt-getted packages