LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 12-28-2020, 11:24 AM   #1
ricky_cardo
Member
 
Registered: Feb 2006
Location: Syracuse, NY
Distribution: Slackware64-Current
Posts: 210

Rep: Reputation: 76
pulseaudio (100%) on logout [i3wm]


Pulseaudio often jumps to 100% CPU util when I logout of i3 and return to runlevel3 (tty).

Run level 3 (startx)
Clean install of slackware64-current (5.10.3)
-addition of (i3-wm) (dmenu i3status)
(clean install as I had loads of old . files from 4 years of junk wanted a clean start I have backup)

I did not want to resurrect and old thread but it is note worthy.. (for some reading)

https://www.linuxquestions.org/quest...wn-4175659529/

Is there a suggested way to ensure pulseaudio shutsdown better than
Code:
/bin/kill -SIGINT $(/usr/bin/pgrep pulseaudio)
Maybe a suggested place to put it?
I'm green (don't full understand) on using /etc/rc.d/rc.pulseaudio and see the warning at the top. Is this the right scenario to use?

Last edited by ricky_cardo; 12-29-2020 at 08:23 AM. Reason: clarification
 
Old 12-28-2020, 11:51 AM   #2
Tonus
Senior Member
 
Registered: Jan 2007
Location: Paris, France
Distribution: Slackware-15.0
Posts: 1,405
Blog Entries: 3

Rep: Reputation: 514Reputation: 514Reputation: 514Reputation: 514Reputation: 514Reputation: 514
Your /etc/rc.d/rc.pulseaudio seems to be executable and should not : the rc script is intended to run pulseaudio as root and it should be runned by user. First try to change executable flag and reboot. As root :
Code:
chmod -x /etc/rc.d/rc.pulseaudio
reboot

Last edited by Tonus; 12-28-2020 at 11:51 AM. Reason: typo
 
1 members found this post helpful.
Old 12-28-2020, 01:45 PM   #3
ricky_cardo
Member
 
Registered: Feb 2006
Location: Syracuse, NY
Distribution: Slackware64-Current
Posts: 210

