PulseAudio (Español)

From ArchWiki
Revision as of 17:07, 27 March 2011 by Zodiac es (Talk | contribs) (Flash Content)

Jump to: navigation, search

This template has only maintenance purposes. For linking to local translations please use interlanguage links, see Help:i18n#Interlanguage links.


Local languages: Català – Dansk – English – Español – Esperanto – Hrvatski – Indonesia – Italiano – Lietuviškai – Magyar – Nederlands – Norsk Bokmål – Polski – Português – Slovenský – Česky – Ελληνικά – Български – Русский – Српски – Українська – עברית – العربية – ไทย – 日本語 – 正體中文 – 简体中文 – 한국어


External languages (all articles in these languages should be moved to the external wiki): Deutsch – Français – Română – Suomi – Svenska – Tiếng Việt – Türkçe – فارسی

Tango-preferences-desktop-locale.pngThis article or section needs to be translated.Tango-preferences-desktop-locale.png

Notes: please use the first argument of the template to provide more detailed indications. (Discuss in Talk:PulseAudio (Español)#)

(Traducción al español en curso)

PulseAudio es un servidor de sonido para sistemas POSIX y Win32 . Permite tener varios programas reproduciendo sonido en una maquina, entre otras características mas avanzadas.

Instalación

Todos los paquetes son del repositorio community, asi que debes tenerlo habilitado. Luego, para instalar PulseAudio:

# pacman -S pulseaudio

Opcionalmente puedes instalar algunos front-ends GTK para PulseAudio:

# pacman -S paprefs pavucontrol

Ejecutandose

Si el demonio D-Bus no se está ejecutando, habrá que iniciarlo:

# /etc/rc.d/dbus start

PulseAudio puede ser iniciado con:

$ pulseaudio --start

O si usas X11:

$ start-pulseaudio-x11

Para kde:

$ start-pulseaudio-kde

PulseAudio puede ser detenido con:

$ pulseaudio --kill

Tener en cuenta que en el caso de ciertos entornos X11, PulseAudio sera iniciado en el login. Ver la sección en Entornos de Escritorio para detalles.

Backend Configuration

ALSA

Para las aplicaciones que no soportan PulseAudio y soportan ALSA es recomendable instalar el plugin PulseAudio para ALSA. Este plugin está disponible en el paquete pulseaudio-alsa.

# pacman -S pulseaudio-alsa

Este paquete contiene el Template:Filename con la configuración necesaria para que ALSA utilizar utilice PulseAudio.

Para poder añadir sonido a programas de 32 bit sobre Arch x86_64 (como Wine), tendremos que instalar lib32-libpulse y lib32-alsa-plugins también.

# pacman -S lib32-libpulse lib32-alsa-plugins

Para prevenir que las aplicaciones utilicen la emulación OSS de ALSA en lugar de PulseAudio (impedirían que otras aplicaciones reprodujeran sonido), debemos remover el módulo Template:Codeline ejecutando:

# rnmod snd-pcm-oss

Para que no tengamos que realizar el paso anterior cada vez que reinicemos, introduciremos el módulo en la blacklist, añadiendo Template:Codeline a MODULES en Template:Filename.

OSS

Tenemos varias alternativas para hacer que reproduzcan con PulseAudio programas que sólo utilizan OSS:

osspd

Éste es el método más simple

Instala ossp e inicializalo:

# pacman -S ossp
# /etc/rc.d/osspd start

Después, incluye osspd a DAEMONS en rc.conf.

padsp wrapper

Si tiene un programa que utiliza OSS puedes hacer que trabaje con PulseAudio ejecutándolo con padsp:

$ padsp OSSprogram

Ejemplos:

$ padsp aumix
$ padsp sox foo.wav -t ossdsp /dev/dsp

Si quiere, puede renombrar el OSSprogama por OSSprograma-real y crear un scritp como éste: Template:File

GStreamer

Para hacer que GStreamer use PulseAudio, ejecute Template:Filename (parte del paquete gnome-media) y seleccione PulseAudio Sound Server, en el cuadro Entrada y Salida de Audio.

Una alternativa sería establecer los valores de las variables de gconf Template:Codeline a pulsesink y Template:Codeline a pulsesrc:

 $ gconftool-2 -t string --set /system/gstreamer/0.10/default/audiosink pulsesink
 $ gconftool-2 -t string --set /system/gstreamer/0.10/default/audiosrc pulsesrc

Algunas aplicaciones (como Rhythmbox) ignoran la propiedad audiosink, pero utilizan el valor de musicaudiosink, aunque no se puede configurar esto usando Template:Filename. Necesita establecerlo manualmente usando Template:Filename o Template:Filename:

 $ gconftool-2 -t string --set /system/gstreamer/0.10/default/musicaudiosink pulsesink

OpenAL

OpenAl debería utilizar PulseAudio por defecto, pero puede ser explicitamente configurado editando Template:File

libao

Editar el fichero de configuración de libao:

Template:File

PortAudio

El actual binario de PortAudio que se encuentra en el repositorio de community no soporta PulseAudio y no mapea dispositivos de audio. Puede solucionarlo compilando PortAudio desde ABS y aplicando este parche a los fuentes.

ESD

PulseAudio es un reemplazo para el demonio enlightened sound (ESD). Si PulseAudio está en ejecución, los clientes ESD deberían tener disponible la salida sin modificar su configuración.

Entornos de escritorio

General X11

Se puede iniciar PulseAudio después de ejecutar X usando:

$ start-pulseaudio-x11

Ésto iniciará PulseAudio y cargará los pulgins X11.

Si usamos GNOME o KDE, PulseAudio será lanzado automáticamente en el login.

X11 bell

Para hacer que PulseAudio reproduzca un sonido cuando se produce un evento de campana de sistema en X11 (ejemplo: hacer que el terminal haga 'Ping!' en vez del 'Beep!'), añadimos al final de Template:Filename:

load-sample-lazy x11-bell /usr/share/sounds/freedesktop/stereo/dialog-error.oga
load-module module-x11-bell sample=x11-bell 

Puedes usar cualquier otro sonido. Template:Filename está en el paquete sound-theme-freedesktop.

GNOME

Proper integration of PulseAudio into GNOME requires some special packages:

  • libcanberra-pulse
  • gnome-media-pulse
  • gnome-settings-daemon-pulse

They are part of the pulseaudio-gnome group.

KDE 3

Notar que Pulseaudio NO es un reemplazo para aRts. Si usas KDE 3, no es posible usar PulseAudio.

KDE 4 y QT 4

Phonon está en Arch compilado con solporte para PulseAudio por defecto, con lo que, una vez instalado, al iniciar sesión, deberemos tener en "Preferencias de sistema->Multimedia->Phonon" como dispositivo de salida Audio Interno Estéreo Analógico o Audio Interno Estéreo Digital.

En el caso de tener únicamente una entrada Sevidor de sonido PulseAudio, implica que PulseAudio no se está ejecutando. Podemos lanzarlo con:

$ start-pulseaudio-kde

En principio, al iniciar la sesión, debería ser lanzado por defecto. Para más información, visitar la wiki de PulseAudio en las páginas KDE

Adicionalmete, una alternativa en KDE a pavucontrol, es veromix plasmoid disponible en el AUR.

Aplicaciones

Audacious

Audacious soporta PulseAudio de forma nativa. Para utilizarlo, debemos ir en Audacious a Preferencias->Audio->Salida->plugin para "PulseAudio".

mpd

You will need to configure mpd to use PulseAudio.

On a headless box, run PulseAudio as the mpd user. On a desktop, running mpd as yourself and not using the mpd user is preferred.

MPlayer

MPlayer soporta la salida PulseAudio de forma nativa, con la opción "Template:Codeline". También puede configurar la salida PulseAudio por defecto en Template:Filename por usuario, o en Template:Filename para todo el sistema: Template:File

Contenido Flash

Si después de instalar PulseAudio no tiene sonido desde un contenido flash, puede instalar libflashsupport-pulse desde el AUR.

Flashplugin (x86_64 only)

Si está usando flashplugin desde el repositorio multilib, necesitará instalar lib32-alsa-plugins y lib32-libcanberra-pulse para poder usar el mezclador de sonido, en otro caso, no podrá tener sonido simultáneo en una aplicación y flashplugin.

# pacman -S lib32-alsa-plugins lib32-libcanberra-pulse

Skype (x86_64 only)

Tiene que instalar lib32-libpulse desde multilib, sino optendrá el error "Problema con la reproducción de audio" cuando inicie una llamada.

Alternative configurations

Surround sound systems

Many people have a surround card, but have speakers for just two channels, so PulseAudio cannot really default to a surround setup. To enable all the channels, edit Template:Filename: uncomment the default-sample-channels line (i.e. remove the semicolon from the beginning of the line) and set the value to 6 if you have a 5.1 setup, or 8 if you have 7.1 setup etc.

# Default
default-sample-channels=2
# For 5.1
default-sample-channels=6
# For 7.1
default-sample-channels=8

After doing the edit, you will need to restart Pulseaudio.

ALSA Monitor source

To be able to record from a monitor source (a.k.a. "What-U-Hear", "Stereo Mix"), use Template:Codeline to find out the name of the source in Pulseaudio (e.g. Template:Codeline). Then add lines like the following to Template:Filename or Template:Filename:

pcm.pulse_monitor {
  type pulse
  device alsa_output.pci-0000_00_1b.0.analog-stereo.monitor
}

ctl.pulse_monitor {
  type pulse
  device alsa_output.pci-0000_00_1b.0.analog-stereo.monitor
}

Now you can select Template:Codeline as a recording source.

PulseAudio over network

One of PulseAudio's magnificent features is the possibility to stream audio from clients over TCP to the server running the PulseAudio daemon, allowing sound to be streamed through your LAN.

To accomplish this, one needs to enable module-native-protocol-tcp, and copy the pulse-cookie to the clients.

System-wide daemon

Warning: System-wide mode is a bad idea on a desktop. By default, PulseAudio is run per-user and will be started automatically when it is needed; this is simpler, more efficient and more secure. Read What Is Wrong With System Mode for more details.

First you need to add the "pulseaudio" daemon to Template:Filename. Example:

DAEMONS=(syslog-ng network netfs crond pulseaudio)

Then you need to add each user (even root) that should be capable of using PulseAudio to the Template:Codeline group:

# gpasswd -a <user> pulse-access

Edit Template:Filename, and change the following region:

.ifexists module-hal-detect.so
load-module module-hal-detect
.else

to the following:

.ifexists module-udev-detect.so
load-module module-udev-detect
.else

To enable the TCP module, add (or uncomment, if already there) this to Template:Filename:

load-module module-native-protocol-tcp

To allow remote connections to the TCP module, you also have to remember to unblock the service in Template:Filename with for example the following line:

pulseaudio-native: ALL

If you are running a system-wide PulseAudio instance, the cookie is located in Template:Filename. This cookie needs to be sent to the client and placed somewhere the pulse-access group can read (and with permissions so only they can read it). Alternatively, you may add Template:Codeline to the end of the Template:Codeline line to disable authentication.

# scp /var/run/pulse/.pulse-cookie client:/etc/pulse-cookie
# chown pulse:pulse-access /etc/pulse-cookie
# chmod 640 /etc/pulse-cookie

The pulse client needs to know where to look for the cookie. Template:Filename:

### Cookie file
cookie-file=/etc/pulse-cookie

Then the client needs to be configured to connect to the specified server. Template:Filename:

## The default server to connect to
default-server=192.168.0.5

To switch between servers on the client from within X, the Template:Codeline command can be used. For example, to switch from the default server to the local server:

$ pax11publish -e -S localhost

Or to switch back to the default:

$ pax11publish -e -r

Note that for the switch to become apparent, the programs using Pulse must be restarted.

To use the ESounD wrapper while using a system-wide daemon, you also need to enable auth-anonymous for the esound-unix module, or copy Template:Filename into each home directory.

Zeroconf (Avahi) publishing

For the remote Pulseaudio server to appear in the PulseAudio Device Chooser (Template:Filename), you will also need to add the Template:Filename to the DAEMONS in rc.conf on both server and clients.

Pulseaudio through JACK

The JACK-Audio-Connection-Kit is popular for audio work, and is widely supported by Linux audio applications. It fills a similar niche as Pulseaudio, but with more of an emphasis on professional audio work. In particular, audio applications such as Ardour and Audacity (recently) work well with Jack.

Pulseaudio provides module-jack-source and module-jack-sink which allow Pulseaudio to be run as a sound server above the JACK daemon. This allows the usage of per-volume adjustments and the like for the apps which need it, play-back apps for movies and audio, while allowing low-latency and inter-app connectivity for sound-processing apps which connect to JACK. However, this will prevent Pulseaudio from directly writing to the sound card buffers, which will increase overall CPU usage.

To just try PA on top of jack you can have PA load the necessary modules on start:

pulseaudio -L module-jack-sink -L module-jack-source

To use pulseaudio with JACK, JACK must be started up before Pulseaudio, using whichever method you prefer. Pulseaudio then needs to be started loading the 2 relevant modules. Edit Template:Filename, and change the following region:

### Load audio drivers statically (it is probably better to not load
### these drivers manually, but instead use module-hal-detect --
### see below -- for doing this automatically)
#load-module module-alsa-sink
#load-module module-alsa-source device=hw:1,0
#load-module module-oss device="/dev/dsp" sink_name=output source_name=input
#load-module module-oss-mmap device="/dev/dsp" sink_name=output source_name=input
#load-module module-null-sink
#load-module module-pipe-sink

### Automatically load driver modules depending on the hardware available
.ifexists module-udev-detect.so
load-module module-udev-detect
.else
### Alternatively use the static hardware detection module (for systems that
### lack udev support)
load-module module-detect
.endif

to the following:

### Load audio drivers statically (it is probably better to not load
### these drivers manually, but instead use module-hal-detect --
### see below -- for doing this automatically)
#load-module module-alsa-sink
#load-module module-alsa-source device=hw:1,0
#load-module module-oss device="/dev/dsp" sink_name=output source_name=input
#load-module module-oss-mmap device="/dev/dsp" sink_name=output source_name=input
#load-module module-null-sink
#load-module module-pipe-sink
load-module module-jack-source
load-module module-jack-sink

### Automatically load driver modules depending on the hardware available
#.ifexists module-udev-detect.so
#load-module module-udev-detect
#.else
### Alternatively use the static hardware detection module (for systems that
### lack udev support)
#load-module module-detect
#.endif

Basically, this prevents module-udev-detect from loading. module-udev-detect will always try to grab your sound-card (JACK has already done that, so this will cause an error). Also, the jack source and sink must be explicitly loaded.

QjackCtl with Startup/Shutdown Scripts

Using the settings listed above you can use QjackCtl to execute a script upon startup and shutdown to load/unload PulseAudio. Part of the reason you may wish to do this is that the above changes disable PulseAudio's automatic hardware detection modules. This particular setup is for using PulseAudio in an exclusive fashion with JACK, though the scripts could be modified to unload and load an alternate non-JACK setup, but killing and starting PulseAudio while programs might be using it would become problematic.

The following example could be used and modified as necessary as a startup script that daemonizes PulseAudio and loads the padevchooser program (optional, needs to be built from AUR) called Template:Filename:

#!/bin/bash
#Load PulseAudio and PulseAudio Device Chooser

pulseaudio -D
padevchooser&

as well as a shutdown script to kill PulseAudio and the Pulse Audio Device Chooser, as another example called Template:Filename also in the home directory:

#!/bin/bash
#Kill PulseAudio and PulseAudio Device Chooser

pulseaudio --kill
killall padevchooser

Both scripts need to be made executable:

chmod +x jack_startup jack_shutdown

then with QjackCtl loaded, click on the Setup button and then the Options tab and tick both "Execute Script after Startup:" And "Execute Script on Shutdown:" and put either use the ... button or type the path to the scripts (assuming the scripts are in the home directory) Template:Filename and Template:Filename making sure to save the changes you have made.

Pulseaudio through OSS

Add the following to Template:Filename:

 load-module module-oss

Then start Pulseaudio as usual. You should have sinks and sources for your OSS devices.

Pulseaudio from within a chroot (ex. 32-bit chroot in 64-bit install)

Since a chroot sets up an alternative root for the running/jailing of applications, pulseaudio must be installed within the chroot itself (Template:Codeline within the chroot environment).

Pulseaudio, if not set up to connect to any specific server (this can be done in Template:Filename, through the PULSE_SERVER environment variable, or through publishing to the local X11 properties using module-x11-publish), will attempt to connect to the local pulse server, failing which it will spawn a new pulse server. Each pulse server has a unique ID based on the machine-id value in Template:Filename. To allow for chrooted apps to access the pulse server, the following directories must be mounted within the chroot:-

/var/run
/var/lib/dbus
/tmp
~/.pulse

Template:Filename should also be mounted for efficiency and good performance. Note that mounting /home would normally also allow sharing of the Template:Filename folder.

For specific direction on accomplishing the appropriate mounts, please refer to the wiki on installing a bundled 32-bit system, especially the additional section specific to Pulseaudio.

Troubleshooting

No hay sonido después de instalar

Sin Tarjetas

Si PulseAudio está iniciado, ejecute Template:Codeline. Si no devuelve ninguna tarjeta, aseguraté de que los dispositivos de ALSA no están en uso:

$ fuser -v /dev/snd/*
$ fuser -v /dev/dsp

Asegúrese de que ninguna aplicación que use pcm o dst está iniciada antes de inicializar PulseAudio.

KDE4

Puede ser que haya otro dispositivo de salida marcado como preferio en phonon. Asegúrese de que en cada catergoría tiene su dispositivo de salida en la parte superior.

Con pavucontrol puede chequear la configurarción (instalar con pacman) para asegurarse de que las aplicaciones están utilizando el dispositivo de salida correctamente.

Dispositivo de audio selenciado

Si no hay salida de audio a través de cualquier medio durante el uso de ALSA como dispositivo por defecto, puede que tenga la tarjeta de sonido desactivada. Para activarla, tendrá que lanzar alsamixer y asegurarse de que cada columna, el valor 00, está de color verde. Si no es así, estará apagado el sonido, para activarlo pulse 'm.

$ alsamixer -c 0

Sometimes the snd_pcsp driver conflicts with the snd_hda_intel driver (for those of you using Intel cards) and no sound output is experienced. To fix this, you can blacklist the snd_pcsp driver in the MODULES array of Template:Filename (by appending Template:Codeline).

Fallo al iniciar el Daemon

Prueba a resetear PulseAudio. Hazlo así:

$ pulseaudio --kill
$ killall pulseaudio
$ killall -9 pulseaudio
$ rm -rf ~/.pulse*
$ rm -rf /tmp/pulse*

Después, inicia PulseAudio.

padevchooser

Si no puede lanzar el PulseAudio Device Chooser, (re)inicie el Daemon Avahi así:

$ /etc/rc.d/avahi-daemon restart

Problemas técnicos y uso intensivo de la CPU desde 0.9.14

El servidor de sonido PulseAudio ha sido reescrito para utilizar la programación de audio basado en temporizadores en lugar del enfoque tradicional por interrupciones. Eso puede provocar problemas con algunos drivers de ALSA. Para desactivarlo, reemplace la línea:

load-module module-udev-detect 

en Template:Filename por:

load-module module-udev-detect tsched=0

Sonido entrecortado

El sonido entrecortado en pulseaudio puede venir por una configuración errónea de la frecuencia de muestreo en etc/pulse/deamon.conf. Pruebe cambiando la línea:

; default-sample-rate = 44100

por

default-sample-rate = 48000

y reinicie el servidor pulseaudio ejecutando

pulseaudio --kill && pulseaudio --start

Realtime scheduling

Es una buena idea permitir a PulseAudio correr con programación en tiempo real, lo que puede mejorar el rendimiento. Para realizar esto agrega las siguientes lineas en Template:Filename:

@pulse-rt - rtprio 9
@pulse-rt - nice -11

Después necesitas agregar tu usuario al grupo Template:Codeline:

# gpasswd -a <user> pulse-rt

See also

External links