wwmm / easyeffects

Limiter, compressor, convolver, equalizer and auto volume and many other plugins for PipeWire applications
GNU General Public License v3.0
6.57k stars 270 forks source link

Small audio breaks during normal use #667

Closed JotaJota96 closed 3 years ago

JotaJota96 commented 4 years ago

Hello, sorry for my English.

I have installed PulseEffects on Kubuntu and am having problems with system audio.

Often, the audio is choppy, and it is annoying when listening to music, plus it is a problem when filming me playing a song while listening to the track from the computer. Even though these outages last only milliseconds, they are noticeable and annoying.

I'm sure the source of the problem is PulseEffects, because if I start the system without using PulseEffects, the audio works correctly

I've already tried the following: (but no positive results)

Information about my computer:

Thank you in advance for your help.

wwmm commented 4 years ago

Kill the current instance pulseeffects -q and restart it in debug mode G_MESSAGES_DEBUG=pulseeffects pulseeffects. Let's see if there is anything interesting shown in the logs.

These kinds of problems are the hardest ones to find. We had one like this in the past and in the end the problem was a limitation in how Pulseaudio's virtual devices recording worked at the time. This problem was solved a few months ago. But maybe there is something else I am not aware of.

JotaJota96 commented 4 years ago

I have run the command while playing a song on YouTube Music (on Firefox), waited for a few of cuts to occur and then ctrl + c. This is the output:

