Hello. I want to write an Udev rule to change my laptops's EasyEffects profile whenever I connect a speaker set or headphones to the 3.5mm jack. The concept is relatively simple: when I connect something to the jack, I want it to fire a script that will set this Dconf setting:
gsettings set com.github.wwmm.easyeffects last-loaded-output-preset 'None'
And when I unplug the speakers/headphones, it'll set this:
gsettings set com.github.wwmm.easyeffects last-loaded-output-preset 'Laptop'
("None" and "Laptop" are EasyEffects profiles).
Unfortunately, I haven't been able to find useful info, since almost all of the results I found online refer to Bluetooth or USB devices. I checked within /sys/class/sound/ and /dev/ for a file where I could query the status of the jack (something like "connected"/"disconnected") but I can't find something relevant. I have a similar rule that changes GNOME's font scaling when I plug my HDMI display, and it does that by running this script:
function monitorConnected () {
statuses=$(cat /sys/class/drm/card1-HDMI-A-{1,2,3,4}/status 2>/dev/null)
for status in ${statuses[@]}
do
[[ ${status} == "connected" ]] && return 0
done
return 1
}
So I thought that I could do something similar for the 3.5mm jack. Or maybe there's another method? Any hints? My OS is Fedora 41 and I'm using Pipewire, btw.
I have this issue where certain apps stop playing audio for a few seconds, then resume. The issue happens randomly, and it seems it's caused by a buffer underrun, but I haven't been capable of finding a solution. It happens with most audio players: QuodLibet, Fooyin, Rhythmbox, Strawberry, Clementine. It doesn't happen at all with MPD or web browsers.
I've tried configuring Pipewire, GStreamer, and ALSA with no avail. And at this point I'm too tired, really. I'm using Fedora now, but the issue has happened on Endeavour and Debian too, so... ¯\(ツ)/¯