[pulseaudio-discuss] Virtual audio cable - high cpu usage

Renaud GHIA rghia at tixeo.com
Tue Feb 2 09:40:51 UTC 2021


Hi,

Below the result of the command "pacmd list".
Here without any change of resampling method.

Thanks

Memory blocks currently allocated: 10, size: 102.5 KiB.
Memory blocks allocated during the whole lifetime: 105406, size: 15.0 MiB.
Memory blocks imported from other processes: 5, size: 8.6 KiB.
Memory blocks exported to other processes: 2, size: 188 B.
Total sample cache size: 0 B.
Default sample spec: s16le 2ch 44100Hz
Default channel map: front-left,front-right
Default sink name: VAC
Default source name: VACmic
Memory blocks of type POOL: 5 allocated/101237 accumulated.
Memory blocks of type POOL_EXTERNAL: 0 allocated/0 accumulated.
Memory blocks of type APPENDED: 0 allocated/0 accumulated.
Memory blocks of type USER: 0 allocated/0 accumulated.
Memory blocks of type FIXED: 0 allocated/0 accumulated.
Memory blocks of type IMPORTED: 5 allocated/4169 accumulated.
21 module(s) loaded.
    index: 0
name: <module-device-restore>
argument: <>
used: -1
load once: yes
properties:
module.author = "Lennart Poettering"
module.description = "Automatically restore the volume/mute state of
devices"
module.version = "12.2"
    index: 1
name: <module-stream-restore>
argument: <>
used: -1
load once: yes
properties:
module.author = "Lennart Poettering"
module.description = "Automatically restore the volume/mute/device state of
streams"
module.version = "12.2"
    index: 2
name: <module-card-restore>
argument: <>
used: -1
load once: yes
properties:
module.author = "Lennart Poettering"
module.description = "Automatically restore profile of cards"
module.version = "12.2"
    index: 3
name: <module-augment-properties>
argument: <>
used: -1
load once: yes
properties:
module.author = "Lennart Poettering"
module.description = "Augment the property sets of streams with additional
static information"
module.version = "12.2"
    index: 4
name: <module-switch-on-port-available>
argument: <>
used: -1
load once: yes
properties:
module.author = "David Henningsson"
module.description = "Switches ports and profiles when devices are
plugged/unplugged"
module.version = "12.2"
    index: 5
name: <module-udev-detect>
argument: <>
used: -1
load once: yes
properties:
module.author = "Lennart Poettering"
module.description = "Detect available audio hardware and load matching
drivers"
module.version = "12.2"
    index: 6
name: <module-native-protocol-unix>
argument: <>
used: -1
load once: no
properties:
module.author = "Lennart Poettering"
module.description = "Native protocol (UNIX sockets)"
module.version = "12.2"
    index: 7
name: <module-default-device-restore>
argument: <>
used: -1
load once: yes
properties:
module.author = "Lennart Poettering"
module.description = "Automatically restore the default sink and source"
module.version = "12.2"
    index: 8
name: <module-rescue-streams>
argument: <>
used: -1
load once: yes
properties:
module.author = "Lennart Poettering"
module.description = "When a sink/source is removed, try to move its
streams to the default sink/source"
module.version = "12.2"
    index: 9
name: <module-always-sink>
argument: <>
used: -1
load once: yes
properties:
module.author = "Colin Guthrie"
module.description = "Always keeps at least one sink loaded even if it's a
null one"
module.version = "12.2"
    index: 11
name: <module-intended-roles>
argument: <>
used: -1
load once: yes
properties:
module.author = "Lennart Poettering"
module.description = "Automatically set device of streams based on intended
roles of devices"
module.version = "12.2"
    index: 12
name: <module-suspend-on-idle>
argument: <>
used: -1
load once: yes
properties:
module.author = "Lennart Poettering"
module.description = "When a sink/source is idle for too long, suspend it"
module.version = "12.2"
    index: 13
name: <module-console-kit>
argument: <>
used: -1
load once: yes
properties:
module.author = "Lennart Poettering"
module.description = "Create a client for each ConsoleKit session of this
user"
module.version = "12.2"
    index: 14