juan@JUAN-LIN:~$ G_MESSAGES_DEBUG=pulseeffects pulseeffects
(process:4560): pulseeffects-DEBUG: 11:47:08.477: main: locale directory: /usr/share/locale
(pulseeffects:4560): pulseeffects-DEBUG: 11:47:08.488: presets_manager: user presets directory already exists: /home/juan/.config/PulseEffects
(pulseeffects:4560): pulseeffects-DEBUG: 11:47:08.488: presets_manager: user presets directory already exists: /home/juan/.config/PulseEffects/input
(pulseeffects:4560): pulseeffects-DEBUG: 11:47:08.488: presets_manager: user presets directory already exists: /home/juan/.config/PulseEffects/output
(pulseeffects:4560): pulseeffects-DEBUG: 11:47:08.488: presets_manager: user presets directory already exists: /home/juan/.config/PulseEffects/autoload
(pulseeffects:4560): pulseeffects-DEBUG: 11:47:08.524: application: PE version: 4.7.2
(pulseeffects:4560): pulseeffects-DEBUG: 11:47:08.524: pulse_manager: context is connecting
(pulseeffects:4560): pulseeffects-DEBUG: 11:47:08.525: pulse_manager: context is authorizing
(pulseeffects:4560): pulseeffects-DEBUG: 11:47:08.525: pulse_manager: context is setting name
(pulseeffects:4560): pulseeffects-DEBUG: 11:47:08.525: pulse_manager: context is ready
(pulseeffects:4560): pulseeffects-DEBUG: 11:47:08.525: pulse_manager: connected to: /run/user/1000/pulse/native
(pulseeffects:4560): pulseeffects-DEBUG: 11:47:08.525: pulse_manager: protocol version: 33
(pulseeffects:4560): pulseeffects-DEBUG: 11:47:08.525: pulse_manager: Pulseaudio version: 13.0
(pulseeffects:4560): pulseeffects-DEBUG: 11:47:08.525: pulse_manager: default pulseaudio source: alsa_output.pci-0000_07_00.6.analog-stereo.monitor
(pulseeffects:4560): pulseeffects-DEBUG: 11:47:08.525: pulse_manager: default pulseaudio sink: alsa_output.pci-0000_07_00.6.analog-stereo
(pulseeffects:4560): pulseeffects-DEBUG: 11:47:08.526: pulse_manager: loading Pulseeffects applications output sink...
(pulseeffects:4560): pulseeffects-DEBUG: 11:47:08.526: pulse_manager: default pulseaudio sink sampling rate: 48000 Hz
(pulseeffects:4560): pulseeffects-DEBUG: 11:47:08.526: pulse_manager: default pulseaudio sink audio format: s16le
(pulseeffects:4560): pulseeffects-DEBUG: 11:47:08.526: pulse_manager:  failed to get sink info: PulseEffects_apps
(pulseeffects:4560): pulseeffects-DEBUG: 11:47:08.532: pulse_manager: loaded module-null-sink: sink_name=PulseEffects_apps sink_properties=device.description="PulseEffects(apps)"device.class="sound" norewinds=1
(pulseeffects:4560): pulseeffects-DEBUG: 11:47:08.532: pulse_manager: loading Pulseeffects microphone output sink...
(pulseeffects:4560): pulseeffects-DEBUG: 11:47:08.532: pulse_manager: default pulseaudio source sampling rate: 48000 Hz
(pulseeffects:4560): pulseeffects-DEBUG: 11:47:08.533: pulse_manager: default pulseaudio source audio format: s16le
(pulseeffects:4560): pulseeffects-DEBUG: 11:47:08.533: pulse_manager:  failed to get sink info: PulseEffects_mic
(pulseeffects:4560): pulseeffects-DEBUG: 11:47:08.537: pulse_manager: loaded module-null-sink: sink_name=PulseEffects_mic sink_properties=device.description="PulseEffects(mic)"device.class="sound" norewinds=1
(pulseeffects:4560): pulseeffects-DEBUG: 11:47:08.566: sie: using input device: PulseEffects_apps.monitor
(pulseeffects:4560): pulseeffects-DEBUG: 11:47:08.566: sie: using output device: alsa_output.pci-0000_07_00.6.analog-stereo
(pulseeffects:4560): pulseeffects-DEBUG: 11:47:08.573: sie: limiter is already disabled
(pulseeffects:4560): pulseeffects-DEBUG: 11:47:08.575: sie: compressor is already disabled
(pulseeffects:4560): pulseeffects-DEBUG: 11:47:08.577: sie: filter is already disabled
(pulseeffects:4560): pulseeffects-DEBUG: 11:47:08.624: sie: equalizer is enabled
(pulseeffects:4560): pulseeffects-DEBUG: 11:47:08.626: sie: reverb is already disabled
(pulseeffects:4560): pulseeffects-DEBUG: 11:47:08.628: sie: bass_enhancer is already disabled
(pulseeffects:4560): pulseeffects-DEBUG: 11:47:08.630: sie: exciter is already disabled
(pulseeffects:4560): pulseeffects-DEBUG: 11:47:08.633: sie: crossfeed is already disabled
(pulseeffects:4560): pulseeffects-DEBUG: 11:47:08.634: sie: maximizer is already disabled
(pulseeffects:4560): pulseeffects-DEBUG: 11:47:08.638: sie: multiband_compressor is already disabled
(pulseeffects:4560): pulseeffects-DEBUG: 11:47:08.639: sie: loudness is already disabled
(pulseeffects:4560): pulseeffects-DEBUG: 11:47:08.641: sie: gate is already disabled
(pulseeffects:4560): pulseeffects-DEBUG: 11:47:08.642: sie: pitch is already disabled
(pulseeffects:4560): pulseeffects-DEBUG: 11:47:08.646: sie: multiband_gate is already disabled
(pulseeffects:4560): pulseeffects-DEBUG: 11:47:08.648: sie: deesser is already disabled
(pulseeffects:4560): pulseeffects-DEBUG: 11:47:08.650: sie: stereo_tools is already disabled
(pulseeffects:4560): pulseeffects-DEBUG: 11:47:08.652: sie: convolver is already disabled
(pulseeffects:4560): pulseeffects-DEBUG: 11:47:08.654: sie: crystalizer is already disabled
(pulseeffects:4560): pulseeffects-DEBUG: 11:47:08.655: sie: autogain is already disabled
(pulseeffects:4560): pulseeffects-DEBUG: 11:47:08.659: sie: delay is already disabled
(pulseeffects:4560): pulseeffects-DEBUG: 11:47:08.667: soe: using output device: PulseEffects_mic
(pulseeffects:4560): pulseeffects-DEBUG: 11:47:08.667: soe: using input device: alsa_output.pci-0000_07_00.6.analog-stereo.monitor
(pulseeffects:4560): pulseeffects-DEBUG: 11:47:08.668: soe: limiter is already disabled
(pulseeffects:4560): pulseeffects-DEBUG: 11:47:08.669: soe: compressor is already disabled
(pulseeffects:4560): pulseeffects-DEBUG: 11:47:08.669: soe: filter is already disabled
(pulseeffects:4560): pulseeffects-DEBUG: 11:47:08.675: soe: equalizer is already disabled
(pulseeffects:4560): pulseeffects-DEBUG: 11:47:08.676: soe: reverb is already disabled
(pulseeffects:4560): pulseeffects-DEBUG: 11:47:08.676: soe: gate is already disabled
(pulseeffects:4560): pulseeffects-DEBUG: 11:47:08.677: soe: deesser is already disabled
(pulseeffects:4560): pulseeffects-DEBUG: 11:47:08.679: soe: pitch is already disabled
(pulseeffects:4560): pulseeffects-DEBUG: 11:47:08.682: soe: webrtc is already disabled
(pulseeffects:4560): pulseeffects-DEBUG: 11:47:08.682: soe: multiband_compressor is already disabled
(pulseeffects:4560): pulseeffects-DEBUG: 11:47:08.684: soe: multiband_gate is already disabled
(pulseeffects:4560): pulseeffects-DEBUG: 11:47:08.685: presets_manager: user presets directory already exists: /home/juan/.config/PulseEffects
(pulseeffects:4560): pulseeffects-DEBUG: 11:47:08.685: presets_manager: user presets directory already exists: /home/juan/.config/PulseEffects/input
(pulseeffects:4560): pulseeffects-DEBUG: 11:47:08.685: presets_manager: user presets directory already exists: /home/juan/.config/PulseEffects/output
(pulseeffects:4560): pulseeffects-DEBUG: 11:47:08.685: presets_manager: user presets directory already exists: /home/juan/.config/PulseEffects/autoload
(pulseeffects:4560): pulseeffects-DEBUG: 11:47:08.685: presets_manager: destroyed
pulseeffects-INFO: 11:47:08.685: application: disabling global bypass
(pulseeffects:4560): pulseeffects-DEBUG: 11:47:08.685: sie: bypass is already disabled
(pulseeffects:4560): pulseeffects-DEBUG: 11:47:08.685: soe: bypass is already disabled
(pulseeffects:4560): pulseeffects-DEBUG: 11:47:08.921: convolver_ui: irs directory already exists: /home/juan/.config/PulseEffects/irs
(pulseeffects:4560): pulseeffects-DEBUG: 11:47:09.498: sie: total latency: 0 ms
(pulseeffects:4560): pulseeffects-DEBUG: 11:47:09.498: soe: total latency: 0 ms
(pulseeffects:4560): pulseeffects-DEBUG: 11:47:09.510: sie: using output device: alsa_output.pci-0000_07_00.6.analog-stereo
(pulseeffects:4560): pulseeffects-DEBUG: 11:47:09.510: pulse_settings_ui: output device changed: alsa_output.pci-0000_07_00.6.analog-stereo
(pulseeffects:4560): pulseeffects-DEBUG: 11:47:09.510: pulse_settings_ui: added sink: alsa_output.pci-0000_07_00.6.analog-stereo
(pulseeffects:4560): pulseeffects-DEBUG: 11:47:09.510: soe: using input device: alsa_output.pci-0000_07_00.6.analog-stereo.monitor
(pulseeffects:4560): pulseeffects-DEBUG: 11:47:09.510: pulse_settings_ui: input device changed: alsa_output.pci-0000_07_00.6.analog-stereo.monitor
(pulseeffects:4560): pulseeffects-DEBUG: 11:47:09.510: pulse_settings_ui: added source: alsa_output.pci-0000_07_00.6.analog-stereo.monitor
(pulseeffects:4560): pulseeffects-DEBUG: 11:47:13.592: sie: NULL -> READY -> PLAYING
(pulseeffects:4560): pulseeffects-DEBUG: 11:47:13.593: sie: READY -> PAUSED -> PLAYING
(pulseeffects:4560): pulseeffects-DEBUG: 11:47:13.594: sie: pulsesrc latency [us]: 10000
(pulseeffects:4560): pulseeffects-DEBUG: 11:47:13.594: sie: pulsesrc buffer [us]: 200000
(pulseeffects:4560): pulseeffects-DEBUG: 11:47:13.594: sie: total latency: 0 ms
(pulseeffects:4560): pulseeffects-DEBUG: 11:47:13.594: sie: sampling rate: 48000 Hz
(pulseeffects:4560): pulseeffects-DEBUG: 11:47:13.699: peadapter: pulseaudio block size 480 frames
(pulseeffects:4560): pulseeffects-DEBUG: 11:47:13.699: peadapter: we will read in chunks of 512 frames
(pulseeffects:4560): pulseeffects-DEBUG: 11:47:13.702: sie: total latency: 150 ms
(pulseeffects:4560): pulseeffects-DEBUG: 11:47:13.704: sie: pulsesink latency [us]: 10000
(pulseeffects:4560): pulseeffects-DEBUG: 11:47:13.704: sie: pulsesink buffer [us]: 200000
(pulseeffects:4560): pulseeffects-DEBUG: 11:47:13.704: sie: total latency: 150 ms
(pulseeffects:4560): pulseeffects-DEBUG: 11:47:13.704: sie: PAUSED -> PLAYING -> VOID_PENDING
(pulseeffects:4560): pulseeffects-DEBUG: 11:47:13.704: sie: total latency: 150 ms
(pulseeffects:4560): pulseeffects-DEBUG: 11:48:52.559: sie: No app wants to play audio. We will pause our pipeline.
(pulseeffects:4560): pulseeffects-DEBUG: 11:48:52.561: sie: PLAYING -> PAUSED -> VOID_PENDING
^C(pulseeffects:4560): pulseeffects-DEBUG: 11:48:53.034: application:  destroyed
(pulseeffects:4560): pulseeffects-DEBUG: 11:48:53.034: presets_manager: destroyed
(pulseeffects:4560): pulseeffects-DEBUG: 11:48:53.035: soe: destroyed
(pulseeffects:4560): pulseeffects-DEBUG: 11:48:53.035: soe: multiband_gate destroyed
(pulseeffects:4560): pulseeffects-DEBUG: 11:48:53.035: soe: multiband_compressor destroyed
(pulseeffects:4560): pulseeffects-DEBUG: 11:48:53.035: soe: webrtc destroyed
(pulseeffects:4560): pulseeffects-DEBUG: 11:48:53.036: soe: NULL -> VOID_PENDING
(pulseeffects:4560): pulseeffects-DEBUG: 11:48:53.036: soe: pitch destroyed
(pulseeffects:4560): pulseeffects-DEBUG: 11:48:53.036: soe: deesser destroyed
(pulseeffects:4560): pulseeffects-DEBUG: 11:48:53.037: soe: gate destroyed
(pulseeffects:4560): pulseeffects-DEBUG: 11:48:53.037: soe: reverb destroyed
(pulseeffects:4560): pulseeffects-DEBUG: 11:48:53.037: soe: equalizer destroyed
(pulseeffects:4560): pulseeffects-DEBUG: 11:48:53.038: soe: filter destroyed
(pulseeffects:4560): pulseeffects-DEBUG: 11:48:53.038: soe: compressor destroyed
(pulseeffects:4560): pulseeffects-DEBUG: 11:48:53.038: soe: limiter destroyed
(pulseeffects:4560): pulseeffects-DEBUG: 11:48:53.038: sie: destroyed
(pulseeffects:4560): pulseeffects-DEBUG: 11:48:53.038: sie: delay destroyed
(pulseeffects:4560): pulseeffects-DEBUG: 11:48:53.039: sie: autogain destroyed
(pulseeffects:4560): pulseeffects-DEBUG: 11:48:53.039: sie: crystalizer destroyed
(pulseeffects:4560): pulseeffects-DEBUG: 11:48:53.039: sie: convolver destroyed
(pulseeffects:4560): pulseeffects-DEBUG: 11:48:53.039: sie: stereo_tools destroyed
(pulseeffects:4560): pulseeffects-DEBUG: 11:48:53.039: sie: multiband_gate destroyed
(pulseeffects:4560): pulseeffects-DEBUG: 11:48:53.040: sie: loudness destroyed
(pulseeffects:4560): pulseeffects-DEBUG: 11:48:53.040: sie: multiband_compressor destroyed
(pulseeffects:4560): pulseeffects-DEBUG: 11:48:53.040: sie: maximizer destroyed
(pulseeffects:4560): pulseeffects-DEBUG: 11:48:53.040: sie: crossfeed destroyed
(pulseeffects:4560): pulseeffects-DEBUG: 11:48:53.040: sie: exciter destroyed
(pulseeffects:4560): pulseeffects-DEBUG: 11:48:53.040: sie: bass_enhancer destroyed
(pulseeffects:4560): pulseeffects-DEBUG: 11:48:53.045: sie: NULL -> VOID_PENDING
(pulseeffects:4560): pulseeffects-DEBUG: 11:48:53.046: sie: pitch destroyed
(pulseeffects:4560): pulseeffects-DEBUG: 11:48:53.046: sie: deesser destroyed
(pulseeffects:4560): pulseeffects-DEBUG: 11:48:53.046: sie: gate destroyed
(pulseeffects:4560): pulseeffects-DEBUG: 11:48:53.046: sie: reverb destroyed
(pulseeffects:4560): pulseeffects-DEBUG: 11:48:53.046: sie: equalizer destroyed
(pulseeffects:4560): pulseeffects-DEBUG: 11:48:53.046: sie: filter destroyed
(pulseeffects:4560): pulseeffects-DEBUG: 11:48:53.047: sie: compressor destroyed
(pulseeffects:4560): pulseeffects-DEBUG: 11:48:53.047: sie: limiter destroyed
(pulseeffects:4560): pulseeffects-DEBUG: 11:48:53.047: pulse_manager: unloading PulseEffects sinks...
(pulseeffects:4560): pulseeffects-DEBUG: 11:48:53.047: pulse_manager: module 32 unloaded
(pulseeffects:4560): pulseeffects-DEBUG: 11:48:53.047: pulse_manager: module 33 unloaded
(pulseeffects:4560): pulseeffects-DEBUG: 11:48:53.047: pulse_manager: Context was drained
(pulseeffects:4560): pulseeffects-DEBUG: 11:48:53.047: pulse_manager: disconnecting Pulseaudio context...
(pulseeffects:4560): pulseeffects-DEBUG: 11:48:53.047: pulse_manager: context was terminated
(pulseeffects:4560): pulseeffects-DEBUG: 11:48:53.048: pulse_manager: Pulseaudio context was disconnected
(pulseeffects:4560): pulseeffects-DEBUG: 11:48:53.048: pulse_manager: unreferencing Pulseaudio context
(pulseeffects:4560): pulseeffects-DEBUG: 11:48:53.048: pulse_manager: stopping pulseaudio threaded main loop
(pulseeffects:4560): pulseeffects-DEBUG: 11:48:53.048: pulse_manager: freeing Pulseaudio threaded main loop
juan@JUAN-LIN:~$
wwmm commented 4 years ago

As I was afraid it is the kind of problem that does not manifest itself in the log. Could send me the youtube link you used?

JotaJota96 commented 4 years ago

During that test he played this song:

https://music.youtube.com/watch?v=KH8PIsSUd9E&list=OLAK5uy_nESi36IUaDu6wauyiYxEG0dM-MqMF-MKo

In case it helps you, I have connected an external audio recorder to the audio output of the PC, to compare the original and the reproduced audio. (this time using VLC)
I have uploaded them in a .zip to Google Drive

https://drive.google.com/open?id=1iMTxC-t9wX0RT6zTo8PqdQyqEIBBpD5S

Comparing the two audios in a DAW (in my case Reaper 5 in Windows 10) it can be seen that sometimes the audio cut consists of a moment of silence, but other times it does not. I cannot identify if in this second case the audio plays faster than it should or if a fragment of it is omitted

wwmm commented 4 years ago

@JotaJota96 is there any change if you set the block size to 256?

wwmm commented 4 years ago

What is the output of pacmd list-sinks when you are playing something and PulseEffects is running?

JotaJota96 commented 4 years ago

I don't hear any difference when changing the block size to 256. If you need to, I can capture the audio output with the external recorder and thus have reliable evidence to analyze the difference between settings.

This is the output of pacmd list-sinks playing and not playing audio. Not playing audio:

