É possível evitar que o PulseAudio hiberne? - Ubuntu

Galera! O processo do “pulseaudio” entra em hibernação automaticamente quando não está sendo usado. Então, quando eu clico em algum arquivo de áudio, o “pulse” volta automaticamente. Ok. Eu acredito que esse liga e desliga causa o tal clique que me incomoda tanto. Alguém sabe como deixar o processo do “pulseaudio” sempre executando e será que isso pode causar algum problema?

Pulseaudio

Se não me falhe a memória, você precisa mudar o parâmetro --daemonize de no para yes lá em /etc/pulse/daemon.conf. lembrando que você precisa remover as ; e relogar para aplicar.

1 curtida

Olá! Antes de fazer a alteração resolvi colar aqui o conteúdo desse arquivo:
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, see http://www.gnu.org/licenses/.

Configuration file for the PulseAudio daemon. See pulse-daemon.conf(5) for
more information. Default values are commented out. Use either ; or # for
commenting.

; daemonize = no
; fail = yes
; allow-module-loading = yes
; allow-exit = yes
; use-pid-file = yes
; system-instance = no
; local-server-type = user
; enable-shm = yes
; enable-memfd = yes
; shm-size-bytes = 0 # setting this 0 will use the system-default, usually 64 MiB
; lock-memory = no
; cpu-limit = no

; high-priority = yes
; nice-level = -11

; realtime-scheduling = yes
; realtime-priority = 5

; exit-idle-time = 20
; scache-idle-time = 20

; dl-search-path = (depends on architecture)

; load-default-script-file = yes
; default-script-file = /etc/pulse/default.pa

; log-target = auto
; log-level = notice
; log-meta = no
; log-time = no
; log-backtrace = 0

; resample-method = speex-float-1
; avoid-resampling = false
; enable-remixing = yes
; remixing-use-all-sink-channels = yes
; enable-lfe-remixing = no
; lfe-crossover-freq = 0

flat-volumes = no

; rlimit-fsize = -1
; rlimit-data = -1
; rlimit-stack = -1
; rlimit-core = -1
; rlimit-as = -1
; rlimit-rss = -1
; rlimit-nproc = -1
; rlimit-nofile = 256
; rlimit-memlock = -1
; rlimit-locks = -1
; rlimit-sigpending = -1
; rlimit-msgqueue = -1
; rlimit-nice = 31
; rlimit-rtprio = 9
; rlimit-rttime = 200000

; default-sample-format = s16le
; default-sample-rate = 44100
; alternate-sample-rate = 48000
; default-sample-channels = 2
; default-channel-map = front-left,front-right

; default-fragments = 4
; default-fragment-size-msec = 25

; enable-deferred-volume = yes
deferred-volume-safety-margin-usec = 1
; deferred-volume-extra-delay-usec = 0

Oi, Flávio! Eu fiz a alteração no bloco de notas e depois reiniciei, porém, quando eu verifico o pulse no monitor do sistema, consta “–daemonize=no”. Por quê será?

Testei por aqui e só está iniciando com pulseaudio --daemonize=yes, e você precisa encerrar o Pulseaudio com pulseaudio --kill antes de executar o primeiro comando.

Flávio, mas eu havia reiniciado depois da alteração. Mesmo assim seria necessário o --kill?

É porque ele mata o processo e inicia o mesmo com este o parâmetro. Infelizmente não sei o porque dele não iniciar com a configuração do daemon.conf.

Ok! Farei o seguinte então:

  • Vou usar o comando pulseaudio --kill
  • Vou alterar o arquivo de texto
  • Vou reiniciar a máquina

O Pulseaudio se inicia sozinho, não é necessário reiniciar. Também é possível setar o primeiro comando para iniciar quando se logar, basta ver lá no aplicativo sessão e inicialização da sua distro.

Ok! Vou terminar meu trabalho e já fazer o teste! Logo eu retorno aqui!
Mas quero agradecer muito pela sua atenção desde já! Isso é muito importante para mim!
Deus o abençoe, Flávio

Fiz a alteração e matei o processo. Será que está certo?
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, see http://www.gnu.org/licenses/.

Configuration file for the PulseAudio daemon. See pulse-daemon.conf(5) for
more information. Default values are commented out. Use either ; or # for
commenting.

daemonize = yes
; fail = yes
; allow-module-loading = yes
; allow-exit = yes
; use-pid-file = yes
; system-instance = no
; local-server-type = user
; enable-shm = yes
; enable-memfd = yes
; shm-size-bytes = 0 # setting this 0 will use the system-default, usually 64 MiB
; lock-memory = no
; cpu-limit = no

; high-priority = yes
; nice-level = -11