name: <module-systemd-login>
argument: <>
used: -1
load once: yes
properties:
module.author = "Lennart Poettering"
module.description = "Create a client for each login session of this user"
module.version = "12.2"
    index: 15
name: <module-position-event-sounds>
argument: <>
used: -1
load once: yes
properties:
module.author = "Lennart Poettering"
module.description = "Position event sounds between L and R depending on
the position on screen of the widget triggering them."
module.version = "12.2"
    index: 16
name: <module-role-cork>
argument: <>
used: -1
load once: yes
properties:
module.author = "Lennart Poettering"
module.description = "Mute & cork streams with certain roles while others
exist"
module.version = "12.2"
    index: 17
name: <module-filter-heuristics>
argument: <>
used: -1
load once: yes
properties:
module.author = "Colin Guthrie"
module.description = "Detect when various filters are desirable"
module.version = "12.2"
    index: 18
name: <module-filter-apply>
argument: <>
used: -1
load once: yes
properties:
module.author = "Colin Guthrie"
module.description = "Load filter sinks automatically when needed"
module.version = "12.2"
    index: 19
name: <module-null-sink>
argument: <sink_name=VAC sink_properties=device.description=VAC>
used: 2
load once: no
properties:
module.author = "Lennart Poettering"
module.description = "Clocked NULL sink"
module.version = "12.2"
    index: 20
name: <module-remap-source>
argument: <master=VAC.monitor source_name=VACmic
source_properties=device.description=VAC>
used: 1
load once: no
properties:
module.author = "Stefan Huber"
module.description = "Virtual channel remapping source"
module.version = "12.2"
    index: 21
name: <module-cli-protocol-unix>
argument: <>
used: -1
load once: no
properties:
module.author = "Lennart Poettering"
module.description = "Command line interface protocol (UNIX sockets)"
module.version = "12.2"
1 sink(s) available.
  * index: 1
name: <VAC>
driver: <module-null-sink.c>
flags: DECIBEL_VOLUME LATENCY FLAT_VOLUME DYNAMIC_LATENCY
state: RUNNING
suspend cause: (none)
priority: 1000
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: 0.41 ms
max request: 0 KiB
max rewind: 0 KiB
monitor source: 1
sample spec: s16le 2ch 44100Hz
channel map: front-left,front-right
            Stereo
used by: 1
linked by: 2
configured latency: 0.50 ms; range is 0.50 .. 2000.00 ms
module: 19
properties:
device.description = "VAC"
device.class = "abstract"
device.icon_name = "audio-card"
2 source(s) available.
    index: 1
name: <VAC.monitor>
driver: <module-null-sink.c>
flags: DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
state: RUNNING
suspend cause: (none)
priority: 1000
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: 0.00 ms
max rewind: 0 KiB
sample spec: s16le 2ch 44100Hz
channel map: front-left,front-right
            Stereo
used by: 1
linked by: 1
configured latency: 2000.00 ms; range is 0.50 .. 2000.00 ms
monitor_of: 1
module: 19
properties:
device.description = "Monitor of VAC"
device.class = "monitor"
device.icon_name = "audio-input-microphone"
  * index: 2
name: <VACmic>
driver: <module-remap-source.c>
flags: DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
state: RUNNING
suspend cause: (none)
priority: 1000
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: 0.00 ms
max rewind: 0 KiB
sample spec: s16le 2ch 44100Hz
channel map: front-left,front-right
            Stereo
used by: 1
linked by: 1
configured latency: 2000.00 ms; range is 0.50 .. 2000.00 ms
module: 20
properties:
device.master_device = "VAC.monitor"
device.class = "filter"
device.description = "VAC"
device.icon_name = "audio-input-microphone"
9 client(s) logged in.
    index: 0
driver: <module-systemd-login.c>
owner module: 14
properties:
application.name = "Login Session 9"
systemd-login.session = "9"
    index: 1
driver: <module-systemd-login.c>
owner module: 14
properties:
application.name = "Login Session 11"
systemd-login.session = "11"
    index: 2
driver: <protocol-native.c>
owner module: 6
properties:
application.name = "The Sound Player"
native-protocol.peer = "UNIX socket client"
native-protocol.version = "32"
application.process.id = "15814"
application.process.user = "vagrant"
application.process.host = "debian10.localdomain"
application.process.binary = "TheRecorder"
application.language = "en_US.utf8"
window.x11.display = ":0"
application.process.machine_id = "c79df160d01f4c7780e6da0aaf5515c3"
application.process.session_id = "9"
    index: 5
driver: <protocol-native.c>
owner module: 6
properties:
application.name = "The Sound Player"
native-protocol.peer = "UNIX socket client"
native-protocol.version = "32"
application.process.id = "15877"
application.process.user = "vagrant"
application.process.host = "debian10.localdomain"
application.process.binary = "W3DClient"
application.language = "en_US.utf8"
window.x11.display = ":0"
application.process.machine_id = "c79df160d01f4c7780e6da0aaf5515c3"
application.process.session_id = "9"
    index: 6
driver: <protocol-native.c>
owner module: 6
properties:
application.name = "VLC media player (LibVLC 3.0.12)"
native-protocol.peer = "UNIX socket client"
native-protocol.version = "32"
application.id = "org.VideoLAN.VLC"
application.version = "3.0.12"
application.icon_name = "vlc"
application.language = "en_US.utf8"
application.process.id = "15877"
application.process.user = "vagrant"
application.process.host = "debian10.localdomain"
application.process.binary = "W3DClient"
window.x11.display = ":0"
application.process.machine_id = "c79df160d01f4c7780e6da0aaf5515c3"
application.process.session_id = "9"
    index: 7
driver: <protocol-native.c>
owner module: 6
properties:
application.name = "VLC media player (LibVLC 3.0.12)"
native-protocol.peer = "UNIX socket client"
native-protocol.version = "32"
application.id = "org.VideoLAN.VLC"
application.version = "3.0.12"
application.icon_name = "vlc"
application.language = "en_US.utf8"
application.process.id = "15877"
application.process.user = "vagrant"
application.process.host = "debian10.localdomain"
application.process.binary = "W3DClient"
window.x11.display = ":0"
application.process.machine_id = "c79df160d01f4c7780e6da0aaf5515c3"
application.process.session_id = "9"
    index: 8
driver: <protocol-native.c>
owner module: 6
properties:
application.name = "VLC media player (LibVLC 3.0.12)"
native-protocol.peer = "UNIX socket client"
native-protocol.version = "32"
application.id = "org.VideoLAN.VLC"
application.version = "3.0.12"
application.icon_name = "vlc"
application.language = "en_US.utf8"
application.process.id = "15877"
application.process.user = "vagrant"
application.process.host = "debian10.localdomain"
application.process.binary = "TheSoundPlayer"
window.x11.display = ":0"
application.process.machine_id = "c79df160d01f4c7780e6da0aaf5515c3"
application.process.session_id = "9"
    index: 9
driver: <protocol-native.c>
owner module: 6
properties:
application.name = "Lavf58.20.100"
native-protocol.peer = "UNIX socket client"
native-protocol.version = "32"
application.process.id = "15985"
application.process.user = "vagrant"
application.process.host = "debian10.localdomain"
application.process.binary = "ffmpeg"
application.language = "C"
window.x11.display = ":0"
application.process.machine_id = "c79df160d01f4c7780e6da0aaf5515c3"
application.process.session_id = "9"
    index: 10
driver: <cli.c>
owner module: 21
properties:
application.name = "UNIX socket client"
0 card(s) available.
1 sink input(s) available.
    index: 1
driver: <protocol-native.c>
flags:
state: RUNNING
sink: 1 <VAC>
volume: front-left: 65536 / 100% / 0.00 dB,   front-right: 65536 / 100% /
0.00 dB
       balance 0.00
muted: no
current latency: 47.01 ms
requested latency: 0.50 ms
sample spec: s16le 2ch 44100Hz
channel map: front-left,front-right
            Stereo
resample method: (null)
module: 6
client: 5 <The Sound Player>
properties:
media.name = "playStream"
application.name = "The Sound Player"
native-protocol.peer = "UNIX socket client"
native-protocol.version = "32"
application.process.id = "15877"
application.process.user = "vagrant"
application.process.host = "debian10.localdomain"
application.process.binary = "W3DClient"
application.language = "en_US.utf8"
window.x11.display = ":0"
application.process.machine_id = "c79df160d01f4c7780e6da0aaf5515c3"
application.process.session_id = "9"
module-stream-restore.id = "sink-input-by-application-name:The Sound Player"
2 source output(s) available.
    index: 0
driver: <module-remap-source.c>
flags: START_CORKED
state: RUNNING
source: 1 <VAC.monitor>
volume: front-left: 65536 / 100% / 0.00 dB,   front-right: 65536 / 100% /
0.00 dB
       balance 0.00
muted: no
current latency: 0.00 ms
requested latency: 2000.00 ms
sample spec: s16le 2ch 44100Hz
channel map: front-left,front-right
            Stereo
resample method: (null)
owner module: 20
properties:
media.name = "Remapped Stream"
media.role = "filter"
module-stream-restore.id = "source-output-by-media-role:filter"
    index: 1
driver: <protocol-native.c>
flags:
state: RUNNING
source: 2 <VACmic>
volume: front-left: 65536 / 100% / 0.00 dB,   front-right: 65536 / 100% /
0.00 dB
       balance 0.00
muted: no
current latency: 0.50 ms
requested latency: 2000.00 ms
sample spec: s16le 2ch 48000Hz
channel map: front-left,front-right
            Stereo
resample method: speex-float-1
owner module: 6
client: 9 <Lavf58.20.100>
properties:
media.name = "record"
application.name = "Lavf58.20.100"
native-protocol.peer = "UNIX socket client"
native-protocol.version = "32"
application.process.id = "15985"
application.process.user = "vagrant"
application.process.host = "debian10.localdomain"
application.process.binary = "ffmpeg"
application.language = "C"
window.x11.display = ":0"
application.process.machine_id = "c79df160d01f4c7780e6da0aaf5515c3"
application.process.session_id = "9"
module-stream-restore.id = "source-output-by-application-name:Lavf58.20.100"
0 cache entrie(s) available.


Le mar. 2 févr. 2021 à 02:31, Sean Greenslade <sean at seangreenslade.com> a
écrit :

> On Sat, Jan 30, 2021 at 12:29:46PM +0100, Renaud GHIA wrote:
> > Hi,
> >
> > I use pulseaudio in a use case where the cpu usage is very high (30%) and
> > IHMO this is not normal.
> > I tried all the tricks to decrease the cpu load without success
> > (resampling-method etc...). The cpu remains high.
> >
> > My use case is simple. I redirect the sound output of an application to
> the
> > sound input of another application (in this case ffmpeg). I load two
> > modules to create my virtual audio cable like this:
> >
> > pactl load-module module-null-sink sink_name=VAC_spk
> > sink_properties=device.description=VAC
> >
> > pactl load-module module-remap-source master=VAC_spk.monitor
> > source_name=VAC1_mic source_properties=device.description=VAC
> >
> > Everything works perfectly, except the cpu which is 30% for this simple
> use
> > case.
> > My cpu is a AMD threadripper and i'am with the latest stable release
> > pulseaudio 14.2 freshly compiled,
> > Do you know how to lower the CPU usage?
>
> Have you made sure that everything in the chain is operating at the same
> sample rate? That could be a cause of high CPU usage.
>
> Also, I've seen high CPU usage on my setups when I have a large number
> of pulse clients running and I open pavucontrol, since pavucontrol
> creates a source output for every client in order to display its VU
> meters.
>
> If neither of those are the cause, can you share the output of the
> command "pacmd list" when you're seeing high CPU usage? That might shed
> additional light on what's happening in your setup.
>
> --Sean
>
> _______________________________________________
> pulseaudio-discuss mailing list
> pulseaudio-discuss at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/pulseaudio-discuss/attachments/20210202/f1eabc40/attachment-0001.htm>


More information about the pulseaudio-discuss mailing list