juan@JUAN-LIN:~$ pacmd list-sinks
3 sink(s) available.
* index: 0
name: <alsa_output.pci-0000_07_00.6.analog-stereo>
driver: <module-alsa-card.c>
flags: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY 
state: SUSPENDED
suspend cause: IDLE
priority: 9039
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 request: 0 KiB
max rewind: 0 KiB
monitor source: 0
sample spec: s16le 2ch 48000Hz
channel map: front-left,front-right
Estéreo
used by: 0
linked by: 1
fixed latency: 100,14 ms
card: 1 <alsa_card.pci-0000_07_00.6>
module: 8
properties:
alsa.resolution_bits = "16"
device.api = "alsa"
device.class = "sound"
alsa.class = "generic"
alsa.subclass = "generic-mix"
alsa.name = "ALC891 Analog"
alsa.id = "ALC891 Analog"
alsa.subdevice = "0"
alsa.subdevice_name = "subdevice #0"
alsa.device = "0"
alsa.card = "1"
alsa.card_name = "HD-Audio Generic"
alsa.long_card_name = "HD-Audio Generic at 0xfcc80000 irq 62"
alsa.driver_name = "snd_hda_intel"
device.bus_path = "pci-0000:07:00.6"
sysfs.path = "/devices/pci0000:00/0000:00:08.1/0000:07:00.6/sound/card1"
device.bus = "pci"
device.vendor.id = "1022"
device.vendor.name = "Advanced Micro Devices, Inc. [AMD]"
device.product.id = "15e3"
device.product.name = "Family 17h (Models 10h-1fh) HD Audio Controller"
device.string = "front:1"
device.buffering.buffer_size = "17664"
device.buffering.fragment_size = "2944"
device.access_mode = "mmap"
device.profile.name = "analog-stereo"
device.profile.description = "Estéreo analógico"
device.description = "Family 17h (Models 10h-1fh) HD Audio Controller Estéreo analógico"
alsa.mixer_name = "Realtek ALC891"
alsa.components = "HDA:10ec0867,1565824d,00100002"
module-udev-detect.discovered = "1"
device.icon_name = "audio-card-pci"
ports:
analog-output-lineout: Línea de salida (priority 9000, latency offset 0 usec, available: yes)
properties:
analog-output-headphones: Auriculares analógicos (priority 9900, latency offset 0 usec, available: no)
properties:
device.icon_name = "audio-headphones"
active port: <analog-output-lineout>
index: 1
name: <PulseEffects_apps>
driver: <module-null-sink.c>
flags: DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
state: IDLE
suspend cause: (none)
priority: 9000
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: 1,83 ms
max request: 1 KiB
max rewind: 0 KiB
monitor source: 1
sample spec: s16le 2ch 48000Hz
channel map: front-left,front-right
Estéreo
used by: 0
linked by: 1
configured latency: 10,00 ms; range is 0,50 .. 50,00 ms
module: 28
properties:
device.description = "PulseEffects(apps)"
device.class = "sound"
device.icon_name = "audio-card"
index: 2
name: <PulseEffects_mic>
driver: <module-null-sink.c>
flags: DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
state: SUSPENDED
suspend cause: IDLE
priority: 9000
volume: front-left: 0 /   0% / -inf dB,   front-right: 0 /   0% / -inf dB
balance 0,00
base volume: 65536 / 100% / 0,00 dB
volume steps: 65537
muted: yes
current latency: 0,00 ms
max request: 344 KiB
max rewind: 0 KiB
monitor source: 2
sample spec: s16le 2ch 44100Hz
channel map: front-left,front-right
Estéreo
used by: 0
linked by: 0
configured latency: 0,00 ms; range is 0,50 .. 50,00 ms
module: 29
properties:
device.description = "PulseEffects(mic)"
device.class = "sound"
device.icon_name = "audio-card"
juan@JUAN-LIN:~$

Playing audio:

juan@JUAN-LIN:~$ pacmd list-sinks
3 sink(s) available.
* index: 0
name: <alsa_output.pci-0000_07_00.6.analog-stereo>
driver: <module-alsa-card.c>
flags: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY 
state: RUNNING
suspend cause: (none)
priority: 9039
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: 78,76 ms
max request: 17 KiB
max rewind: 17 KiB
monitor source: 0
sample spec: s16le 2ch 48000Hz
channel map: front-left,front-right
Estéreo
used by: 1
linked by: 1
fixed latency: 100,14 ms
card: 1 <alsa_card.pci-0000_07_00.6>
module: 8
properties:
alsa.resolution_bits = "16"
device.api = "alsa"
device.class = "sound"
alsa.class = "generic"
alsa.subclass = "generic-mix"
alsa.name = "ALC891 Analog"
alsa.id = "ALC891 Analog"
alsa.subdevice = "0"
alsa.subdevice_name = "subdevice #0"
alsa.device = "0"
alsa.card = "1"
alsa.card_name = "HD-Audio Generic"
alsa.long_card_name = "HD-Audio Generic at 0xfcc80000 irq 62"
alsa.driver_name = "snd_hda_intel"
device.bus_path = "pci-0000:07:00.6"
sysfs.path = "/devices/pci0000:00/0000:00:08.1/0000:07:00.6/sound/card1"
device.bus = "pci"
device.vendor.id = "1022"
device.vendor.name = "Advanced Micro Devices, Inc. [AMD]"
device.product.id = "15e3"
device.product.name = "Family 17h (Models 10h-1fh) HD Audio Controller"
device.string = "front:1"
device.buffering.buffer_size = "17664"
device.buffering.fragment_size = "2944"
device.access_mode = "mmap"
device.profile.name = "analog-stereo"
device.profile.description = "Estéreo analógico"
device.description = "Family 17h (Models 10h-1fh) HD Audio Controller Estéreo analógico"
alsa.mixer_name = "Realtek ALC891"
alsa.components = "HDA:10ec0867,1565824d,00100002"
module-udev-detect.discovered = "1"
device.icon_name = "audio-card-pci"
ports:
analog-output-lineout: Línea de salida (priority 9000, latency offset 0 usec, available: yes)
properties:
analog-output-headphones: Auriculares analógicos (priority 9900, latency offset 0 usec, available: no)
properties:
device.icon_name = "audio-headphones"
active port: <analog-output-lineout>
index: 1
name: <PulseEffects_apps>
driver: <module-null-sink.c>
flags: DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
state: RUNNING
suspend cause: (none)
priority: 9000
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: 6,21 ms
max request: 1 KiB
max rewind: 0 KiB
monitor source: 1
sample spec: s16le 2ch 48000Hz
channel map: front-left,front-right
Estéreo
used by: 1
linked by: 2
configured latency: 10,00 ms; range is 0,50 .. 50,00 ms
module: 28
properties:
device.description = "PulseEffects(apps)"
device.class = "sound"
device.icon_name = "audio-card"
index: 2
name: <PulseEffects_mic>
driver: <module-null-sink.c>
flags: DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
state: SUSPENDED
suspend cause: IDLE
priority: 9000
volume: front-left: 0 /   0% / -inf dB,   front-right: 0 /   0% / -inf dB
balance 0,00
base volume: 65536 / 100% / 0,00 dB
volume steps: 65537
muted: yes
current latency: 0,00 ms
max request: 344 KiB
max rewind: 0 KiB
monitor source: 2
sample spec: s16le 2ch 44100Hz
channel map: front-left,front-right
Estéreo
used by: 0
linked by: 0
configured latency: 0,00 ms; range is 0,50 .. 50,00 ms
module: 29
properties:
device.description = "PulseEffects(mic)"
device.class = "sound"
device.icon_name = "audio-card"
juan@JUAN-LIN:~$
xykrr commented 4 years ago

I am also having this issue. Block sizes from 512 to 4096 are just as choppy- it only gets more choppy in any noticeable way when I go below 512. However, this only occurs with playback from mpv, in my case. Playback from DeaDBeeF and Pale Moon is not choppy at all, for example. I've definitely confirmed it's pulseffects causing the choppiness, not mpv. So, it's weird that it's only occurring with one program, in my case...

wwmm commented 4 years ago

That is weird. I would expect higher block sizes to make it worse. Not the other way around =/

I will prepare a test script for you to run. We have to know if this is a GStreamer or Pulseaudio limitation or something that is on our side. The fact that everything is fine without PulseEffects does not help because when doing audio recording things become quite different. And in order to apply effects we record from our virtual devices

wwmm commented 4 years ago

Try the following test. Kill PulseEffects with this command pulseeffects -q and then run:

pacmd load-module module-null-sink sink_name=test sink_properties=device.description=test

Put this code in a file test.py and run it:

#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import gi
gi.require_version('Gst', '1.0')
from gi.repository import Gst

import time

Gst.init(None)

class Test():

    def __init__(self):
        self.pipeline = self.build_pipeline()

        # Create bus to get events from GStreamer pipeline
        bus = self.pipeline.get_bus()
        bus.add_signal_watch()
        bus.connect('message', self.on_message)

        self.pipeline.set_state(Gst.State.PLAYING)
    def build_pipeline(self):
        pipeline = Gst.Pipeline()

        self.audio_src = Gst.ElementFactory.make('pulsesrc', 'audio_src')
        self.audio_sink = Gst.ElementFactory.make('pulsesink', 'audio_sink')

        self.audio_src.set_property('device', 'test.monitor')

        pipeline.add(self.audio_src)
        pipeline.add(self.audio_sink)

        self.audio_src.link(self.audio_sink)

        return pipeline
    def on_message(self, bus, msg):
        if msg.type == Gst.MessageType.ERROR:
            self.log.error(msg.parse_error())
            self.log.error(msg.parse_error_details())

t = Test()
time.sleep(60)

While the program is running open pavucontrol and make mpv or vlc play to this test sink that was loaded.

To unload the null sink created for the test run pacmd unload-module module-null-sink

xykrr commented 4 years ago

Okay, nice. I just did a test- I can further confirm the issue is caused by a mixture of pulseeffects and mpv. When I hold "i" in the mpv window to see active statistics, I notice the bitrate drops down to one or really low when the audio cuts out. There are no drastic bitrate changes like that at the same parts without pulseeffects enabled for that mpv stream or without pulseeffects running. I'm going to investigate my mpv.conf and see if one of my settings isn't playing nice with pulseeffects.

xykrr commented 4 years ago

Ah, I'll run that test after confirming I can't do anything with the mpv.conf

xykrr commented 4 years ago

Okay, fiddled with mpv.conf to no avail. Two things about your test script: a. pulseeffects -q doesn't work- pusleeffects isn't recognized as a command since I installed from snap. When I run the big snap command with -q, it doesn't exactly kill right. I have to use the task manager to finish the job. b. Even when I close out of pulseeffects manually and make sure it's not still running with a task manager, I cannot control what applications use your tesk sink. I see it under the playback tab of pavucontrol, but cannot do anything with it. It will crash sometimes during playback with mpv. I also only see it in Pavucontrol, not the Plasma-PA widget or Plasma audio settings, which might be odd.