Original Poster
Rep: Reputation: 76
Quote:
Originally Posted by Tonus View Post
Your /etc/rc.d/rc.pulseaudio seems to be executable and should not : the rc script is intended to run pulseaudio as root and it should be runned by user. First try to change executable flag and reboot. As root :
Code:
chmod -x /etc/rc.d/rc.pulseaudio
reboot
I did not yet set it to be executable (it's still in the default state) [Access: (0644/-rw-r--r--) ]

But to your suggestion I will not take this approach.

I better RTFM (see if there is a logout script for action{shift+e} maybe feed the kill pulseaudio there.

Last edited by ricky_cardo; 12-28-2020 at 01:53 PM. Reason: Researching
 
Old 12-28-2020, 01:58 PM   #4
Tonus
Senior Member
 
Registered: Jan 2007
Location: Paris, France
Distribution: Slackware-15.0
Posts: 1,405
Blog Entries: 3

Rep: Reputation: 514Reputation: 514Reputation: 514Reputation: 514Reputation: 514Reputation: 514
Last compilation of PulseAudio should be aware of logout with elogind as it was with CK2 (as stated in the changelog).

I use i3-gaps but didn't notice this behaviour.

What version of i3 and what hardware do you have ?

Anything in the logs ?
 
Old 12-28-2020, 04:41 PM   #5
tramtrist
Member
 
Registered: Jul 2018
Location: Cincinnati USA
Distribution: Slackware
Posts: 536

Rep: Reputation: 327Reputation: 327Reputation: 327Reputation: 327
I used to get this error all the time when exiting i3/i3-gaps. Disabling rc.pulse was the fix.

Last edited by tramtrist; 12-28-2020 at 04:41 PM. Reason: i3
 
Old 12-28-2020, 06:12 PM   #6
ricky_cardo
Member
 
Registered: Feb 2006
Location: Syracuse, NY
Distribution: Slackware64-Current
Posts: 210

Original Poster
Rep: Reputation: 76
I use i3 with i3 status but am going to check out i3-gaps. Maybe I should reboot after taking updates and see if the pulseaudio surprise persists. (I acutually did the clean install on 5.10.2 kernel and then ran slackpkg update-all after. (so perhaps I need a reboot)

-- I'll see if I can reproduce it after reboot

- I have been using i3 for a long time and the reason for the clean install is I started getting runaway xorg to where it was locking up keyboard. (mouse still worked)
- and I was able to ssh in and look at htop to see it.

Hardware:
Code:
rich@lemur ~ $ inxi -AG | inxi -A -G | inxi -b | inxi -c10 | inxi -FxxzJy90 | inxi -bay
System:
  Kernel: 5.10.3 x86_64 bits: 64 compiler: gcc v: 2.35.1-slack15) 
  parameters: root=PARTUUID=xxxxxx... 
  resume=PARTUUID=xxxxxx.... ro 
  initrd=\boot\initrd.gz 
  Desktop: i3 4.18.3 info: i3bar dm: startx Distro: Slackware 14.2 
Machine:
  Type: Laptop System: System76 product: Lemur v: lemu7 serial: <filter> 
  Chassis: type: 10 serial: <filter> 
  Mobo: System76 model: Lemur v: lemu7 serial: <filter> 
  UEFI: American Megatrends v: 1.05.25RSA2-1 date: 04/17/2018 
Battery:
  ID-1: BAT0 charge: 32.7 Wh condition: 32.7/45.3 Wh (72%) volts: 16.9/15.1 
  model: Notebook BAT type: Li-ion serial: <filter> status: Full 
CPU:
  Info: Dual Core Intel Core i7-7500U [MT MCP] arch: Amber Lake 
  speed: 3500 MHz min/max: 400/3500 MHz 
Graphics:
  Device-1: Intel HD Graphics 620 vendor: CLEVO/KAPOK driver: i915 v: kernel 
  bus ID: 00:02.0 chip ID: 8086:5916 
  Device-2: Acer BisonCam NB Pro type: USB driver: uvcvideo bus ID: 1-6:3 
  chip ID: 5986:1111 serial: <filter> 
  Display: server: X.Org 1.20.10 driver: intel unloaded: modesetting,vesa 
  alternate: fbdev display ID: :0 screens: 1 
  Screen-1: 0 s-res: 1920x1080 s-dpi: 96 s-size: 508x285mm (20.0x11.2") 
  s-diag: 582mm (22.9") 
  Monitor-1: eDP1 res: 1920x1080 hz: 60 dpi: 157 size: 310x170mm (12.2x6.7") 
  diag: 354mm (13.9") 
  OpenGL: renderer: Mesa Intel HD Graphics 620 (KBL GT2) v: 4.6 Mesa 20.3.1 
  direct render: Yes 
Network:
  Device-1: Intel Wireless 8260 driver: iwlwifi v: kernel port: f040 
  bus ID: 02:00.0 chip ID: 8086:24f3 
  Device-2: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet 
  vendor: CLEVO/KAPOK driver: r8169 v: kernel port: e000 bus ID: 03:00.1 
  chip ID: 10ec:8168 
Drives:
  Local Storage: total: 1.14 TiB used: 501.18 GiB (42.8%) 
Info:
  Processes: 149 Uptime: 19h 25m Memory: 15.44 GiB used: 1.82 GiB (11.8%) 
  Init: SysVinit v: 2.98 runlevel: 3 default: 3 Compilers: gcc: 10.2.0 
  alt: 10.2.0 clang: 11.0.0 Packages: pkgtool: 1573 lib: 215 rpm: 0 
  Shell: Bash running in: konsole inxi: 3.1.08 
rich@lemur ~ $ neofetch --stdout
rich@lemur.lehcar.duckdns.org 
----------------------------- 
OS: Slackware 14.2 x86_64 (post 14.2 -current) x86_64 
Host: Lemur lemu7 
Kernel: 5.10.3 
Uptime: 19 hours, 25 mins 
Packages: 1573 (pkgtool) 
Shell: bash 5.1.4 
Resolution: 1920x1080 
WM: i3 
Theme: GTK+ [GTK2], Adwaita [GTK3] 
Icons: Adwaita [GTK2/3] 
Terminal: konsole 
CPU: Intel i7-7500U (4) @ 3.500GHz 
GPU: Intel HD Graphics 620 
Memory: 1216MiB / 15806MiB
 
Old 12-28-2020, 06:35 PM   #7
ricky_cardo
Member
 
Registered: Feb 2006
Location: Syracuse, NY
Distribution: Slackware64-Current
Posts: 210

Original Poster
Rep: Reputation: 76
Still there, unfortunately.

Took a few iterations to reproduce.
pulseaudio back to 100%.

1. startx
2. firefox - youtube.com (listen to sound)
3. close browser
4. action [shift-E] (return to runlevel 3)


Issue of pulseaudio at 100% is there.
-going to test other WM fluxbox etc.

Last edited by ricky_cardo; 12-28-2020 at 08:58 PM. Reason: not fixed testing fluxbox
 
Old 12-28-2020, 08:58 PM   #8
ricky_cardo
Member
 
Registered: Feb 2006
Location: Syracuse, NY
Distribution: Slackware64-Current
Posts: 210

Original Poster
Rep: Reputation: 76
can reproduce in fluxbox
(did hard cancel CRTL-ALT-BACKSPACE)
 
Old 12-28-2020, 11:50 PM   #9
mumahendras3
Member
 
Registered: Feb 2018
Location: Indonesia
Distribution: Slackware-current + s6 + s6-rc + s6-linux-init (github.com/mumahendras3/sl6ckware)
Posts: 125

Rep: Reputation: Disabled
Quote:
Originally Posted by ricky_cardo View Post
4. action [shift-E] (return to runlevel 3)
When you said "return to runlevel 3" does that mean logging out of from the tty or just dropping back to the tty?

From the looks of it, I guess you probably just dropped back to the tty, which doesn't count as a "logout" that pulseaudio will get notified about by elogind, hence why it's still running and not killed. Try logging out from the tty after dropping back to it and see if pulseaudio get killed automatically (which it should be).

As for a way to kill pulseaudio automatically without logging out of tty after dropping from an X session using "startx", you probably want to add "pulseaudio -k" at the very end of your xinitrc and then drop the use of "exec" at the invocation of your window manager of choice in your xinitrc. This way, after you exit from your window manager, the execution of the xinitrc script continues which will then run the "pulseaudio -k" command, killing it as you drop back to tty.
 
2 members found this post helpful.
Old 12-29-2020, 07:27 AM   #10
ricky_cardo
Member
 
Registered: Feb 2006
Location: Syracuse, NY
Distribution: Slackware64-Current
Posts: 210

Original Poster
Rep: Reputation: 76
Yes just dropping back to the TTY.
--You are correct when I logout pulseaudio stops. (issue exit from tty) Also this is a good idea about adding something to then xinitrc I'll give it a try

Just seems like odd behavior in the default state:
-startx
-do something in x with sound
-logout of window manager (back to tty)
--pulseaudio ramps up to 100% CPU and stays there until asked nicely to stop...
Code:
/bin/kill -SIGINT $(/usr/bin/pgrep pulseaudio)

Thanks mumahendras3 (excellent idea this handles it well)
posting changes for others if needed:
cat .xinitrc

Code:
#!/bin/sh

userresources=$HOME/.Xresources
usermodmap=$HOME/.Xmodmap
sysresources=/etc/X11/xinit/.Xresources
sysmodmap=/etc/X11/xinit/.Xmodmap

# Merge in defaults and keymaps
[ -f $sysresources ] && /usr/bin/xrdb -merge $sysresources
[ -f $sysmodmap ] && /usr/bin/xmodmap $sysmodmap
[ -f $userresources ] && /usr/bin/xrdb -merge $userresources
[ -f $usermodmap ] && /usr/bin/xmodmap $usermodmap

# Start i3
if [ -z "$DESKTOP_SESSION" -a -x /usr/bin/ck-launch-session ]; then
    ck-launch-session dbus-launch --exit-with-session /usr/bin/i3
    pulseaudio -k
else
    /usr/bin/i3
    pulseaudio -k
fi

Last edited by ricky_cardo; 12-29-2020 at 08:00 AM. Reason: solved modified .xinitrc
 
Old 12-31-2020, 12:09 AM   #11
gsl
Member
 
Registered: Jun 2007
Location: Australia
Distribution: Slackware
Posts: 76

Rep: Reputation: 44
Disable module-gsettings

I have experienced the same thing on two laptops running current. I tried fluxbox and Xfce and it happened for both of them: if pulseaudio is started during the X session (eg., play an MP3, watch a video) as soon as I exit the WM back to the console the pulseaudio process pegs a CPU core at 100%.

It seems when pulseaudio starts in X, it spawns /usr/libexec/pulse/gsettings-helper. When you exit X, the gsettings-helper process is zombified and pulseaudio goes to 100% CPU. Even if I kill -9 the gsettings-helper process while in X, it also sends pulseaudio to 100% CPU.

So I tried making gsettings-helper non-executable and that seemed to fix the problem for me: pulseaudio no longer goes berserk when I exit X. The only side-effect seemed to be a couple of error messages in syslog.

As far as I can tell, gsettings-helper is part of pulse's module-gsettings which can be used to store config stuff and is used by the paprefs tool which a). isn't part of Slackware's pulseaudio package and b). the paprefs SlackBuild is at version 0.9.10 which doesn't use module-gsettings anyway (?) but uses module-gconf which is deprecated. (Slackware 14.2 has pulseaudio 9 with module-gconf, no module-gsettings. Slackware-current has pulseaudio 14 with module-gsettings, no module-gconf.)

So the final fix for me (so far) is to not load module-gsettings in /etc/pulse/default.pa.

Code:
### Load additional modules from GSettings. This can be configured with the paprefs tool.
### Please keep in mind that the modules configured by paprefs might conflict with manually
### loaded modules.
#.ifexists module-gsettings.so
#.nofail
#load-module module-gsettings
#.fail
#.endif
I still don't know why gsettings-helper doesn't exit properly.

Geoff.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't Get Sound from Pulseaudio -- PulseAudio Will Not Start JasonC10203 Linux - Software 4 11-28-2016 11:18 PM
Bypass pulseaudio problems and crashes when you don't have pulseaudio. Rinndalir Linux - Software 1 08-31-2016 01:00 PM
[Solved] i3wm, Pop-ups tadevokle Linux - Desktop 6 10-08-2011 05:34 PM
[SOLVED] Squeeze + Pulseaudio + Alsa and USB Midi device causes Pulseaudio crash mad4linux Debian 1 01-26-2011 03:57 AM
Winecfg crashes on sound tab with Pulseaudio and no 'sounddrivers' without pulseaudio William (Dthdealer) Linux - Software 5 06-13-2010 07:30 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 11:30 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration