Stop Pulseaudio temporarily

Optimize your system for ultimate performance.

Moderators: khz, MattKingUSA

User avatar
khz
Established Member
Posts: 1139
Joined: Thu Apr 17, 2008 6:29 am
Location: German

Stop Pulseaudio temporarily

Postby khz » Sat Mar 02, 2019 9:18 am

Systemd - As a user
Stop:

Code: Select all

systemctl --user stop pulseaudio.socket && systemctl --user stop pulseaudio.service

Start:

Code: Select all

systemctl --user start pulseaudio.socket && systemctl --user start pulseaudio.service


or

pacmd - Reconfigure a PulseAudio sound server during runtime https://linux.die.net/man/1/pacmd

Code: Select all

apt-get install pulseaudio-utils

Code: Select all

pacmd suspend true


or

  1. As a user, not as root, copy the "client.conf" into your home directory:

    Code: Select all

    cp /etc/pulse/client.conf ~/.config/pulse/client.conf
  2. Change the entry in "~/.config/pulse/client.conf" from

    Code: Select all

    ; autospawn = yes

    to

    Code: Select all

    autospawn = no

    "no". The ";" out!

    ==>

      Code: Select all

      echo "autospawn = no" > ~/.config/pulse/client.conf
    (You don't need the entry "pulseaudio -k" in the "~/.bashrc".)

####

(Then:

(https://linux.die.net/man/1/jackd
==> Install "a2jmidid" and "pulseaudio-module-jack".
In qjackctl Setup:
Jack with a2jmidid and pulseaudio:
  • Setup >> Settings > Parameters > MIDI Drivers [none]
  • Setup >> Settings > Advanced > "Server Prefix" select "jackdmp" (multi-processor machines https://github.com/jackaudio/jack2/blob/master/README)
  • Setup >> Settings > Advanced > [X] Soft Mode
  • Setup >> Settings > Advanced > (RT) Priority (0 - 98)
  • Setup >> Options > [X] Run script after startup: "sleep 5 && a2j -e &" (a2j enables dbus) or "sleep 5 && a2jmidid -e &" (without dbus)
  • Setup >> Misc > [ ] ([none]) Provide support for ALSA sequencer
  • Setup >> Misc > [X] D-Bus interface Activation
  • Setup >> Misc > [X] Enable JACK D-Bus Interface
Optional:
  • Setup >> Settings > Advanced > [X] H/W Monitor
  • Setup >> Settings > Advanced > [X] H/W Meter
Jack without pulseaudio:
  • Setup >> Options > [X] Execute script at startup: "systemctl --user stop pulseaudio.socket && systemctl --user stop pulseaudio.service"
  • Setup >> Options > [X] Run script after shutdown: "killall -9 jackdbus && systemctl --user start pulseaudio.socket && systemctl --user start pulseaudio.service")

####

# ==> Route Pulseaudio to jack, there are several possibilities:
- Install "pulseaudio-module-jack"
- PulseAudio through JACK https://wiki.archlinux.org/index.php/PulseAudio/Examples#PulseAudio_through_JACK
- How use PulseAudio and JACK? >> http://jackaudio.org/faq/pulseaudio_and_jack.html
- WalkThrough_User_PulseOnJack >> https://github.com/jackaudio/jackaudio.github.com/wiki/WalkThrough_User_PulseOnJack
- Using Qjackctl with jackd and pulseaudio >> https://linuxmusicians.com/viewtopic.php?p=58043#p58043
- pulseaudio_and_jack >> http://marzen.de/Holger/pulseaudio_and_jack/
- ... <== #)
FZ - Does humor belongs in Music?
GNU/LINUX@AUDIO ~ /Wiki $ Howto.Info && GNU/Linux Debian installing >> Linux Audio Workstation LAW
    I don't care about the freedom of speech because I have nothing to say.

User avatar
Linuxmusician01
Established Member
Posts: 595
Joined: Mon Feb 23, 2015 2:38 pm
Location: Holland

Re: Stop Pulseaudio temporarily

Postby Linuxmusician01 » Sat Mar 02, 2019 12:34 pm

Thanks for the tip. Forgot about that. :)

martibs
Established Member
Posts: 19
Joined: Mon Oct 15, 2018 7:06 pm

Re: Stop Pulseaudio temporarily

Postby martibs » Fri Mar 08, 2019 11:13 am

For any Fedora users reading this: Pulseaudio is now (since F28, I believe) handled by systemd, and the autospawn parameter is not used.

User avatar
Linuxmusician01
Established Member
Posts: 595
Joined: Mon Feb 23, 2015 2:38 pm
Location: Holland

Re: Stop Pulseaudio temporarily

Postby Linuxmusician01 » Fri Mar 08, 2019 12:47 pm

martibs wrote:For any Fedora users reading this: Pulseaudio is now (since F28, I believe) handled by systemd, and the autospawn parameter is not used.

How do you stop PA from autospawning then?

User avatar
sysrqer
Established Member
Posts: 1814
Joined: Thu Nov 14, 2013 11:47 pm
Contact:

Re: Stop Pulseaudio temporarily

Postby sysrqer » Fri Mar 08, 2019 12:50 pm

Stop and disable the service?

martibs
Established Member
Posts: 19
Joined: Mon Oct 15, 2018 7:06 pm

Re: Stop Pulseaudio temporarily

Postby martibs » Fri Mar 08, 2019 1:04 pm

Linuxmusician01 wrote:How do you stop PA from autospawning then?

I guess you don't. If the process crashes, it autospawns. If you don't want it to run, you stop the service.

jonetsu
Established Member
Posts: 1428
Joined: Sat Jun 11, 2016 12:05 am

Re: Stop Pulseaudio temporarily

Postby jonetsu » Fri Mar 08, 2019 3:43 pm

Slight variation: you can create a client.conf file in ~/.config/pulse/ and write a single line in it (eg. no need to copy the client.conf file from /etc/) :

autospawn=no

Or even just do :

echo "autospawn=no" > ~/.config/pulse/client.conf
Last edited by jonetsu on Fri Mar 08, 2019 5:54 pm, edited 2 times in total.

User avatar
Linuxmusician01
Established Member
Posts: 595
Joined: Mon Feb 23, 2015 2:38 pm
Location: Holland

Re: Stop Pulseaudio temporarily

Postby Linuxmusician01 » Fri Mar 08, 2019 4:35 pm

martibs wrote:
Linuxmusician01 wrote:How do you stop PA from autospawning then?

I guess you don't. If the process crashes, it autospawns. If you don't want it to run, you stop the service.

Do you mean like?:

Code: Select all

sudo service pulseaudio stop

martibs
Established Member
Posts: 19
Joined: Mon Oct 15, 2018 7:06 pm

Re: Stop Pulseaudio temporarily

Postby martibs » Fri Mar 08, 2019 4:38 pm

Code: Select all

sudo systemctl stop pulseaudio

martibs
Established Member
Posts: 19
Joined: Mon Oct 15, 2018 7:06 pm

Re: Stop Pulseaudio temporarily

Postby martibs » Fri Mar 08, 2019 8:16 pm

Actually, scratch that: pulseaudio.service is run in the user context, so this is the correct way to stop it:

Code: Select all

$ systemctl --user stop pulseaudio

User avatar
nikgnomicradio
Established Member
Posts: 80
Joined: Wed Feb 07, 2018 9:31 pm
Contact:

Re: Stop Pulseaudio temporarily

Postby nikgnomicradio » Tue Mar 12, 2019 3:06 pm

why not just use:

Code: Select all

pacmd suspend true

that was enough to suspend Pulseaudio for starting JACK
used to be something i used in QjackCtl pre-start script,but do not need it now
D-Bus prevents any possible squabble between JACK and Pulseaudio


Return to “System Tuning and Configuration”

Who is online

Users browsing this forum: No registered users and 2 guests