Assunto: Re:[radio_faced] Como compartilhar a placa de som com ALSA. De: "hilberto" <hilberto@terra.com.br> Data: Sab, Julho 22, 2006 9:11 Para: "radio_faced" <radio_faced@yahoogrupos.com.br>

Completando a primeira informação com outras referências (ver operação em full duplex mais abaixo):
>>>>>>>>>>>>>>>>>>> http://www.ubuntuforums.org/showthread.php?t=32063
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 ?? .
1. We need to install libesd-alsa0 so
Code:
sudo apt-get install libesd-alsa0
2. 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 } }
3. 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=
4. 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:
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.
Correct beep-media-player configuration:
* 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 .
>>>>>>>>>> http://ubuntuforums.org/showthread.php?t=8882&highlight=hear+multiple+sound
This one seems to stump most linux newbies..."Why can't I hear sounds from two applications at once?" This is
because your sound card requires something called "software mixing." Thankfully, ALSA provides software mixing,
so this shouldn't be very hard.
...
IMPORTANTE (OPERAÇÃO EM FULL DUPLEX)
>>>>>>>>>> http://www.ubuntuforums.org/showthread.php?t=32063&page=3
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.
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.
---------- Cabeçalho original -----------
De: radio_faced@yahoogrupos.com.br
Para: radio_faced@yahoogrupos.com.br
Cópia:
Data: Sat, 22 Jul 2006 08:44:49 -0300
Assunto: [radio_faced] Como compartilhar a placa de som com ALSA.
>
>
> -------- Mensagem Original --------
> Assunto: Re: Sound Device Not Shared -- Working Now
> Resent-Date: Sun, 8 Jan 2006 20:14:26 -0600 (CST)
> Resent-From: debian-user@lists.debian.org
> Data: Mon, 9 Jan 2006 13:15:24 +1100
> De: ankur.kumar@axa.com.au
> Para: debian-user@lists.debian.org
>
>
>
>
> my sound card is being shared now with other applications.
> But still some applications which are not configured to use ALSA like
> RealPlayer have some issues.
>
> I did following things:
>
> *1. installed gstream ALSA plugin*
> * apt-get install gstreamer0.8-alsa *
>
> 2. Run- */usr/bin/gstreamer-properties* and changed input/output to ALSA
>
> 3. create /etc/asound.conf file and configure "dmixer".
> #
> # DMIX input device
> #
> pcm.!output {
> type dmix
> ipc_key 1234
> slave {
> pcm "hw:0,0"
> period_time 0
> period_size 1024
> buffer_size 8192
> rate 48000
> }
> }
> #
> # DSNOOP output device
> #
> pcm.!input {
> type dsnoop
> ipc_key 1234
> slave {
> pcm "hw:0,0"
> period_time 0
> period_size 1024
> rate 48000
> }
> }
> #
> # ASYM duplex device
> #
> pcm.!duplex {
> type asym
> playback.pcm "output"
> capture.pcm "input"
> }
> #
> # Make the duplex device default
> #
> pcm.!default {
> type plug
> slave.pcm "duplex"
> }
> #
> # OSS Compability
> #
> pcm.!dsp0 {
> type plug
> slave.pcm "duplex"
> }
> ctl.!mixer0 {
> type hw
> card 0
> }
>
> *4. *for XMMS, I need to change preferences to use ALSA instead of OSS.
>
>
>
>
> *ankur.kumar@axa.com.au*
> 03 9617 2235
>
> 05/01/2006 05:05 PM
>
>
> To: debian-user@lists.debian.org
> cc:
> Subject: Re: Sound Device Not Shared
>
>
>
>
>
> if I stop the application which is using the sound device and then other
> application can use the sound device...
> its more like exclusive access to the sound device by ALSA....
>
> even if there is a warning sound from Anti-virus program, sound device
> get locked and I can not play music anymore until
> I close Anti-virus program.
>
>
>
> *Adam Porter <adam@alphapapa.net>*
> Sent by: news <news@sea.gmane.org>
>
> 05/01/2006 04:43 PM
>
>
> To: debian-user@lists.debian.org
> cc:
> Subject: Re: Sound Device Not Shared
>
>
>
>
>
> ankur.kumar@axa.com.au wrote:
>
> > I'm using ALSA and the only issue is if an application is using Sound
> > device (/dev/dsp) and another
> > application is trying to use it, it says "/dev/dsp" is already in use.
> >
> > What can I do it share the sound device??
>
> If I understand ALSA correctly, you should not be using /dev/anything. ALSA
> specifies devices differently, e.g. "hw:0,0" for card 0, device 0. If your
> app is wanting to use /dev/dsp, it may not be set up to use ALSA. Either
> configure it to use ALSA instead of OSS, or run the program with an ALSA
> wrapper, like aoss (man aoss for help).
>
>
> --
> To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact
> listmaster@lists.debian.org
>
>
> _____________________________________________________________________
> This e-mail has been scanned for viruses by MCI's Internet Managed
> Scanning Services - powered by MessageLabs. For further information
> visit http://www.mci.com
>

[radio_faced] Configurando ALSA para tocar e gravar ao mesmo tempo (operação full duplex) De: "hilberto" <hilberto@terra.com.br> Data: Sab, Julho 22, 2006 9:44 Para: radio_faced@yahoogrupos.com.br

Howto: Happy ALSA, OSS, ESD, with Duplex - Sound Settings

I know it's been done before, but I don't think anybody has compiled all the

settings into a single happy set

of instructions.

This setup should work with most sound systems, it is from my Nforce2 setup at home,

it makes everything work

quite nicely together, OSS, ESD, ALSA and make your Mic work while sound is playing

