Mostrando entradas con la etiqueta Phonon. Mostrar todas las entradas
Mostrando entradas con la etiqueta Phonon. Mostrar todas las entradas

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

martes, 14 de febrero de 2012

Linux: Desactivar Speaker

Desactivar l'Speaker és una de les coses més torracollons (perdó) que hi ha a Linux. Abans, amb un modprobe -r pcspkr (o rmmod pcspkr) n'hi havia prou. Deixo un parell de links on proposen algunes maneres.


La que m'ha funcionat a mi consta del següent:

1. Editar /etc/modprobe.d/blacklist.conf (o crear-lo si no existeix) i posar-hi:
blacklist pcspkr
blacklist snd_pcspkr

En principi amb això n'hi ha prou (el que fa es no carregar els mòduls que s'escriuen després de blacklist, és a dir un rmmod modul però que es manté quan reiniciem).

A una de les pàgines anteriorment vistes es suggereix que encara que posem a la blacklist els mòduls del Speaker no n'hi ha prou ja que: 

Note: The blacklist command will blacklist a module so that it will not be loaded automatically, but the module may be loaded if another non-blacklisted module depends on it or if it is loaded manually.
However, there is a workaround for this behaviour; the install command instructs modprobe to run a custom command instead of inserting the module in the kernel as normal, so you can force the module to always fail loading with:
/etc/modprobe.d/blacklist.conf
...
install MODULE /bin/false
...
This will effectively "blacklist" that module and any other that depends on it. "

Jo aquest opció no l'he provat així que seria interessant fer-ho. Enlloc d'això:

2. root@debian:~# apt-get install alsa-base
   xddxdd@debian:~$  echo "options snd_hda_intel beep_mode=0" >> /etc/modprobe.d/alsa-base.conf

Ara si reiniciem, no hauriem de sentir més el molest soroll de l'Speaker.

NOTA: Si desinstal·lem ALSA (apt-get remove alsa-base) veurem que al reiniciar tindrem el Speaker tocant els pebrots un altre cop en forma de dispositiu del Phonon. Es tan facil com anar al Phonon ("Preferencias del sistema" / "Multimedia" / "Audio Hardware Setup") i sel·leccionar:

Tarjeta de sonido: pcsp
Perfil: Apagado

És possible que encara tinguem l'Speaker (és pitjor que el monstre Bu) anem a alsamixer i F6 sel·leccionem pcsp, anem a "Beep" i clickem la tecla "m" i veurem com es canvia de 00 a MM (mute). A dalt veiem: Item: Beep [off]. Clickem "Esc".

Ara en principi si que ja està.