xykrr commented 4 years ago

Okay, this just got weird- I've confirmed this ONLY happens with youtube-dl video streams from mpv. It does not happen when I play anything else with mpv. I first tried my opus music collection, seeing as that's the same codec as what I was streaming with- fine, no stuttering. I then try videos I'd downloaded with youtube-dl that are the same h.264/opus hybrid mkv encode as the streamed videos- fine. no stuttering. I then drag 'n drop a youtube video url into mpv- annoying stutters ever so often. Finally, I tried playing a youtube-dl/mpv stream without pulseeffects again- sure enough, no stutters. I guess pulseffects doesn't play nice with youtube-dl- how strangely specific! I wonder why...

wwmm commented 4 years ago

Strange. I could move the app to the test sink in Pavucontrol. I don't know why this did not work for you.

I imagine mpv is doing something very different when creating its Pulseaudio stream for youtube-dl. The audio codec does not matter because audio processing is done only to raw frames.

How do I use this feature in mpv? I need a way to reproduce this issue.

xykrr commented 4 years ago

Dependencies must have been resolved- I was able to install PulseEffects through the ppa yesterday. As expected, stuttering still occurs with mpv/youtube-dl.

The audio codec does not matter because audio processing is done only to raw frames

Interesting

How do I use this feature in mpv? I need a way to reproduce this issue.

Once you've ensured you have both the youtube-dl and mpv packages, you can use this feature with the command "mpv [insert url here]". You can also simply drag and drop urls onto an mpv window.

wwmm commented 4 years ago

As drag and drop did not work here(probably because I am on wayland) I used the command line. So far I did no see any stuttering. This must be one of the cases where you need a specific combination of software and hardware to trigger the issue =/

wwmm commented 4 years ago

As you can see in the last post at #568 the kernel developers had to disable a feature in my card driver. This in turn forces Pulseaudio to use a legacy behavior. I wonder if this is the reason why I do not see these stuttering. Maybe it is something that only happens when Pulseaudio is using timer based interrupts(considered the desired behavior) instead of IRQ scheduling and we record audio from a sink monitor.

xykrr commented 4 years ago

I am on wayland This must be one of the cases where you need a specific combination of software and hardware to trigger the issue

That got me thinking- I hadn't tried out wayland yet. Sure enough, there were still occasional breaks in audio =/ Keep in mind, sometimes minutes span between breaks, and other times seconds. Add that they are totally random, and it's possible you just got lucky.

had to disable a feature in my card driver. This in turn forces Pulseaudio to use a legacy behavior

Huh, okay. Come to think of it, I used PulseEffects every so often with my old external dac that broke a few weeks ago. Actually, I started using PulseEffects more after the DAC broke since it was a MiniDSP serving my eq needs =P Anyway, I don't recall mpv/youtube-dl audio breaks when I used it. This furthers the bad hardware/software combo idea- my internal sound card might be finicky with whatever low level PulseAudio thing is going on.

Maybe it is something that only happens when Pulseaudio is using timer based interrupts(considered the desired behavior) instead of IRQ scheduling and we record audio from a sink monitor.

Hmm, maybe

mikenrafter commented 3 years ago

Have you tried troubleshooting Pipewire itself? I know that my mic inputs get choppy unless this value is high:
pulled from here -

"to solve this problem edit /etc/pipewire/media-session.d/alsa-monitor.conf, uncomment the line saying api.alsa.headroom = 0 and change its value to 1024. "

On another note, I'm having this same issue, on some audio streams I tune in to. For example, whenever I watch YouTube with Firefox. The issue doesn't occur when I watch things on yewtu.be, however. Which leads me to believe that it's caused by missed audio cycles, but then I disable my output effects in easyeffects, and the problem goes away somewhat.

wwmm commented 3 years ago

If this still happens on EasyEffects feel free to open another issue.