(great for UT2004!!).

These instructions assume you know how to edit config files on your system and

add/remove packages on your own.

1. Goto System->Preferences->Sound and disable "Enable Sound Server Startup"

2. Install libesd-alsa0 which will remove libesd0, but that's ok.

3. Make /etc/esound/esd.conf look like this:

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

4. Make /etc/asound.conf look like this:

Code:

# Set default sound card

# Useful so that all settings can be changed to a different card here.

pcm.snd_card {

type hw

card 0

}

# Allow mixing of multiple output streams to this device

pcm.dmixer {

type dmix

ipc_key 1024

slave.pcm "snd_card"

slave {

# This stuff provides some fixes for latency issues.

# buffer_size should be set for your audio chipset.

period_time 0

period_size 1024

buffer_size 4096

# rate 44100

}

bindings {

0 0

1 1

}

}

# Allow reading from the default device.

# Also known as record or capture.

pcm.dsnooper {

type dsnoop

ipc_key 2048

slave.pcm "snd_card"

bindings {

0 0

1 1

}

}

# This is what we want as our default device

# a fully duplex (read/write) audio device.

pcm.duplex {

type asym

playback.pcm "dmixer"

capture.pcm "dsnooper"

}

###################

# CONVERSION PLUG #

###################

# Setting the default pcm device allows the conversion

# rate to be selected on the fly.

# duplex mode allows any alsa enabled app to read/write

# to the dmix plug (Fixes a problem with wine).

pcm.!default {

type asym

playback.pcm "dmixer"

capture.pcm "dsnooper"

}

########

# AOSS #

########

# OSS dsp0 device (OSS needs only output support, duplex will break some stuff)

pcm.dsp0 {

type plug

slave.pcm "dmixer"

}

# OSS control for dsp0 (needed?...this might not be useful)

ctl.dsp0 {

type plug

slave.pcm "snd_card"

}

# OSS control for dsp0 (default old OSS is mixer0)

ctl.mixer0 {

type plug

slave.pcm "snd_card"

}

4. If you look, the first setting will let you select a different sound card as

your primary if you have

multiple sound cards.

5. Make /etc/libao.conf look like this:

Code:

default_driver=alsa

6. Reboot to make sure all the systems startup correctly.

OSS stuff will still tie up the sound card, but they don't run all the time. Just

configure most things to use

ALSA and you'll be good.

Side-Effect: The Ubuntu startup sounds will go away, but i think the trade-off is

worth it.

Note: If stuff plays a little static through ESD, in /etc/esound/esd.conf try changing

spawn_options=-terminate -nobeeps -as 2 -d default

to

spawn_options=-terminate -nobeeps -as 2 -d duplex

Assunto: [radio_faced] HOWTO Set sound if you have 2 soundcards De: "hilberto" <hilberto@terra.com.br> Data: Sab, Julho 22, 2006 10:23 Para: radio_faced@yahoogrupos.com.br

Veja no final como habilitar o som dos arquivos flash.

HOWTO Set sound if you have 2 soundcards

>>>>>>>>>>>>>>>> http://www.ubuntuforums.org/showthread.php?t=27186

HOWTO Set sound if you have 2 soundcards

Foreword

If you have 2 soundcards and don't hear anything then this HOWTO should help you.

Actually it's fully based on dusu's Thread about sound in Hoary and Linux and

comments I've found there:

http://www.ubuntuforums.org/showthread.php?t=26567 I've just modified it a bit and

included some optimizations.

Configuration

1. We need to kill ESD. So open terminal and type:

Code:

sudo killall esd

2. Now we need to tell ESD not to run when one does not need it. Open esd.conf file:

Code:

sudo gedit /etc/esound/esd.conf

and insert this (for some people "dafault" parameter is not suitable so they should

use "mixer" instead):

Code:

[esd] auto_spawn=1 spawn_options=-terminate -nobeeps -as 2 -d default // use "mixer"

instead of "default" if

you don't have sound spawn_wait_ms=100 # default options are used in spawned and

non-spawned mode default_options

3. We need to "allow" use of many sounds at the same time. So we need to install

libesd-alsa0:

Code:

sudo apt-get install libesd-alsa0

4. Now create asound file:

Code:

sudo gedit /etc/asound.conf

and edit it like this:

Code:

pcm.card0 { type hw card 0 } pcm.!default { type plug slave.pcm "dmixer" }

pcm.dmixer { type dmix ipc_key 1025

slave { pcm "hw:1,0" period_time 0 period_size 2048 buffer_size 32768 rate 48000 }

bindings { 0 0 1 1 } }

What I did here is changed period_size and buffer_size for better performance. Rate

is also changed to hear

high quality sounds. And pcm is also changed here from "hw:0,0" (first soundcard) to

"hw:1,0" (second soundcard

(my default one)). This helped me and I hope it'll help you too.

4. Last step: allowing sound in Flash files:

Code:

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

5. Restart ALSA:

Code:

sudo /etc/init.d/alsa restart

and logout from your session. When you login next time you should be able to hear

Gnome Welcome Sound

In the end

I want to thank all the people around this forum, especially dusu, ploum and wrochal

whole ubuntu support team

and of course developers of the best linux distro I've ever used.

Reply With Quote

Assunto: [radio_faced] Como listar as placas de som no linux com alsa De: "hilberto" <hilberto@terra.com.br> Data: Sab, Julho 22, 2006 11:36

td:/home/hilberto# cat /proc/asound/cards 0 [SI7012 ]: ICH - SiS SI7012 SiS SI7012 with ALC655 at 0xe000, irq 217

2006-09-11T17:14:37