mini-eq icon indicating copy to clipboard operation
mini-eq copied to clipboard

[Bug]: mini-eq stops processing after some time

Open jtl5770 opened this issue 6 months ago • 33 comments

Before opening

  • [x] I searched existing issues for a similar report.
  • [x] This is not a security vulnerability.

Affected area

Other

Mini EQ version

0.8.1

Install method

Flathub

Linux distribution and version

Fedora 44

Desktop/session

Gnome Wayland

PipeWire and WirePlumber versions

No response

Steps to reproduce

Open youtube, play something. Let mini-eq do its thing. Wait a while (and here is what seems be true, but maybe I just havn't experienced otherwise) after there is no more sound output from the system. Start playing a video again .

Expected behavior

mini-eq processes audio of the second video

Actual behavior

no more processing though the controls indicate that mini-eq should still be working. No change in routing by switching between headphones and speakers need to take place. The amount of time is not always the same, it doesn't always happen, but whenever I leave the laptop alone and come back to listen to audio again it seems to be switched off. Maybe there is some connection to locking the session/switching the screen off? But a quick check to trigger it by locking the session didn't reveal the bug.

So we are either back to where we have been at a couple of versions ago or introduced something new - or I didn't test enough the last time.

Logs or terminal output


jtl5770 avatar May 15 '26 13:05 jtl5770

Thanks, this sounds like the routing/processing path becomes stale after an idle period rather than the UI switch itself turning off.

When it happens again, before toggling anything, could you please capture:

flatpak info io.github.bhack.mini-eq
wpctl status
pw-link -l
journalctl --user --since "10 minutes ago" | grep -iE "mini-eq|pipewire|wireplumber|filter-chain"

The key thing I want to see is whether the playback stream is still connected to mini_eq_sink, and whether the filter-chain output is still linked/active to the real output sink.

Also useful:

  • Does toggling only System Audio off/on revive it?
  • Does toggling only Monitor off/on revive it?
  • Does changing one EQ band revive it without touching routing?
  • Which browser/player was used when it happened?
  • Which PipeWire and WirePlumber versions are installed?

This may be related to the earlier idle/routing issue, but from your description this one sounds narrower: Mini EQ still believes routing is enabled, while the actual PipeWire processing path may no longer be active after silence, screen-off, or stream recreation.

bhack avatar May 15 '26 14:05 bhack

Also an extra info when this happens, did the machine auto-suspend, or was it only locked/screen-off?

bhack avatar May 15 '26 14:05 bhack

Some questions I can answer rtight away:

  • Machine was NOT suspended.
  • It does NOT only happen on screen lock / off
  • Player was just youtube in chrome
  • flatpak info io.github.bhack.mini-eq

Mini EQ - Tune your sound output

        ID: io.github.bhack.mini-eq
       Ref: app/io.github.bhack.mini-eq/x86_64/stable
      Arch: x86_64
    Branch: stable
   Version: 0.8.1
   License: GPL-3.0-or-later
    Origin: flathub
Collection: org.flathub.Stable

Installation: system Installed Size: 71.6 MB Runtime: org.gnome.Platform/x86_64/50 Sdk: org.gnome.Sdk/x86_64/50

    Commit: b492cef597f6021f61e63513b7626c5e5bdf40cb0ae72228e2dac3c2c1695641
    Parent: 46f8995d50350836b8099a42fa8acaad29ba329efbe049abce02fe86697dcfc9
   Subject: Merge pull request #22 from flathub/update-0.8.1 (24b93dd424aa)
      Date: 2026-05-14 17:40:26 +0000

jtl5770 avatar May 15 '26 15:05 jtl5770

would the following help to make it more robust:

diff --git a/src/mini_eq/pipewire_stream_router.py b/src/mini_eq/pipewire_stream_router.py
index 35e0110..8473f98 100644
--- a/src/mini_eq/pipewire_stream_router.py
+++ b/src/mini_eq/pipewire_stream_router.py
@@ -318,6 +318,8 @@ class PipeWireStreamRouter:
         if self._link_touches_processing_path(link):
             self.track_processing_link_state(link)
             self.schedule_refresh(route_applied=True)
+        else:
+            self.schedule_refresh()
 
     def handle_object_removed(self, _manager, node) -> None:
         try:
@@ -326,6 +328,7 @@ class PipeWireStreamRouter:
             return
 
         self.untrack_processing_link_state(link)
+        self.schedule_refresh()
 
     def untrack_processing_link_states(self) -> None:
         for handler_id in list(self.link_state_handler_ids.values()):

jtl5770 avatar May 15 '26 15:05 jtl5770

it seems too broad... the risk is it is that it is going to react to "noise". Without the log it is hard to modelling your case but I've tried to simulate it at best as as it was described:

Can you stress test this version: flatpak install --user -y https://dl.flathub.org/build-repo/284925/io.github.bhack.mini-eq.flatpakref flatpak run io.github.bhack.mini-eq

bhack avatar May 15 '26 16:05 bhack

I will try that one. In the meantime I have updated the patch to include Node State Monitoring. Mini EQ now explicitly watches the status of the nodes in its processing path (the virtual sink, the filter output, and your hardware speakers).

Whenever any of these nodes transition to the running state, Mini EQ will now:

  1. Recalculate the EQ coefficients for the current (possibly new) sample rate.
  2. Re-apply all filter parameters to the engine immediately.
  3. Verify that routing is still correct.

Maybe still too much done for your taste, so just ignore if it is rubbish.

fix-processing-loss.patch

jtl5770 avatar May 15 '26 16:05 jtl5770

May it have made a difference that I now run it with the monitoring turned off to spare some cycles? If the theory about suspending/resuming is correct, having the little monitor in the extension may have been enough to keep things always running? Just a wild guess. I will of course still send you your logs whenever I see it happen again.

jtl5770 avatar May 15 '26 17:05 jtl5770

Thanks, that extra clue is useful. Please test the Flathub build with the same setup that triggers the issue, especially with Mini EQ monitoring turned off if that is how you now run it:

flatpak install --user -y https://dl.flathub.org/build-repo/284925/io.github.bhack.mini-eq.flatpakref
flatpak run io.github.bhack.mini-eq

If it happens again, before toggling Mini EQ, please capture:

wpctl status
pw-link -l
journalctl --user --since "10 minutes ago" | grep -iE "mini-eq|pipewire|wireplumber|filter-chain"

Your node-state patch is useful as a reference, but I want to first verify the narrower relink recovery fix. If this build still fails, the next thing to investigate is probably node resume/running state and whether we need to re-apply filter controls after PipeWire wakes the processing path.

Also, could you check whether turning Mini EQ monitoring back on makes the issue disappear or become harder to reproduce? That would be a strong signal that the graph is being kept active by the monitor path.

bhack avatar May 15 '26 17:05 bhack

I had one account now where switching back from a headphone to the laptop speaker was not processing, and switching on the monitoring made it work. To my shame I have to admit that instinctively played with the toggles not gettign the logs first :-( sorry, will do next time

jtl5770 avatar May 15 '26 19:05 jtl5770

This sounds like a related but slightly different case: switching from headphones back to laptop speakers may leave the processing path stale while Mini EQ still thinks routing is enabled.

Turning Monitor on probably recovered it because enabling the monitor refreshes/restarts part of the audio graph, so it is a useful clue, but I do not think the monitor should be required for processing to work.

No problem about the missing logs. If it happens again after switching headphones/speakers, please capture these before toggling anything:

wpctl status
pw-link -l
journalctl --user --since "10 minutes ago" | grep -iE "mini-eq|pipewire|wireplumber|filter-chain"

bhack avatar May 15 '26 19:05 bhack

I pushed a new test build with the routed-stream recovery changes.

Could you please install and test this build against the same scenario you reported?

flatpak install --user -y https://dl.flathub.org/build-repo/285058/io.github.bhack.mini-eq.flatpakref
flatpak run io.github.bhack.mini-eq//test

What would be most useful to check:

  • Start Mini EQ and enable system audio routing.
  • Play audio from the same app/setup that triggered the issue.
  • Reproduce the output change/relink case you saw before.
  • Confirm whether audio keeps routing through Mini EQ after the output comes back.
  • If it fails, please include the exact steps and any terminal output from launching with the command above.

bhack avatar May 16 '26 03:05 bhack

OK, I will test the new version. Even the version before seems to at least have reduced the instances of stopping theprocessing, as I was yesterday not able to reproduce it anymore, but we will see. Unfortunately this "listening on headphones, then changing back to speakers and it stopeed processing" was not easily reproducible even on the versions before your changes, so I can do nothing more than running it and hoping to trigger one of the remaining corner cases.

jtl5770 avatar May 16 '26 10:05 jtl5770

Even if it is not easily reproducible, the exact shape you saw is useful: headphones -> laptop speakers, Mini EQ still enabled, but processing stops; enabling Monitor then makes it work again.

This case is hard for me to simulate exactly because software jack injection on ALSA needs a kernel built with CONFIG_SND_JACK_INJECTION_DEBUG and a driver that exposes jack controls.

The closest real case I could reproduce locally was HDMI output disconnect/reconnect.

That exposed a PipeWire shape that is probably related: the output can come back with the same node name but a new PipeWire object serial.

The previous Mini EQ code build-repo/284925 treated the same name as “nothing changed”, so the filter output could keep pointing at a stale object. The new test build specifically fixes that.

For the new build, the most useful test would be:

  1. Run Mini EQ with Monitor off, if that is your normal setup.
  2. Enable system audio routing.
  3. Play YouTube/Chrome through headphones.
  4. Switch back to laptop speakers.
  5. Check whether Mini EQ keeps processing without needing to toggle Monitor or System Audio.

If it fails again, before toggling anything, please capture:

wpctl status
pw-link -l
journalctl --user --since "10 minutes ago" | grep -iE "mini-eq|pipewire|wireplumber|filter-chain"

bhack avatar May 16 '26 10:05 bhack

So I am confident enough it could be fixed but I don't have the real jack plug event from the kernel with my HW

flatpak install --user -y https://dl.flathub.org/build-repo/285058/io.github.bhack.mini-eq.flatpakref
flatpak run io.github.bhack.mini-eq//test

bhack avatar May 16 '26 10:05 bhack

I just realised I may have mislead you with my side remark of stopping processing when switching from headphones to speakers again :-(

I was refering to bluetooth headphone -> speaker output. I didn't experience a problem with the cable bound headphones -> speaker output in quite a while (but then this is a rarer event for me to use in the first place).

I just tested both scenarios (with monitoring off) on 285058, and it worked. I will still have to see if there is any stopping of processing in the nbormal path of just using speakers, but having times of not producing audio and then playing again, but so far I was unable to do so, even with monitoring off. I am very sure that in the moment you release a new version, I will be able to hit it again :-( just kidding, let's hope it is fixed for good.

jtl5770 avatar May 16 '26 12:05 jtl5770

In that case the ALSA jack-injection limitation is less relevant, since the case you saw was Bluetooth headphones -> speakers rather than wired headphones -> speakers.

That still fits the broader class of issue I was trying to fix: PipeWire/WirePlumber can recreate or relink the real output while Mini EQ still thinks it is routed, and the filter-chain output can end up pointing at an old target. Good to hear that both Bluetooth -> speakers and wired headphones -> speakers worked on 285058 with Monitor off.

The remaining useful test is exactly your normal path now:

  • Monitor off, if that is how you usually run it.
  • Use speakers normally.
  • Let audio go idle for a while.
  • Start playback again and check whether Mini EQ still processes without toggling Monitor/System Audio.

If anything new will emerge on your system I will do a new point release later today

bhack avatar May 16 '26 14:05 bhack

v0.8.2 released

bhack avatar May 16 '26 19:05 bhack

It happened again with 0.8.2. This time I have made the log files you wanted to see.

journal.txt pw_link.txt wpctl_status.txt

jtl5770 avatar May 17 '26 17:05 jtl5770

and of course the normal setup - just listening via speakers. Don't let the "Headphones" output confuse you, that is in fact a upnp player connected to my headphones amp.

jtl5770 avatar May 17 '26 17:05 jtl5770

From pw-link, routing itself still looks correct: Google Chrome is linked to mini_eq_sink, and mini_eq_sink_output is linked to the built-in analog sink. So this does not look like the stale/missing output link case that 0.8.2 fixed.

That points to a different failure mode: the graph remains routed, but the filter-chain path or its controls stop effectively processing after the audio path has been idle/resumed.

The journal does not show an obvious Mini EQ/filter-chain error. The “Headphones” note is clear the active sink in the capture is the built-in analog output.

I am going to reopen this and investigate re-applying filter controls / reacting to processing node resume events. If you can reproduce it once more before toggling anything, one extra capture would help:

pw-dump > pw-dump.json

pw-dump includes node/link state and object details that pw-link -l does not show.

bhack avatar May 17 '26 20:05 bhack