New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Jamming/stuttering during playback from the Chromium #222
Comments
Run PE in debug mode |
Start at 17:18:25. Strong lags at 17:18:42, 17:18:57 and 17:19:36. Just intensively switching Chromium tabs, refresh pages and start Atom Editor. Later there can be small lags during to regular computer usage (and music listening). |
Switch from integrated card to external at 18:05. And crash (related to #217 (comment), I think). |
11:52 — definitely multiple lags without heavy CPU loading. |
It continues to lag. Without any logs sometimes. |
100% scenario:
Got 2 lags per page loading (
|
I see nothing wrong in the logs. In order to save battery PulseEffects pauses its pipeline when no audio app is playing and puts it back online when an app wants to play something. But despite of the many Does this happen in other browsers or only in chromium? I use chrome and at least in youtube, netflix and crunchroll I have no problems when switching tabs or doing other stuff |
YoutTube in Chromium: the same lags for Beatport page. Google Play Music (GPM) in Firefox: everything is OK, no lags. And no logs from PulseEffects! GPM in Google Chrome (stable): the same lags, the same logs. So, where are logs — there are lags, probably.
But for what |
The same in the version 4, but there are no any logs in the debug mode ( |
Can you add please more debug logs? I'll attach them here when these situations occur. |
In version 4 I added a lot of debug messages. I am not sure if there is much more that can be added. Could you try to provide the other info mentioned at Reporting Bugs. Maybe there is some clue there |
Yeah, sure:
Arch Linux, GNOME Shell 3.28.2-1
4.0.1-1 Oops, I realized that I have loaded modules from another equalizer: https://wiki.archlinux.org/index.php/PulseAudio#Load_equalizer_sink_and_dbus-protocol_module I'll try to use PulseEffects without them. If I'll have any trouble — I'll write there remain answers. Sorry, but I have the same troubles for Beatport page, for example. So…
Regular: When Beatport page loading, and there are some sound lags (the new one appears at the end): But I have lags also when there is no additional channel. Other tabs: |
|
Thank you, but it didn't help too much. :( Maybe a little. |
I found that when setting Sound Preferences to use PulseEffects(apps) for all output, there's lots of distortion especially when multiple sound streams happen. (simple sound effects in GNOME/MATE desktop create great amounts of distortion and stuttering.) If you use "Audio Analog Stereo" (or your default output sink itself without PulseEffects), there is no issue. (And then, individually enable PulseEffects for something like YouTube on Chrome.). If I do this, I get the least amount of stuttering. The second that I tell the mixer to use the PulseEffects device for all output, there's lagging, stuttering, distortion, and just the unsettling feeling that doing any little thing on the computer will throw off the audio. I tried screwing around with buffer and block size in dconf, but doesn't seem to change much or just gets worse. I'm trying to get debug logs but nothing at all prints when I type the pulse effects debug command. I'm going to try and figure out why and post anything I can find. Also, the other issue with using the PulseEffects sink in the volume mixer is that volume control doesn't work or stutters/lags like crazy when the volume is adjusted. It almost seems like there's some sort of feedback loop going on, but I can't tell exactly. |
@xtknight, thank you! |
After selecting "Built-in audio" it resets everything to use the default device, so you have to go back in PulseEffects and enable for each app individually. (And apparently it resets to default every time a new stream even starts in Chrome...hmm) I haven't yet experimented much beyond just using Chrome with PulseEffects, but let me know if this helps solve the stuttering issue. Then, we can figure out if it's an issue with multiple streams itself, or just an issue with having PulseEffects as the default system-wide sink in Sound Preferences. |
@xtknight you should see log output when running PE as You should never select Multiple streams should not be an issue as long as you use the limiter as the first plugin in the effects chain. Other plugins may have their input saturated when there is a lot of apps playing audio. In case you do not want to enable each app individually you can turn on the option @AlexWayfer does this fix your problem? |
@wwmm: thanks for the insight. Would probably be a good idea to mention in documentation in red letters that using PulseEffects as the default device is bad. The workflow of the system wasn't clear to me at first. (apologies if I happened to miss something). I'm not sure if this was the original poster's problem, but just throwing it out there because that's what gave me similar issues. In my case, using 'Enable all apps' with two concurrent audio streams from Chrome with the Equalizer enabled results in no discernable stuttering. Audio playback seems fluent; real happy with it. Let's hope the same holds true for the OP. The EQ saved my new headphone purchase. |
Now that we finally have documentation it is a good idea to tell this there. I will try to remember to do that :-) |
@wwmm I've also discovered some stuttering and jamming, as well as crackling with multiple streams. It doesn't seem to happen on one stream (or perhaps, it just happens a lot less?). I can hear one of the streams start to play a tad faster or slow down all of a sudden. I suppose that because the pulseeffects process is scheduled on the CPU like any other process, this is possible, but I wonder how pulseaudio avoids the issue. I suppose that this could be the same issue the original poster is happening. It's faint, but quite noticeable even when I try to ignore it. Interestingly, the time it takes certain streams to start also seems to be affected, but I haven't been able to measure this objectively. (After I press play on YouTube, it takes longer than I usually remember for the audio to begin actually playing.) There's nothing special printed in the logs about it, and I'm pretty sure it's just a timing-related issue. Example case: Turning on the Test Signals triangle wave and then starting any other stream causes a brief crackling. The crackling also sometimes happens at random times during playback. This happens even with no effects enabled. Example case 2: Adjust volume on the applications tab inside of PulseEffects when enabling it on that app vs. disabling it on that app. When disabled, volume control is smooth and normal, but when enabled, it sounds like the audio is chopped up and distorted, with portions of it replaying, every time the volume is adjusted. This is even with no effect filters enabled. pulseeffects CPU usage: Some logs: (pulseeffects:1868): pulseeffects-DEBUG: 20:07:30.079: calibration_signals: READY A lot of streams take around 2 seconds to start, like you see here. (20:07:30~20:07:32) Is this normal? But it's not always like this. Sometimes they start instantly, sometimes they delay for 2 seconds. I'm not sure what the pattern is. |
My active output device is sound card, not PulseEffects. Limiter is the first, but disabled, plugin:
For me it happens also when here is a single stream (screenshot above). 😞 |
I can try to programmatically record these lags, but I don't know a good way to do this. |
One of the things that make this kind of problem hard to fix is that they are not easy to describe in words. Specially to non native english speakers like me. So an audio and video recording can help @AlexWayfer. @xtknight I believe the crackling you hear is caused by audio clipping (the input of something was saturated). I did some tests here with the test signal generator and it seems we can not protect everything with the limiter. We should take care to not saturate the null sinks used by PE ( Unfortunately the only thing that can be done in this case is reduce the volume. I can't avoid the null sink saturation from PE. This would have to be done in Pulseaudio. The delays you see sometimes is normal. PE always checks if there is an audio app actually playing. If there is none our GStreamer pipeline is put in the null state. This is done to save power in laptops and on other machines with weak processors. There is no point in processing silence. Whenever you add a stream while there are others playing the delay will not occur because our GStreamer pipeline do not have to be restarted. The noises that happen when change volume usually disappears when we set a lower latency in PE settings menu. Like 1000 us. I honestly don't know what happens between GStreamer and Pulseaudio under the hoods that could explain this. But I never heard sections being replayed. I really doubt that PE logs will show anything useful for all the issues reported here. It seems to me that this problem is at a lower level. Maybe in GStreamer or in Pulseaudio. Maybe we should start to look at their logs. Pulseaudio logs can be taken with the steps in the advanced section of Reporting-Bugs. Gstreamer logs can be taken executing pulseeffects as |
Some logs at some lags (not every) from
Output of |
The |
I missed it! Sorry. But it's empty anyway after:
Done. No logs from
Buffer is With |
|
Thanks. After upgrade I noticed:
(audible lags at warns) I have always Telegram Desktop running. Can it affect? |
It was a good thing to improve the logs by adding the app name. Now we know why you have the Telegram developers are aware of this problem but the issue is still open after 2 years telegramdesktop/tdesktop#2231 |
@wwmm, thanks! Also, maybe this can be helpful: telegramdesktop/tdesktop#4219 (comment) |
He is not totally right. There will be some latency introduced of course. But this doesn't mean you can't equalize voip calls. I did this a few times in skype with no problems. The app role will not make difference in our case. PulseEffects does not use it. It is up to the user to decide if he/she wants to apply or not effects to a given app |
There is a part from v4.3.5 logs:
|
The same problem when I just change the volume of Chromium in PulseEffects: There are logs:
|
Some logs from
|
Based on the amount of |
OK, thank you, I'll watch. FYI: I didn't rewind anything. |
No user can do rewinds. Pulseaudio does when it thinks it is necessary. There is no way we can influence its decision |
It's probably related to aleho/gnome-shell-volume-mixer#83 I'll monitor such issues while this extension is disabled. Previously, I found many errors from |
Nope, there is something else… |
Version 4.5.6:
Approximately one time per one minute. From
I don't know if there something bad. I guess, no. But there is still the issue… |
These rewinds are happening because you paused/unpaused the audio app. Rewinds are known to cause noises when changing the app volume. I wonder if this could be caused by some problems in the soundcard driver. What is the card's model? |
No! It's one stream, unpaused play.
I didn't change for while these logs were collected.
Orico SC1. It's also reproducible with Sound Blaster Play! 3 (If I remember it right). |
This is odd. The line |
I didn't.
It's interesting. As I wrorte above, I see only Chromium in PulseEffects applications list, and I don't do anything except browsing, tabs reloading, etc. Maybe some tabs with |
It could be. Maybe the way chromium handles the creation and destruction of each tab stream is causing a similar effect to change the app volume. Pulseaudio's rewind bug is triggered and noises can be heard. |
Do you have any link to this bug? Or it's just a suggestion? The sad part (for me) here is that I can't collect enough logs of PulseEffects or PulseAudio, and even if I will report to PulseAudio "something is going wrong" there will be the one detail: these noises appear only with PulseEffects, and PulseAudio, I guess, will direct me here. |
https://lists.freedesktop.org/archives/pulseaudio-discuss/2018-October/030553.html In order to apply effects we have to record from a Pulseaudio null sink monitor. But accordingly to what one of Pulseaudio's developers told in the first link if a rewind in this sink happens while we are recording from its monitor noises will be produced. As you can see in the second link this bug has been around for a while. |
@wwmm, thank you! The sad story about PulseAudio (for me) 😔 : |
I found the essence of this problem: change the volume of application (Chromium for me) in PulseEffects: vokoscreen-2019-05-14_18-48-38.zip (Sorry for bad quality of video record, but the sound is exact). Also, I'm playing only one audio (tab), I don't know why there are two applications (streams). At pause (after some time) there is only the first (with |
The noises caused by volume changes have the same source as #350. It is a Pulseaudio bug. I have sent some patches to its developers that will help me to workaround this bug as you can see here https://gitlab.freedesktop.org/pulseaudio/pulseaudio/merge_requests/93. They didn't merge them yet but I think that this is probably going to be done before Pulseaudio 13 is released. I have no idea why chromium created more than one stream. But it did. At first site I thought that PE duplicated the entries but they have different latencies and when you changed the volume of the top stream nothing happened. So it is not a duplicated stream. |
Yes, I remember. I just wanted to share a clear example.
Thank you very much!
Yes, maybe it's something like audio element for notifications in some tab, I don't know. |
I don't experience this issue with git version of Thank you very much for work. Now I can enjoy the adjusted (bass-boosted) music finally. |
Usually when I switch work-spaces, refresh web-pages, some other CPU-loading tasks, but sometimes when no activity at all. But resources are OK:
External USB sound-card (more often) and integrated into motherboard (less often).
(UPD: Now for integrated it occurs as often as for external)
Settings (only Bass Enhancer is enabled):
The text was updated successfully, but these errors were encountered: