You are not logged in.

#1 2019-12-30 20:40:25

miomio
Member
Registered: 2016-01-17
Posts: 167

Pulseaudio CPU usage 15-20%

Just wondering if there's anything I can do to improve CPU utilisation?

$ pulseaudio --dump-conf
### Read from configuration file: /etc/pulse/daemon.conf ###
daemonize = no
fail = yes
high-priority = yes
nice-level = -11
realtime-scheduling = yes
realtime-priority = 5
allow-module-loading = yes
allow-exit = yes
use-pid-file = yes
system-instance = no
local-server-type = user
cpu-limit = no
enable-shm = yes
flat-volumes = no
lock-memory = no
exit-idle-time = 20
scache-idle-time = 20
dl-search-path = /usr/lib/pulse-13.0/modules
default-script-file = /etc/pulse/default.pa
load-default-script-file = yes
log-target = 
log-level = notice
resample-method = auto
avoid-resampling = no
enable-remixing = yes
remixing-use-all-sink-channels = yes
enable-lfe-remixing = no
lfe-crossover-freq = 0
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 = 8000
deferred-volume-extra-delay-usec = 0
shm-size-bytes = 0
log-meta = no
log-time = no
log-backtrace = 0
rlimit-fsize = -1
rlimit-data = -1
rlimit-stack = -1
rlimit-core = -1
rlimit-rss = -1
rlimit-as = -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

$ pacmd list-sinks
2 sink(s) available.
  * index: 0
	name: <alsa_output.usb-Focusrite_Scarlett_2i4_USB-00.analog-surround-40>
	driver: <module-alsa-card.c>
	flags: HARDWARE DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
	state: IDLE
	suspend cause: (none)
	priority: 9049
	volume: front-left: 65536 / 100% / 0.00 dB,   front-right: 65536 / 100% / 0.00 dB,   rear-left: 65536 / 100% / 0.00 dB,   rear-right: 65536 / 100% / 0.00 dB
	        balance 0.00
	base volume: 65536 / 100% / 0.00 dB
	volume steps: 65537
	muted: no
	current latency: 46.86 ms
	max request: 27 KiB
	max rewind: 27 KiB
	monitor source: 0
	sample spec: s32le 4ch 44100Hz
	channel map: front-left,front-right,rear-left,rear-right
	             Surround 4.0
	used by: 0
	linked by: 1
	configured latency: 40.00 ms; range is 0.50 .. 1486.08 ms
	card: 0 <alsa_card.usb-Focusrite_Scarlett_2i4_USB-00>
	module: 6
	properties:
		alsa.resolution_bits = "32"
		device.api = "alsa"
		device.class = "sound"
		alsa.class = "generic"
		alsa.subclass = "generic-mix"
		alsa.name = "USB Audio"
		alsa.id = "USB Audio"
		alsa.subdevice = "0"
		alsa.subdevice_name = "subdevice #0"
		alsa.device = "0"
		alsa.card = "0"
		alsa.card_name = "Scarlett 2i4 USB"
		alsa.long_card_name = "Focusrite Scarlett 2i4 USB at usb-0000:00:14.0-4.1, high speed"
		alsa.driver_name = "snd_usb_audio"
		device.bus_path = "pci-0000:00:14.0-usb-0:4.1:1.0"
		sysfs.path = "/devices/pci0000:00/0000:00:14.0/usb1/1-4/1-4.1/1-4.1:1.0/sound/card0"
		udev.id = "usb-Focusrite_Scarlett_2i4_USB-00"
		device.bus = "usb"
		device.vendor.id = "1235"
		device.vendor.name = "Focusrite-Novation"
		device.product.id = "8200"
		device.product.name = "Scarlett 2i4 USB"
		device.serial = "Focusrite_Scarlett_2i4_USB"
		device.string = "surround40:0"
		device.buffering.buffer_size = "1048576"
		device.buffering.fragment_size = "524288"
		device.access_mode = "mmap+timer"
		device.profile.name = "analog-surround-40"
		device.profile.description = "Analog Surround 4.0"
		device.description = "Scarlett 2i4 USB Analog Surround 4.0"
		alsa.mixer_name = "USB Mixer"
		alsa.components = "USB1235:8200"
		module-udev-detect.discovered = "1"
		device.icon_name = "audio-card-usb"
	ports:
		analog-output: Analog Output (priority 9900, latency offset 0 usec, available: unknown)
			properties:
				
	active port: <analog-output>
    index: 18
	name: <alsa_output.pci-0000_00_1f.3.hdmi-stereo-extra1>
	driver: <module-alsa-card.c>
	flags: HARDWARE DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
	state: RUNNING
	suspend cause: (none)
	priority: 9030
	volume: front-left: 65507 / 100% / -0.01 dB,   front-right: 65507 / 100% / -0.01 dB
	        balance 0.00
	base volume: 65536 / 100% / 0.00 dB
	volume steps: 65537
	muted: no
	current latency: 23.52 ms
	max request: 4 KiB
	max rewind: 4 KiB
	monitor source: 20
	sample spec: s16le 2ch 44100Hz
	channel map: front-left,front-right
	             Stereo
	used by: 1
	linked by: 3
	configured latency: 23.22 ms; range is 0.50 .. 2000.00 ms
	card: 1 <alsa_card.pci-0000_00_1f.3>
	module: 7
	properties:
		alsa.resolution_bits = "16"
		device.api = "alsa"
		device.class = "sound"
		alsa.class = "generic"
		alsa.subclass = "generic-mix"
		alsa.name = "HDMI 1"
		alsa.id = "HDMI 1"
		alsa.subdevice = "0"
		alsa.subdevice_name = "subdevice #0"
		alsa.device = "7"
		alsa.card = "1"
		alsa.card_name = "HDA Intel PCH"
		alsa.long_card_name = "HDA Intel PCH at 0xdc140000 irq 127"
		alsa.driver_name = "snd_hda_intel"
		device.bus_path = "pci-0000:00:1f.3"
		sysfs.path = "/devices/pci0000:00/0000:00:1f.3/sound/card1"
		device.bus = "pci"
		device.vendor.id = "8086"
		device.vendor.name = "Intel Corporation"
		device.product.id = "9d70"
		device.product.name = "Sunrise Point-LP HD Audio"
		device.form_factor = "internal"
		device.string = "hdmi:1,1"
		device.buffering.buffer_size = "352800"
		device.buffering.fragment_size = "176400"
		device.access_mode = "mmap+timer"
		device.profile.name = "hdmi-stereo-extra1"
		device.profile.description = "Digital Stereo (HDMI 2)"
		device.description = "Built-in Audio Digital Stereo (HDMI 2)"
		alsa.mixer_name = "Realtek ALC298"
		alsa.components = "HDA:10ec0298,17aa224b,00100103 HDA:80862809,80860101,00100000"
		module-udev-detect.discovered = "1"
		device.icon_name = "audio-card-pci"
	ports:
		hdmi-output-1: HDMI / DisplayPort 2 (priority 5800, latency offset 0 usec, available: yes)
			properties:
				device.icon_name = "video-display"
				device.product.name = "ASUS VC239"
	active port: <hdmi-output-1>

I've run these commands while seeing the CPU use in htop.

EDIT:

I'm also keen to output audio to both HDMI sinks, i.e. to both monitors (dual external monitor setup). Is that possible?

Last edited by miomio (2019-12-30 21:17:39)

Offline

#2 2019-12-30 21:03:27

Zibi1981
Member
From: Poland
Registered: 2008-01-31
Posts: 628

Re: Pulseaudio CPU usage 15-20%

Why do you have configured your Pulse Audio to

default-sample-format = s16le
default-sample-rate = 44100
alternate-sample-rate = 48000
default-sample-channels = 2

when your Focusrite Scarlett 2i4 USB is capable of

sample spec: s32le 4ch 44100Hz

?

Also why using

resample-method = auto

instead of defining one method strictly?


"... being a Linux user is sort of like living in a house inhabited by a large family of carpenters and architects. Every morning when you wake up, the house is a little different. Maybe there is a new turret, or some walls have moved. Or perhaps someone has temporarily removed the floor under your bed."

MSI Raider GE78HX 13VI-032PL

Offline

#3 2019-12-30 21:16:35

miomio
Member
Registered: 2016-01-17
Posts: 167

Re: Pulseaudio CPU usage 15-20%

I didn't configure those. Thanks for spotting, what would you suggest?

Last edited by miomio (2019-12-30 21:35:12)

Offline

#4 2019-12-30 22:02:25

Zibi1981
Member
From: Poland
Registered: 2008-01-31
Posts: 628

Re: Pulseaudio CPU usage 15-20%

If your system is capable of sampling audio files in s32le format and you make use of all four channels, then I would change those two settings in your ~/.config/pulse/daemon.conf, i.e.

default-sample-format = s32le
default-sample-rate = 44100
alternate-sample-rate = 48000
default-sample-channels = 4
default-channel-map = front-left,front-right,rear-left,rear-right

When it comes to resampling algorithm it depends on how powerful you CPU is. AFAIK the best in Pulse Audio are soxr-vhq and speex-float-10, but they require more CPU power. Also soxr-hq or speex-float-5 seem to be decent enough for most people and less CPU consuming. You have to uncomment and edit proper entry in ~/.config/pulse/daemon.conf, i.e.

resample-method = soxr-vhq

After saving changes you need to reboot your system or just Pulse Audio server

$ pulseaudio -k
$ pulseaudio --start

Last edited by Zibi1981 (2019-12-30 22:03:05)


"... being a Linux user is sort of like living in a house inhabited by a large family of carpenters and architects. Every morning when you wake up, the house is a little different. Maybe there is a new turret, or some walls have moved. Or perhaps someone has temporarily removed the floor under your bed."

MSI Raider GE78HX 13VI-032PL

Offline

#5 2019-12-30 23:11:26

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,425

Re: Pulseaudio CPU usage 15-20%

Post

pacmd list-sink-inputs

during the issue. Also since you seem to want to use HDMI, what's your graphics card/driver ?

@Zibi
The default configs are just "suggestions". It will ultimately use what it shows as the sample spec, regardless of the defaults configured, based on what the hardware reports. That config change will have no "real world" impact.

That said I also expect the auto resample-method parameter to be suboptimal here, it will go with the first that's available which can be slow as hell in this context, so yes I'd go with an explicit speex or soxr variant.

Last edited by V1del (2019-12-30 23:48:31)

Offline

#6 2019-12-30 23:46:33

miomio
Member
Registered: 2016-01-17
Posts: 167

Re: Pulseaudio CPU usage 15-20%

$ pacmd list-sink-inputs
3 sink input(s) available.
    index: 0
	driver: <module-combine-sink.c>
	flags: VARIABLE_RATE DONT_MOVE NO_CREATE_SUSPEND 
	state: RUNNING
	sink: 0 <alsa_output.usb-Focusrite_Scarlett_2i4_USB-00.analog-surround-40>
	volume: front-left: 45875 /  70% / -9.29 dB,   front-center: 45875 /  70% / -9.29 dB,   front-right: 45875 /  70% / -9.29 dB,   rear-center: 45875 /  70% / -9.29 dB
	        balance 0.00
	muted: no
	current latency: 0.00 ms
	requested latency: 40.00 ms
	sample spec: s32le 4ch 44100Hz
	channel map: front-left,front-center,front-right,rear-center
	resample method: trivial
	module: 13
	properties:
		media.name = "Simultaneous output on Scarlett 2i4 USB Analog Surround 4.0"
		media.role = "filter"
		module-stream-restore.id = "sink-input-by-media-role:filter"
    index: 4
	driver: <module-combine-sink.c>
	flags: VARIABLE_RATE DONT_MOVE NO_CREATE_SUSPEND 
	state: RUNNING
	sink: 3 <alsa_output.pci-0000_00_1f.3.hdmi-stereo-extra3>
	volume: front-left: 65536 / 100% / 0.00 dB,   front-center: 65536 / 100% / 0.00 dB,   front-right: 65536 / 100% / 0.00 dB,   rear-center: 65536 / 100% / 0.00 dB
	        balance 0.00
	muted: no
	current latency: 0.00 ms
	requested latency: 40.00 ms
	sample spec: s32le 4ch 43993Hz
	channel map: front-left,front-center,front-right,rear-center
	resample method: trivial
	module: 13
	properties:
		media.name = "Simultaneous output on Built-in Audio Digital Stereo (HDMI 4)"
		media.role = "filter"
		module-stream-restore.id = "sink-input-by-media-role:filter"
    index: 80
	driver: <protocol-native.c>
	flags: START_CORKED 
	state: RUNNING
	sink: 3 <alsa_output.pci-0000_00_1f.3.hdmi-stereo-extra3>
	volume: front-left: 51773 /  79% / -6.14 dB,   front-right: 51773 /  79% / -6.14 dB
	        balance 0.00
	muted: no
	current latency: 38.73 ms
	requested latency: 23.22 ms
	sample spec: float32le 2ch 44100Hz
	channel map: front-left,front-right
	             Stereo
	resample method: copy
	module: 11
	client: 11 <Brave>
	properties:
		application.icon_name = "chromium-browser"
		media.name = "Playback"
		application.name = "Brave"
		native-protocol.peer = "UNIX socket client"
		native-protocol.version = "33"
		application.process.id = "1146"
		application.process.user = "laptopuser"
		application.process.host = "laptop"
		application.process.binary = "brave"
		application.language = "en_GB.UTF-8"
		window.x11.display = ":0.0"
		application.process.machine_id = "b277a175d25a4df3a88fefbe478474b1"
		application.process.session_id = "1"
		module-stream-restore.id = "sink-input-by-application-name:Brave"

I don't seem to want to use HDMI, I am using HDMI audio output for my in-built monitor speaker, and this works find for single output via pavucontrol, but what I'd like to do is be able to output audio to both external monitors but this option is not available in pavucontrol. I have tried to use paprefs for simultaneous output to two sinks, but this only results in audio from one source (e.g. youtube via brave-browser) to one monitor+focusrite headphones.

I'm using the intel-media-driver/iHD (I think!):

$ grep -iE 'vdpau | dri driver' /var/log/Xorg.0.log 
[  1478.260] (II) intel(0): [DRI2]   DRI driver: i965
[  1478.260] (II) intel(0): [DRI2]   VDPAU driver: va_gl
...

 vainfo
vainfo: VA-API version: 1.5 (libva 2.5.0)
vainfo: Driver version: Intel iHD driver - 1.0.0
...

Offline

#7 2019-12-30 23:51:33

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,425

Re: Pulseaudio CPU usage 15-20%

Yes, trivial is not what you want, change that to something sensible, as Zibi mentioned.

It's not guaranteed that output to two monitors at the same time is possible, this is often hardware limited. Can you post

aplay -lL

?

Offline

#8 2019-12-31 00:03:18

miomio
Member
Registered: 2016-01-17
Posts: 167

Re: Pulseaudio CPU usage 15-20%

I already changed that setting so not sure why it is showing up as trivial:

$ grep resample ~/.config/pulse/daemon.conf 
resample-method = soxr-vhq
$ pulseaudio --dump-conf | grep resample
resample-method = soxr-vhq

And:

$ aplay -lL
null
    Discard all samples (playback) or generate zero samples (capture)
jack
    JACK Audio Connection Kit
default
    Default ALSA Output (currently PulseAudio Sound Server)
sysdefault:CARD=USB
    Scarlett 2i4 USB, USB Audio
    Default Audio Device
front:CARD=USB,DEV=0
    Scarlett 2i4 USB, USB Audio
    Front speakers
surround21:CARD=USB,DEV=0
    Scarlett 2i4 USB, USB Audio
    2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=USB,DEV=0
    Scarlett 2i4 USB, USB Audio
    4.0 Surround output to Front and Rear speakers
surround41:CARD=USB,DEV=0
    Scarlett 2i4 USB, USB Audio
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=USB,DEV=0
    Scarlett 2i4 USB, USB Audio
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=USB,DEV=0
    Scarlett 2i4 USB, USB Audio
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=USB,DEV=0
    Scarlett 2i4 USB, USB Audio
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
usbstream:CARD=USB
    Scarlett 2i4 USB
    USB Stream Output
sysdefault:CARD=PCH
    HDA Intel PCH, ALC298 Analog
    Default Audio Device
front:CARD=PCH,DEV=0
    HDA Intel PCH, ALC298 Analog
    Front speakers
surround21:CARD=PCH,DEV=0
    HDA Intel PCH, ALC298 Analog
    2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=PCH,DEV=0
    HDA Intel PCH, ALC298 Analog
    4.0 Surround output to Front and Rear speakers
surround41:CARD=PCH,DEV=0
    HDA Intel PCH, ALC298 Analog
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=PCH,DEV=0
    HDA Intel PCH, ALC298 Analog
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=PCH,DEV=0
    HDA Intel PCH, ALC298 Analog
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=PCH,DEV=0
    HDA Intel PCH, ALC298 Analog
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
hdmi:CARD=PCH,DEV=0
    HDA Intel PCH, HDMI 0
    HDMI Audio Output
hdmi:CARD=PCH,DEV=1
    HDA Intel PCH, HDMI 1
    HDMI Audio Output
hdmi:CARD=PCH,DEV=2
    HDA Intel PCH, HDMI 2
    HDMI Audio Output
hdmi:CARD=PCH,DEV=3
    HDA Intel PCH, HDMI 3
    HDMI Audio Output
hdmi:CARD=PCH,DEV=4
    HDA Intel PCH, HDMI 4
    HDMI Audio Output
usbstream:CARD=PCH
    HDA Intel PCH
    USB Stream Output
**** List of PLAYBACK Hardware Devices ****
card 0: USB [Scarlett 2i4 USB], device 0: USB Audio [USB Audio]
  Subdevices: 0/1
  Subdevice #0: subdevice #0