; realtime-scheduling = yes
; realtime-priority = 5

; exit-idle-time = 20
; scache-idle-time = 20

; dl-search-path = (depends on architecture)

; load-default-script-file = yes
; default-script-file = /etc/pulse/default.pa

; log-target = auto
; log-level = notice
; log-meta = no
; log-time = no
; log-backtrace = 0

; resample-method = speex-float-1
; avoid-resampling = false
; enable-remixing = yes
; remixing-use-all-sink-channels = yes
; enable-lfe-remixing = no
; lfe-crossover-freq = 0

flat-volumes = no

; rlimit-fsize = -1
; rlimit-data = -1
; rlimit-stack = -1
; rlimit-core = -1
; rlimit-as = -1
; rlimit-rss = -1
; rlimit-nproc = -1
; rlimit-nofile = 256
; rlimit-memlock = -1
; rlimit-locks = -1
; rlimit-sigpending = -1
; rlimit-msgqueue = -1
; rlimit-nice = 31
; rlimit-rtprio = 9
; rlimit-rttime = 200000

; default-sample-format = s16le
; default-sample-rate = 44100
; alternate-sample-rate = 48000
; default-sample-channels = 2
; default-channel-map = front-left,front-right

; default-fragments = 4
; default-fragment-size-msec = 25

; enable-deferred-volume = yes
deferred-volume-safety-margin-usec = 1
; deferred-volume-extra-delay-usec = 0

Será que estou alterando o arquivo certo? Quando eu verifico pelo monitor do sistema/pulseaudio/propriedades… ele continua com a mesma configuração.

Era pra ser, só que por algum motivo ele não está lendo o arquivo de configuração quando inicia.

Entendi! Acho que vou formatar e instalar o Pop_os 19 para testar.

Cara, andei fuçando aqui até que encontrei um jeito mais fácil de funcionar.
image
Bastou apenas eu desmarcar esta linha e adicionar o parâmetro desejado no arquivo client.conf lá em /etc/pulse


E aqui um print de como ele é mostrado no monitor do sistema. Desde já, vá me desculpando ai qualquer coisa.

Flávio! Estou pesquisando aqui um detalhe. não sei se tem relevância na questão de ativar e desativar automaticamente o pulseaudio.

IDLE TIMES

exit-idle-time = Encerra o daemon depois que o último cliente é encerrado e esse tempo em segundos se passa. Use um valor negativo para desativar esse recurso. O padrão é 20. A opção de linha de comando –exit-idle-time tem precedência.

scache-idle-time = Descarregar entradas de cache de amostra carregadas automaticamente após ficar inativo por esse tempo em segundos. O padrão é 20. A opção de linha de comando –scache-idle-time tem precedência.

Será que é o caminho para mudar esse liga e desliga?

Meu client.conf está assim:
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, see http://www.gnu.org/licenses/.

Configuration file for PulseAudio clients. See pulse-client.conf(5) for
more information. Default values are commented out. Use either ; or # for
commenting.

; default-sink =
; default-source =
; default-server =
; default-dbus-server =

; autospawn = yes
; daemon-binary = /usr/bin/pulseaudio
; extra-arguments = --log-target=syslog

; cookie-file =

; enable-shm = yes
; shm-size-bytes = 0 # setting this 0 will use the system-default, usually 64 MiB

; auto-connect-localhost = no
; auto-connect-display = no

Cara, pode ser também viu.

Oi, Flávio… ainda estou nessa luta, meu amigo… não consegui resolver isso ainda… Um colega do grupo do ubuntu me pediu para fazer esse arquivo… não sei se fiz certo… mas tbm não deu resultado… ainda acho que o segredo é parar o pulseaudio de hybernar.

Oi, Flávio! Demorei mas voltei! Consegui resolver o problema com a ajuda de um colega chamado Barnabé. Ele é dono do grupo Xiva Studio.
Eu, como não entendo de programação, fiz de maneira manual:

  • Abra o gerenciador de arquivos como admin

  • Vá em “etc/pulse/”

  • abra o arquivo “default.pa”

  • Coloque um # em frente a linha

Automatically suspend sinks/sources that become idle for too long

load-module module-suspend-on-idle

Assim:

Automatically suspend sinks/sources that become idle for too long

#load-module module-suspend-on-idle

  • Reiniciar o pulseaudio com o comando
    pulseaudio -k

-Pronto! Agora o pulse fica ligado direto

Obs: Fiz esse comando no terminal:
echo N | sudo tee /sys/module/snd_hda_intel/parameters/power_save_controller

p/ desligar o modulo de economia de energia da placa de audio intel

Que essas informações ajudem a todos que procuram!
Obrigado, Flávio!

2 curtidas