Stop Pulseaudio temporarily

Optimize your system for ultimate performance.

Moderators: MattKingUSA, khz

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

Stop Pulseaudio temporarily

Post by khz »

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
  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".)
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

==> Route Pulseaudio to jack <==

https://github.com/brummer10/pajackconnect
qjackctl
Setup >> Options > [X] Run script after startup:

Code: Select all

/usr/bin/pajackconnect start 
Setup >> Options > [X] Execute script on Shutdown:

Code: Select all

/usr/bin/pajackconnect stop &
Setup >> Options > [X] Execute script after Shutdown:

Code: Select all

/usr/bin/pajackconnect reset &
http://bandshed.net/pdf/AVL2019UserManual.pdf JACK's L'il Helpers: pajackconnect and a2jmidid

or
  • there are several possibilities:
- Install "pulseaudio-module-jack"
- PulseAudio through JACK https://wiki.archlinux.org/index.php/Pu ... rough_JACK
- How use PulseAudio and JACK? >> http://jackaudio.org/faq/pulseaudio_and_jack.html
- WalkThrough_User_PulseOnJack >> https://github.com/jackaudio/jackaudio. ... ulseOnJack
- Using Qjackctl with jackd and pulseaudio >> viewtopic.php?p=58043#p58043
- pulseaudio_and_jack >> http://marzen.de/Holger/pulseaudio_and_jack/
- KXStudio : Applications : Cadence >> https://kx.studio/Applications:Cadence
- ... <== #)


####

(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 "seq"
  • Setup >> Settings > Advanced > "Server Prefix" select "jackd" 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: "pacmd load-module module-jack-source channels=2 && pacmd load-module module-jack-sink channels=2 && sleep 5 && a2j -e &" (a2j enables dbus) or "sleep 5 && a2jmidid -e &" (without dbus)
  • Setup >> Options > [X] Execute script on Shutdown: "pulseaudio --kill"
  • Setup >> Options > [X] Execute script after Shutdown: "killall jackd"
  • Setup >> Misc > [X] Provide support for ALSA sequencer

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 jackd && systemctl --user start pulseaudio.socket && systemctl --user start pulseaudio.service")
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: 702
Joined: Mon Feb 23, 2015 2:38 pm
Location: Holland

Re: Stop Pulseaudio temporarily

Post by Linuxmusician01 »

Thanks for the tip. Forgot about that. :)

martibs
Established Member
Posts: 43
Joined: Mon Oct 15, 2018 7:06 pm
Location: Oslo, Norway

Re: Stop Pulseaudio temporarily

Post by martibs »

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: 702
Joined: Mon Feb 23, 2015 2:38 pm
Location: Holland

Re: Stop Pulseaudio temporarily

Post by Linuxmusician01 »

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: 1903
Joined: Thu Nov 14, 2013 11:47 pm
Contact:

Re: Stop Pulseaudio temporarily

Post by sysrqer »

Stop and disable the service?

martibs
Established Member
Posts: 43
Joined: Mon Oct 15, 2018 7:06 pm
Location: Oslo, Norway

Re: Stop Pulseaudio temporarily

Post by martibs »

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: 1797
Joined: Sat Jun 11, 2016 12:05 am

Re: Stop Pulseaudio temporarily

Post by jonetsu »

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: 702
Joined: Mon Feb 23, 2015 2:38 pm
Location: Holland

Re: Stop Pulseaudio temporarily

Post by Linuxmusician01 »

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: 43
Joined: Mon Oct 15, 2018 7:06 pm
Location: Oslo, Norway

Re: Stop Pulseaudio temporarily

Post by martibs »

Code: Select all

sudo systemctl stop pulseaudio

martibs
Established Member
Posts: 43
Joined: Mon Oct 15, 2018 7:06 pm
Location: Oslo, Norway

Re: Stop Pulseaudio temporarily

Post by martibs »

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: 91
Joined: Wed Feb 07, 2018 9:31 pm
Contact:

Re: Stop Pulseaudio temporarily

Post by nikgnomicradio »

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

Post Reply