card 1: PCH [HDA Intel PCH], device 0: ALC298 Analog [ALC298 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: PCH [HDA Intel PCH], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: PCH [HDA Intel PCH], device 7: HDMI 1 [HDMI 1]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: PCH [HDA Intel PCH], device 8: HDMI 2 [HDMI 2]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: PCH [HDA Intel PCH], device 9: HDMI 3 [HDMI 3]
  Subdevices: 0/1
  Subdevice #0: subdevice #0
card 1: PCH [HDA Intel PCH], device 10: HDMI 4 [HDMI 4]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

Offline

#9 2019-12-31 00:40:42

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,425

Re: Pulseaudio CPU usage 15-20%

Good you have distinct pcms. with nothing playing, can you do in two distinct terminals

pasuspender speaker-test -c2 -Dhw:1,3
pasuspender speaker-test -Dhw:1,$correctNumber #Whatever the correct device for your second screen is, either trial error or check the detected profiles in pulse

If these work at the same time you could define an additional profile path in /usr/share/pulseaudio/alsa-mixer/profile-sets/default.conf (e.g. look at the example commented out at the end of the file you will want something like

[Profile output:hdmi-stereo-extra3+output:hdmi-stereo-extra$correctNumber+input:analog-stereo]
description = Combined HDMI sinks
output-mappings = hdmi-stereo-extra3 hdmi-stereo-extra$correctNumber
input-mappings = analog-stereo

(replace $correctNumber with what you've identified)
That should give you a new profile, where you should get two distinct sinks which can then be combined by the combined module.

Offline

#10 2019-12-31 01:16:22

miomio
Member
Registered: 2016-01-17
Posts: 167

Re: Pulseaudio CPU usage 15-20%

pasuspender -- speaker-test -c2 -Dhw:1,7
...

pasuspender -- speaker-test -Dhw:1,9

speaker-test 1.2.1

Playback device is hw:1,9
Stream parameters are 48000Hz, S16_LE, 1 channels
Using 16 octaves of pink noise
Channels count (1) not available for playbacks: Invalid argument
Setting of hwparams failed: Invalid argument

So this is limited by hw then?

Do you have any idea about the resample-method being trivial when soxr-vhq is specifically set in config?

Offline

#11 2019-12-31 01:20:21

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,425

Re: Pulseaudio CPU usage 15-20%

Whoops no I forgot the -c2 in the second command.

resample-method trivial is afaik in this case with the combined sink normal, you will want to explicitly configure one and/or look through the local config and add a resample_method= argument to the combined-sink module-load

Offline

#12 2019-12-31 02:12:37

miomio
Member
Registered: 2016-01-17
Posts: 167

Re: Pulseaudio CPU usage 15-20%

Well in that case adding the `-c2` produces audio on both monitors.

[Profile output:hdmi-stereo-extra7+output:hdmi-stereo-extra9+input:analog-stereo]
description = Combined HDMI sinks
output-mappings = hdmi-stereo-extra7 hdmi-stereo-extra9
input-mappings = analog-stereo

Then `pulsaudio -k && pulseaudio --start` results in pavucontrol > configuration not detecting either the 2i4 or Built-in Audio profile selectors so there's something wrong with this config, V1del.

FWIW, in pavucontrol > Configuration, under Build-in Audio it is both the 'Digital Stereo (HDMI X) Output [+ Analogue Stereo Input]' where X = 2 and 4 that are my L and R monitors audio output profiles, i.e. selecting these outputs audio to one or the other monitor.

If PA is using /usr/share/pulseaudio/alsa-mixer/profile-sets/default.conf as these profile definitions then the configs for my L and R monitors is preconfigured as:

[Mapping hdmi-stereo-extra3]
description = Digital Stereo (HDMI 4)
device-strings = hdmi:%f,3
paths-output = hdmi-output-3
channel-map = left,right
priority = 7
direction = output

[Mapping hdmi-stereo-extra1]
description = Digital Stereo (HDMI 2)
device-strings = hdmi:%f,1
paths-output = hdmi-output-1
channel-map = left,right
priority = 7
direction = output

But in the `speaker-test` command above, it is hw:1,{7,9} that produce pink noise not hw:1,{1,3}. I see the above preconfigured mapping uses hdmi:1,{1,3} - I'd have thought 7 & 9 would be used. What's this all about? Should I be adjusting your code as:

[Profile output:hdmi-stereo-extra1+output:hdmi-stereo-extra3+input:analog-stereo]
description = Combined HDMI sinks
output-mappings = hdmi-stereo-extra1 hdmi-stereo-extra3
device-strings = hdmi:%f,7+hdmi:%f,9
input-mappings = analog-stereo

?

Last edited by miomio (2019-12-31 02:17:14)

Offline

#13 2019-12-31 11:43:09

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,425

Re: Pulseaudio CPU usage 15-20%

Hmm that's weird but yes just reuse those that pulse shows to be available. If you'd want to define your own you would have to create a Mapping before setting a profile and an appropriate hdmi-output in /usr/share/pulseaudio/alsa-mixer/paths/

But it will be easier to just combine those that pulse shows to be available, so do

[Profile output:hdmi-stereo-extra3+output:hdmi-stereo-extra1+input:analog-stereo]
description = Combined HDMI sinks
output-mappings = hdmi-stereo-extra3 hdmi-stereo-extra1
input-mappings = analog-stereo

instead then. (Though I'm also unsure as to how stable that is, afaik what pulse enumerates as first/Second/whatever HDMI can also be random depending on the udev detection race.)

Last edited by V1del (2019-12-31 11:44:51)

Offline

#14 2019-12-31 14:29:54

miomio
Member
Registered: 2016-01-17
Posts: 167

Re: Pulseaudio CPU usage 15-20%

So restarting pulseaudio, then in pavucontrol > Configuration I select "Combined HDMI sinks" under 'Built-in Audio'. Then when playing YT via Brave-browser, I can select either HDMI 2 or 4, but I don't have an option to play to both.

So the config works, and seems to have brought me closer to dual monitor audio output but not completely.

EDIT:

Via paprefs I have selected Simultaneous Output > Add virtual output device for simultaneous output on all local sound cards.

Then in pavucontrol > Playback I can select Brave to output on the simultaneous output sink, and so long as I output to HDMI 4 and 2 on two of the three (three because of the 2i4) playback devices on the simultaneous device then it gives dual output to both monitors. I have to mute the third output to the 2i4 if I want to use the 2i4 headphones for a different use.

So this solves the dual audio output, but not the CPU issue which has increased to ~30-35%.

Last edited by miomio (2019-12-31 14:42:36)

Offline

#15 2020-01-02 19:42:58

Zibi1981
Member
From: Poland
Registered: 2008-01-31
Posts: 628

Re: Pulseaudio CPU usage 15-20%

I'm not sure, but using soxr-vhq as a default resampling algorith might have contributed to the observerd increased in CPU load, as I stated before.


"... being a Linux user is sort of like living in a house inhabited by a large family of carpenters and architects. Every morning when you wake up, the house is a little different. Maybe there is a new turret, or some walls have moved. Or perhaps someone has temporarily removed the floor under your bed."

MSI Raider GE78HX 13VI-032PL

Offline

#16 2020-01-03 23:44:36

miomio
Member
Registered: 2016-01-17
Posts: 167

Re: Pulseaudio CPU usage 15-20%

Already used soxr-{vhq,hq} and ffmpeg, but no dramatic reduction. Anyway, isn't this relevant:

$ pacmd list-sink-inputs | grep -i 'resample method'
	resample method: trivial
	resample method: trivial
	resample method: trivial
	resample method: copy

$ pulseaudio --dump-conf | grep -i resample
resample-method = ffmpeg

Last edited by miomio (2020-01-03 23:45:23)

Offline

#17 2020-01-04 00:28:03

Ropid
Member
Registered: 2015-03-09
Posts: 1,069

Re: Pulseaudio CPU usage 15-20%

According to the man-page, that "trivial" you are using is already the thing that's using the least CPU.

About why you see "trivial", I guess that the "ffmpeg" you seem to have configured does not work, and then pulseaudio perhaps decided to fall back to "trivial".

Here's what I see while experimenting with things a bit:

$ pacmd list-sink-inputs | grep -i 'resample method'
	resample method: copy
	resample method: speex-float-5

$ pulseaudio --dump-conf | grep -i resample
resample-method = speex-float-5

So for me here, it does use the resample method that I have configured which is "speex-float-5".

Offline

#18 2020-01-04 00:54:23

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,425

Re: Pulseaudio CPU usage 15-20%

don't use ffmpeg as your default, it's literally the worst for this, switch that to speex-float-5

You are seeing trivial because that's the default for the combine sink, to circumvent that disable the checkbox in plasma and define your own combine-sink (with the added benefit that you can explicitly define it to be limited to your HDMI sources which will likely drastically decrease the necessary resampling overhead if it doesn't have to account for the USB headset)

I don't think that trivial is implicitly the issue here, it's simply quite a CPU intensive operation to properly sync this up. What's your CPU?

Offline

#19 2020-01-04 08:14:15

kokoko3k
Member
Registered: 2008-11-14
Posts: 2,390

Re: Pulseaudio CPU usage 15-20%

Is the high cpu use an issue only when playing audio?
And if yes, does it happen with all applications? Maybe they're asking for a low latency playback?

Last edited by kokoko3k (2020-01-04 08:15:13)


Help me to improve ssh-rdp !
Retroarch User? Try my koko-aio shader !

Offline

#20 2020-01-04 13:41:03

miomio
Member
Registered: 2016-01-17
Posts: 167

Re: Pulseaudio CPU usage 15-20%

I haven't tried *all* resample methods being reported by `pulseaudio --dump-resample-methods`, just soxr-{mq,hq,vhq}, speex-float-5, ffmpeg. So far, Pulse is consistently falling back to trivial/copy. Is there an extra library I should install? Seems to be a trend here so far.

@Ropid - thanks. That answers it. Btw, did you do a `pulseaudio -k && pulseaudio --start` between changing the resample-method or did pulse automatically detect the change?

@V1del - It's i5-6300U. I am using XFCE4 and have gtk & qt packages installed. Is there an alternative to plasma-pa package for my desktop that will expose that option you describe because plasma-pa wants to bring in a load of kde deps.

@kokoko3k - I'm so far only testing with YouTube playback via Brave, but I will check. If other applications don't, do you suggest some configuration to tell PA not to give low-latency playback for given applications and if so how would you configure that?

Offline

#21 2020-01-04 14:20:14

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,425

Re: Pulseaudio CPU usage 15-20%

Do you have high CPU usage if you play back to a normal sink without going over the combine sink ?

Yes you have to restart  pulse for changes in the configs to take effect, the more preferred way in newer times is using

systemctl --user restart pulseaudio

so that you keep systemd/user services aware.

On the resample methods, getting copy or null is "the best" as these mean no resampling. If you have to resample (again assuming normal playback to a non combined sink...) you should see what you've configured.

As mentioned, don't use plasma-pa or any GUI tool for this, disable the checkbox (in plasma-pa), edit /etc/pulse/default.pa and add a load-module module-combine-sink according to the specification I posted. If you repost

pacmd list-sinks

I could give you the proper line so that it will only cover your HDMIs.

Offline

#22 2020-01-05 12:29:36

miomio
Member
Registered: 2016-01-17
Posts: 167

Re: Pulseaudio CPU usage 15-20%

Yes - 15-20%.

$ pacmd list-sinks
3 sink(s) available.
  * index: 0
	name: <alsa_output.usb-Focusrite_Scarlett_2i4_USB-00.analog-surround-40>
	driver: <module-alsa-card.c>
	flags: HARDWARE DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
	state: RUNNING
	suspend cause: (none)
	priority: 9049
	volume: front-left: 65536 / 100% / 0.00 dB,   front-right: 65536 / 100% / 0.00 dB,   rear-left: 65536 / 100% / 0.00 dB,   rear-right: 65536 / 100% / 0.00 dB
	        balance 0.00
	base volume: 65536 / 100% / 0.00 dB
	volume steps: 65537
	muted: no
	current latency: 47.07 ms
	max request: 27 KiB
	max rewind: 27 KiB
	monitor source: 0
	sample spec: s32le 4ch 44100Hz
	channel map: front-left,front-right,rear-left,rear-right
	             Surround 4.0
	used by: 1
	linked by: 3
	configured latency: 40.00 ms; range is 4.00 .. 1486.08 ms
	card: 0 <alsa_card.usb-Focusrite_Scarlett_2i4_USB-00>
	module: 5
	properties:
		alsa.resolution_bits = "32"
		device.api = "alsa"
		device.class = "sound"
		alsa.class = "generic"
		alsa.subclass = "generic-mix"
		alsa.name = "USB Audio"
		alsa.id = "USB Audio"
		alsa.subdevice = "0"
		alsa.subdevice_name = "subdevice #0"
		alsa.device = "0"
		alsa.card = "0"
		alsa.card_name = "Scarlett 2i4 USB"
		alsa.long_card_name = "Focusrite Scarlett 2i4 USB at usb-0000:00:14.0-4.1, high speed"
		alsa.driver_name = "snd_usb_audio"
		device.bus_path = "pci-0000:00:14.0-usb-0:4.1:1.0"
		sysfs.path = "/devices/pci0000:00/0000:00:14.0/usb1/1-4/1-4.1/1-4.1:1.0/sound/card0"
		udev.id = "usb-Focusrite_Scarlett_2i4_USB-00"
		device.bus = "usb"
		device.vendor.id = "1235"
		device.vendor.name = "Focusrite-Novation"
		device.product.id = "8200"
		device.product.name = "Scarlett 2i4 USB"
		device.serial = "Focusrite_Scarlett_2i4_USB"
		device.string = "surround40:0"
		device.buffering.buffer_size = "1048576"
		device.buffering.fragment_size = "524288"
		device.access_mode = "mmap+timer"
		device.profile.name = "analog-surround-40"
		device.profile.description = "Analog Surround 4.0"
		device.description = "Scarlett 2i4 USB Analog Surround 4.0"
		alsa.mixer_name = "USB Mixer"
		alsa.components = "USB1235:8200"
		module-udev-detect.discovered = "1"
		device.icon_name = "audio-card-usb"
	ports:
		analog-output: Analog Output (priority 9900, latency offset 0 usec, available: unknown)
			properties:
				
	active port: <analog-output>
    index: 2
	name: <alsa_output.pci-0000_00_1f.3.hdmi-stereo-extra1>
	driver: <module-alsa-card.c>
	flags: HARDWARE DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
	state: RUNNING
	suspend cause: (none)
	priority: 9030
	volume: front-left: 65507 / 100% / -0.01 dB,   front-right: 65507 / 100% / -0.01 dB
	        balance 0.00
	base volume: 65536 / 100% / 0.00 dB
	volume steps: 65537
	muted: no
	current latency: 30.65 ms
	max request: 13 KiB
	max rewind: 13 KiB
	monitor source: 3
	sample spec: s32le 2ch 44100Hz
	channel map: front-left,front-right
	             Stereo
	used by: 1
	linked by: 3
	configured latency: 40.00 ms; range is 26.00 .. 2000.00 ms
	card: 1 <alsa_card.pci-0000_00_1f.3>
	module: 6
	properties:
		alsa.resolution_bits = "32"
		device.api = "alsa"
		device.class = "sound"
		alsa.class = "generic"
		alsa.subclass = "generic-mix"
		alsa.name = "HDMI 1"
		alsa.id = "HDMI 1"
		alsa.subdevice = "0"
		alsa.subdevice_name = "subdevice #0"
		alsa.device = "7"
		alsa.card = "1"
		alsa.card_name = "HDA Intel PCH"
		alsa.long_card_name = "HDA Intel PCH at 0xdc140000 irq 127"
		alsa.driver_name = "snd_hda_intel"
		device.bus_path = "pci-0000:00:1f.3"
		sysfs.path = "/devices/pci0000:00/0000:00:1f.3/sound/card1"
		device.bus = "pci"
		device.vendor.id = "8086"
		device.vendor.name = "Intel Corporation"
		device.product.id = "9d70"
		device.product.name = "Sunrise Point-LP HD Audio"
		device.form_factor = "internal"
		device.string = "hdmi:1,1"
		device.buffering.buffer_size = "705600"
		device.buffering.fragment_size = "352800"
		device.access_mode = "mmap+timer"
		device.profile.name = "hdmi-stereo-extra1"
		device.profile.description = "Digital Stereo (HDMI 2)"
		device.description = "Built-in Audio Digital Stereo (HDMI 2)"
		alsa.mixer_name = "Realtek ALC298"
		alsa.components = "HDA:10ec0298,17aa224b,00100103 HDA:80862809,80860101,00100000"
		module-udev-detect.discovered = "1"
		device.icon_name = "audio-card-pci"
	ports:
		hdmi-output-1: HDMI / DisplayPort 2 (priority 5800, latency offset 0 usec, available: yes)
			properties:
				device.icon_name = "video-display"
				device.product.name = "ASUS VC239"
	active port: <hdmi-output-1>
    index: 3
	name: <combined>
	driver: <module-combine-sink.c>
	flags: DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
	state: IDLE
	suspend cause: (none)
	priority: 1000
	volume: front-left: 65479 / 100% / -0.02 dB,   front-center: 65479 / 100% / -0.02 dB,   front-right: 65479 / 100% / -0.02 dB,   rear-center: 65479 / 100% / -0.02 dB
	        balance 0.00
	base volume: 65536 / 100% / 0.00 dB
	volume steps: 65537
	muted: no
	current latency: 25.74 ms
	max request: 27 KiB
	max rewind: 0 KiB
	monitor source: 5
	sample spec: s32le 4ch 44100Hz
	channel map: front-left,front-center,front-right,rear-center
	used by: 0
	linked by: 1
	configured latency: 40.00 ms; range is 26.00 .. 200.00 ms
	module: 13
	properties:
		device.class = "filter"
		device.description = "Simultaneous output to Scarlett 2i4 USB Analog Surround 4.0, Built-in Audio Digital Stereo (HDMI 2)"
		device.icon_name = "audio-card"

Offline

#23 2020-01-06 11:33:20

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,425

Re: Pulseaudio CPU usage 15-20%

pacmd list-sink-inputs during that? You aren't using the new profile we defined?

Last edited by V1del (2020-01-06 11:34:29)

Offline

#24 2020-01-06 16:12:20

miomio
Member
Registered: 2016-01-17
Posts: 167

Re: Pulseaudio CPU usage 15-20%

$ pacmd list-sinks
4 sink(s) available.
  * index: 0
	name: <alsa_output.usb-Focusrite_Scarlett_2i4_USB-00.analog-surround-40>
	driver: <module-alsa-card.c>
	flags: HARDWARE DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
	state: RUNNING
	suspend cause: (none)
	priority: 9049
	volume: front-left: 65536 / 100% / 0.00 dB,   front-right: 65536 / 100% / 0.00 dB,   rear-left: 65536 / 100% / 0.00 dB,   rear-right: 65536 / 100% / 0.00 dB
	        balance 0.00
	base volume: 65536 / 100% / 0.00 dB
	volume steps: 65537
	muted: no
	current latency: 30.25 ms
	max request: 17 KiB
	max rewind: 17 KiB
	monitor source: 0
	sample spec: s32le 4ch 44100Hz
	channel map: front-left,front-right,rear-left,rear-right
	             Surround 4.0
	used by: 1
	linked by: 3
	configured latency: 26.00 ms; range is 4.00 .. 1486.08 ms
	card: 0 <alsa_card.usb-Focusrite_Scarlett_2i4_USB-00>
	module: 5
	properties:
		alsa.resolution_bits = "32"
		device.api = "alsa"
		device.class = "sound"
		alsa.class = "generic"
		alsa.subclass = "generic-mix"
		alsa.name = "USB Audio"
		alsa.id = "USB Audio"
		alsa.subdevice = "0"
		alsa.subdevice_name = "subdevice #0"
		alsa.device = "0"
		alsa.card = "0"
		alsa.card_name = "Scarlett 2i4 USB"
		alsa.long_card_name = "Focusrite Scarlett 2i4 USB at usb-0000:00:14.0-4.1, high speed"
		alsa.driver_name = "snd_usb_audio"
		device.bus_path = "pci-0000:00:14.0-usb-0:4.1:1.0"
		sysfs.path = "/devices/pci0000:00/0000:00:14.0/usb1/1-4/1-4.1/1-4.1:1.0/sound/card0"
		udev.id = "usb-Focusrite_Scarlett_2i4_USB-00"
		device.bus = "usb"
		device.vendor.id = "1235"
		device.vendor.name = "Focusrite-Novation"
		device.product.id = "8200"
		device.product.name = "Scarlett 2i4 USB"
		device.serial = "Focusrite_Scarlett_2i4_USB"
		device.string = "surround40:0"
		device.buffering.buffer_size = "1048576"
		device.buffering.fragment_size = "524288"
		device.access_mode = "mmap+timer"
		device.profile.name = "analog-surround-40"
		device.profile.description = "Analog Surround 4.0"
		device.description = "Scarlett 2i4 USB Analog Surround 4.0"
		alsa.mixer_name = "USB Mixer"
		alsa.components = "USB1235:8200"
		module-udev-detect.discovered = "1"
		device.icon_name = "audio-card-usb"
	ports:
		analog-output: Analog Output (priority 9900, latency offset 0 usec, available: unknown)
			properties:
				
	active port: <analog-output>
    index: 2
	name: <alsa_output.pci-0000_00_1f.3.hdmi-stereo-extra1>
	driver: <module-alsa-card.c>
	flags: HARDWARE DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
	state: RUNNING
	suspend cause: (none)
	priority: 9030
	volume: front-left: 65507 / 100% / -0.01 dB,   front-right: 65507 / 100% / -0.01 dB
	        balance 0.00
	base volume: 65536 / 100% / 0.00 dB
	volume steps: 65537
	muted: no
	current latency: 22.84 ms
	max request: 8 KiB
	max rewind: 8 KiB
	monitor source: 3
	sample spec: s32le 2ch 44100Hz
	channel map: front-left,front-right
	             Stereo
	used by: 1
	linked by: 3
	configured latency: 26.00 ms; range is 26.00 .. 2000.00 ms
	card: 1 <alsa_card.pci-0000_00_1f.3>
	module: 6
	properties:
		alsa.resolution_bits = "32"
		device.api = "alsa"
		device.class = "sound"
		alsa.class = "generic"
		alsa.subclass = "generic-mix"
		alsa.name = "HDMI 1"
		alsa.id = "HDMI 1"
		alsa.subdevice = "0"
		alsa.subdevice_name = "subdevice #0"
		alsa.device = "7"
		alsa.card = "1"
		alsa.card_name = "HDA Intel PCH"
		alsa.long_card_name = "HDA Intel PCH at 0xdc140000 irq 127"
		alsa.driver_name = "snd_hda_intel"
		device.bus_path = "pci-0000:00:1f.3"
		sysfs.path = "/devices/pci0000:00/0000:00:1f.3/sound/card1"
		device.bus = "pci"
		device.vendor.id = "8086"
		device.vendor.name = "Intel Corporation"
		device.product.id = "9d70"
		device.product.name = "Sunrise Point-LP HD Audio"
		device.form_factor = "internal"
		device.string = "hdmi:1,1"
		device.buffering.buffer_size = "705600"
		device.buffering.fragment_size = "352800"
		device.access_mode = "mmap+timer"
		device.profile.name = "hdmi-stereo-extra1"
		device.profile.description = "Digital Stereo (HDMI 2)"
		device.description = "Built-in Audio Digital Stereo (HDMI 2)"
		alsa.mixer_name = "Realtek ALC298"
		alsa.components = "HDA:10ec0298,17aa224b,00100103 HDA:80862809,80860101,00100000"
		module-udev-detect.discovered = "1"
		device.icon_name = "audio-card-pci"
	ports:
		hdmi-output-1: HDMI / DisplayPort 2 (priority 5800, latency offset 0 usec, available: yes)
			properties:
				device.icon_name = "video-display"
				device.product.name = "ASUS VC239"
	active port: <hdmi-output-1>
    index: 3
	name: <combined>
	driver: <module-combine-sink.c>
	flags: DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
	state: RUNNING
	suspend cause: (none)
	priority: 1000
	volume: front-left: 65479 / 100% / -0.02 dB,   front-center: 65479 / 100% / -0.02 dB,   front-right: 65479 / 100% / -0.02 dB,   rear-center: 65479 / 100% / -0.02 dB
	        balance 0.00
	base volume: 65536 / 100% / 0.00 dB
	volume steps: 65537
	muted: no
	current latency: 20.64 ms
	max request: 17 KiB
	max rewind: 0 KiB
	monitor source: 5
	sample spec: s32le 4ch 44100Hz
	channel map: front-left,front-center,front-right,rear-center
	used by: 1
	linked by: 3
	configured latency: 26.00 ms; range is 26.00 .. 200.00 ms
	module: 13
	properties:
		device.class = "filter"
		device.description = "Simultaneous output to Scarlett 2i4 USB Analog Surround 4.0, Built-in Audio Digital Stereo (HDMI 2), Built-in Audio Digital Stereo (HDMI 4)"
		device.icon_name = "audio-card"
    index: 4
	name: <alsa_output.pci-0000_00_1f.3.hdmi-stereo-extra3>
	driver: <module-alsa-card.c>
	flags: HARDWARE DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
	state: RUNNING
	suspend cause: (none)
	priority: 9030
	volume: front-left: 65536 / 100% / 0.00 dB,   front-right: 65536 / 100% / 0.00 dB
	        balance 0.00
	base volume: 65536 / 100% / 0.00 dB
	volume steps: 65537
	muted: no
	current latency: 25.21 ms
	max request: 8 KiB
	max rewind: 8 KiB
	monitor source: 6
	sample spec: s32le 2ch 44100Hz
	channel map: front-left,front-right
	             Stereo
	used by: 1
	linked by: 3
	configured latency: 26.00 ms; range is 0.50 .. 2000.00 ms
	card: 1 <alsa_card.pci-0000_00_1f.3>
	module: 6
	properties:
		alsa.resolution_bits = "32"
		device.api = "alsa"
		device.class = "sound"
		alsa.class = "generic"
		alsa.subclass = "generic-mix"
		alsa.name = "HDMI 3"
		alsa.id = "HDMI 3"
		alsa.subdevice = "0"
		alsa.subdevice_name = "subdevice #0"
		alsa.device = "9"
		alsa.card = "1"
		alsa.card_name = "HDA Intel PCH"
		alsa.long_card_name = "HDA Intel PCH at 0xdc140000 irq 127"
		alsa.driver_name = "snd_hda_intel"
		device.bus_path = "pci-0000:00:1f.3"
		sysfs.path = "/devices/pci0000:00/0000:00:1f.3/sound/card1"
		device.bus = "pci"
		device.vendor.id = "8086"
		device.vendor.name = "Intel Corporation"
		device.product.id = "9d70"
		device.product.name = "Sunrise Point-LP HD Audio"
		device.form_factor = "internal"
		device.string = "hdmi:1,3"
		device.buffering.buffer_size = "705600"
		device.buffering.fragment_size = "352800"
		device.access_mode = "mmap+timer"
		device.profile.name = "hdmi-stereo-extra3"
		device.profile.description = "Digital Stereo (HDMI 4)"
		device.description = "Built-in Audio Digital Stereo (HDMI 4)"
		alsa.mixer_name = "Realtek ALC298"
		alsa.components = "HDA:10ec0298,17aa224b,00100103 HDA:80862809,80860101,00100000"
		module-udev-detect.discovered = "1"
		device.icon_name = "audio-card-pci"
	ports:
		hdmi-output-3: HDMI / DisplayPort 4 (priority 5600, latency offset 0 usec, available: yes)
			properties:
				device.icon_name = "video-display"
				device.product.name = "ASUS VC239"
	active port: <hdmi-output-3>


$ pacmd list-sink-inputs
4 sink input(s) available.
    index: 0
	driver: <module-combine-sink.c>
	flags: VARIABLE_RATE DONT_MOVE NO_CREATE_SUSPEND 
	state: RUNNING
	sink: 0 <alsa_output.usb-Focusrite_Scarlett_2i4_USB-00.analog-surround-40>
	volume: front-left: 65880 / 101% / 0.14 dB,   front-center: 65880 / 101% / 0.14 dB,   front-right: 65880 / 101% / 0.14 dB,   rear-center: 65880 / 101% / 0.14 dB
	        balance 0.00
	muted: yes
	current latency: 0.00 ms
	requested latency: 26.00 ms
	sample spec: s32le 4ch 44100Hz
	channel map: front-left,front-center,front-right,rear-center
	resample method: trivial
	module: 13
	properties:
		media.name = "Simultaneous output on Scarlett 2i4 USB Analog Surround 4.0"
		media.role = "filter"
		module-stream-restore.id = "sink-input-by-media-role:filter"
    index: 2
	driver: <module-combine-sink.c>
	flags: VARIABLE_RATE DONT_MOVE NO_CREATE_SUSPEND 
	state: RUNNING
	sink: 2 <alsa_output.pci-0000_00_1f.3.hdmi-stereo-extra1>
	volume: front-left: 65880 / 101% / 0.14 dB,   front-center: 65880 / 101% / 0.14 dB,   front-right: 65880 / 101% / 0.14 dB,   rear-center: 65880 / 101% / 0.14 dB
	        balance 0.00
	muted: no
	current latency: 2.47 ms
	requested latency: 26.00 ms
	sample spec: s32le 4ch 44100Hz
	channel map: front-left,front-center,front-right,rear-center
	resample method: trivial
	module: 13
	properties:
		media.name = "Simultaneous output on Built-in Audio Digital Stereo (HDMI 2)"
		media.role = "filter"
		module-stream-restore.id = "sink-input-by-media-role:filter"
    index: 89
	driver: <module-combine-sink.c>
	flags: VARIABLE_RATE DONT_MOVE NO_CREATE_SUSPEND 
	state: RUNNING
	sink: 4 <alsa_output.pci-0000_00_1f.3.hdmi-stereo-extra3>
	volume: front-left: 65070 /  99% / -0.19 dB,   front-center: 65070 /  99% / -0.19 dB,   front-right: 65070 /  99% / -0.19 dB,   rear-center: 65070 /  99% / -0.19 dB
	        balance 0.00
	muted: no
	current latency: 2.13 ms
	requested latency: 26.00 ms
	sample spec: s32le 4ch 44100Hz
	channel map: front-left,front-center,front-right,rear-center
	resample method: trivial
	module: 13
	properties:
		media.name = "Simultaneous output on Built-in Audio Digital Stereo (HDMI 4)"
		media.role = "filter"
		module-stream-restore.id = "sink-input-by-media-role:filter"
    index: 112
	driver: <protocol-native.c>
	flags: START_CORKED 
	state: RUNNING
	sink: 3 <combined>
	volume: front-left: 46345 /  71% / -9.03 dB,   front-right: 46345 /  71% / -9.03 dB,   rear-left: 46345 /  71% / -9.03 dB,   rear-right: 46345 /  71% / -9.03 dB
	        balance 0.00
	muted: no
	current latency: 76.42 ms
	requested latency: 26.00 ms
	sample spec: float32le 4ch 44100Hz
	channel map: front-left,front-right,rear-left,rear-right
	             Surround 4.0
	resample method: copy
	module: 11
	client: 124 <Brave>
	properties:
		application.icon_name = "chromium-browser"
		media.name = "Playback"
		application.name = "Brave"
		native-protocol.peer = "UNIX socket client"
		native-protocol.version = "33"
		application.process.id = "1167"
		application.process.user = "laptopuser"
		application.process.host = "laptop"
		application.process.binary = "brave"
		application.language = "en_GB.UTF-8"
		window.x11.display = ":0.0"
		application.process.machine_id = "b277a175d25a4df3a88fefbe478474b1"
		application.process.session_id = "1"
		module-stream-restore.id = "sink-input-by-application-name:Brave"

Offline

#25 2020-01-06 16:34:49

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,425

Re: Pulseaudio CPU usage 15-20%

Untick the combine sink in plasma-pa or whatever GUI you used to set that. Edit your /etc/pulse/default.pa and at the end add

.nofail
###Play with these last two values, setting adjust_time=0 should be the least CPU intensive, but it might be that the two outputs start to diverge. Switch away from trivial to a few of the other options we've discussed to check their effects
load-module module-combine-sink sink_name="Combined HDMI Outs" slaves=alsa_output.pci-0000_00_1f.3.hdmi-stereo-extra1,alsa_output.pci-0000_00_1f.3.hdmi-stereo-extra3 adjust_time=10 resample_method=trivial

Also more generally, you do have low end hardware here and it could simply be that one core to be maxed for the kind of setup you want to be unavoidable.

Offline

Board footer

Powered by FluxBB