miércoles, 15 de febrero de 2012

Linux: Reinicialitzar PulseAudio

Després de casi 2 hores ja he trobat la sol·lució. El problema bàsic és que reinicialitzant Pulseaudio per les bones, fa que al Phonon (System Settings / Multimedia) no hi hagi els dispositius que hi havia abans de reinicialitzar. 

Dit d'una altra manera, que si fem pulseaudio -k (sempre, sempre com a usuari es farà), el que fa es matar el procés però automàticament s'executa pulseaudio de nou. La culpa la té una opció que es diu "autospawn".

Quan aconseguim, però, matar el procés i que no es reexecuti automàticament trobarem un altre problema: Que executant pulseaudio o pulseaudio --start o qualsevol de les variants per arrancar pulseaudio, quan anem al Phonon no trobarem els dispositius que teniem abans.

Per sol·lucionar aquests 2 problemes:

1. Crear ~/.pulse/client.conf i afegir-hi

autospawn = no

Tambe podríem haver fet directament:

xddxdd@debian:~$ echo "autospawn = no" >> ~/.pulse/client.conf

2. Executar com a usuari:

xddxdd@debian:~$ pulseaudio -k

Ara si que tenim el procés mort de debò (xD)

3. Executar com a usuari

xddxdd@debian:~$ start-pulseaudio-kde

Ara en principi ja hauríem de tenir al Phonon els dispositius de sempre (els "SB Live EMU10K1 Análogo Envolvente 5.1").

Nota: Contingut del fitxer start-pulse-audio-kde que està a /usr/bin/


#!/bin/sh

# This file is part of PulseAudio.
#
# PulseAudio is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# PulseAudio is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with PulseAudio; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
# USA.

set -e

[ -z "$PULSE_SERVER" ]

/usr/bin/pulseaudio --start "$@"

if [ x"$DISPLAY" != x ] ; then

    /usr/bin/pactl load-module module-device-manager "do_routing=1" > /dev/null

fi

No hay comentarios: