Linux HOWTO Kodi with Equalizer on LinuxMint 20.1 - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33) +--- Forum: General Support (https://forum.kodi.tv/forumdisplay.php?fid=111) +---- Forum: Linux (https://forum.kodi.tv/forumdisplay.php?fid=52) +---- Thread: Linux HOWTO Kodi with Equalizer on LinuxMint 20.1 (/showthread.php?tid=360514) |
RE: HOWTO Kodi with Equalizer on LinuxMint 20.1 - wastis - 2021-10-19 (2021-09-12, 09:40)heysoundude Wrote: What about on the Pi4? 4GB of RAM should help… Ok, I did a closer look to it, still using Pi3, the performance actually is not the problem, it consumes about 25% of one core, so 6% overall. The problem currently is that Kodi somehow is set to ALSA output only, so far I did not manage to output the sound directly to pulseaudio (without ALSA in-between). There is this ALSA plugin pulseaudio, which is currently use for BT devices. I did hijack this to route the audio from Kodi via ALSA to the pulse equalizer and this works perfect with the annoying drawback, that the audio latency naturally caused by the equalizer is not reported back to Kodi and thus Audio and Video are out of sync of about 350ms. Currently I have no Idea how to fix this other than changing Kodi source, a route I currently don't want to go. The changes to the Kodi PulseEqualizer GUI Addon are minor and only required if ALSA would remain the main source for the equalizer. Any ideas are welcome, I did use latests Raspberry Pi OS Lite version for testing with default Kodi 18.7. EDIT: OK, I go this sorted. Update on Addon package will follow. RE: HOWTO Kodi with Equalizer on LinuxMint 20.1 - wastis - 2021-10-20 Hi all, I have published a new release v1.0.3 on git, which will also run on raspberry PI 3 OS Lite and headless systems. Please see README.md for the specific startup on raspberry and headless systems. PulseEqualizerGui v.1.0.3 RE: HOWTO Kodi with Equalizer on LinuxMint 20.1 - wastis - 2021-11-15 And an other release with major changes in the software design and many new features and improvements.
PulseEqualizerGui v2.0.0 RE: HOWTO Kodi with Equalizer on LinuxMint 20.1 - MicTie - 2021-11-30 Hi, thank you for providing this plugin! I have installed the plugin on my Jetson Nano running Ubuntu 18.04 and Kodi 19.3 and I am unable to get it running. Pulseaudio-equalizer is installed, and the plugin seems to load normally. I am able to select the output and the latency, but nothing shows when I click on Equalizer, or the profile related settings. The kodi.log shows: Code:
The Github-page lists only 'pulseaudio-equalizer' as a requirement, this forum shows a lot of additional requirements - but these might be related to older plugin-versions only. Maybe you can give me some hints on what could be missing or wrong. Thank you RE: HOWTO Kodi with Equalizer on LinuxMint 20.1 - wastis - 2021-11-30 Hi @MicTie I have not tested it on ubuntu 18 however this looks like an user session problem, so dbus is not running or not accessible from Kodi. This indicates an startup script problem. Is this a headless system, so without a desktop? One test could be: - exit Kodi(not shutdown) - login to the machine via ssh as user and check if pulse audio is running Code: ps -ef | grep pulseaudio if you have the same output, then start Kodi from here Code: kodi & and then check if it is working now. 2. In Kodi, enable debug logging (Kodi- settings -> system -> expert modus -> logging -> enable debug logging try to run equalizer copy .kodi/temp/kodi.log to https://paste.kodi.tv/ and provide me with the link, so I can check whether this is an addon bug. RE: HOWTO Kodi with Equalizer on LinuxMint 20.1 - MicTie - 2021-11-30 Hi @wastis , this was fast - thanks! My system is a desktop, using my TV as display, although most of the time I connect headless via SSH. 'pulsaudio' is started, but not 'demonized' Code:
Also dbus is installed and running: Code:
Here the link to my kodi.log RE: HOWTO Kodi with Equalizer on LinuxMint 20.1 - wastis - 2021-11-30 Hi @MicTie yes, it is a session / pulseaudio startup problem, indicated here. Code: 2021-11-30 21:47:06.358 T:20857 ERROR <general>: eq: PulseDBusError: ('org.freedesktop.DBus.Error.ServiceUnknown\nThe name org.PulseAudio1 was not provided by any .service files\ndetail: python3 on connect',) So pulseaudio does not publish the service to the user who did launch Kodi. who is the kodi user, so the user who fires kodi up, is it also michael? Code: ps -ef | grep kodi have you been able to start kodi from a ssh session? RE: HOWTO Kodi with Equalizer on LinuxMint 20.1 - wastis - 2021-11-30 Hi @MicTie I thought about this again. As a work around, you could try to connect directly to the dbus socket, if it exists. To do so do the following. figure out your userid Code: cat /etc/passwd | grep user the first 1000 is the userid. check if socket exists Code: ls -l /run/user/1000/pulse set the environment variable in your startup script Code: PULSE_DBUS_SERVER=unix:path=/run/user/1000/pulse/dbus-socket cat /etc/systemd/system/kodi.service Code: [Unit] Further you could either enable logging for pulseaudio -vv in your startup script or stop the pulseaudio service and start pulseaudio in a ssh session and look at the beginning of the log. Code: systemctl --user stop pulseaudio.service Finally I did set up a headless server on ubuntu 18.04.6 LTS with Kodi and equalizer, so I can confirm that it is working on Ubuntu 18.04.6 LTS without any problems. RE: HOWTO Kodi with Equalizer on LinuxMint 20.1 - MicTie - 2021-12-01 Hi @wastis, thanks for your help. I got it running by adding 'Environment = PULSE_DBUS_SERVER=unix:path=/run/user/1000/pulse/dbus-socket' to my kodi_start.service Code:
I still have a couple of questions: which output-device do I have to select in System->Audio? I see among others HDMI/PULSAUDiO (which I usually use) but also EQUALIZER? which output device do I have to select in the Equalizer-Plugin? is it HDMI/PULSAUDIO? what is the best way to use a specific (default) profile automatically? am I right to say that the plugin a NOT working when I use PASSTHROUGH? (I am using it most of the times to enjoy DOLBY/DTS-sound ... Thank you! RE: HOWTO Kodi with Equalizer on LinuxMint 20.1 - wastis - 2021-12-01 I am glad it worked for you. Yes, pulseaudio equalizer should not touch the audio stream if you use pass through - the purpose of pass through. The equalizer should not be in the output chain in this case. You have a number of options to configure your output. So in principle, you could select any pulse audio device as output device and switch pulseaudio equalizer on/off, dependent if you want to use pass through or not. You could also select "Equalizer" as output, which then routes it's output to default pulse audio device. In this case, you do not have pass through. Another option could be to have another persistent equalizer module loaded with your preferred settings (channels, rate, output device) and select between this persistent equalizer and direct output, dependent on pass through. More details on how to do this is in the advanced configuration in github. Automatic switch depended on pass through is currently not implemented. I need to investigate on whether this can be done and implemented. However my focus and priority is currently on digital room correction per channel. Enjoy RE: HOWTO Kodi with Equalizer on LinuxMint 20.1 - MicTie - 2021-12-01 Thank you so much for your fast and efficient help! RE: HOWTO Kodi with Equalizer on LinuxMint 20.1 - wastis - 2021-12-01 @MicTie Ok, I think I may have found the root cause of the problem testing your startup script. It seems that Kodi and with this the addon is launched before the filesystem /run/user/1000/pulse is set-up properly. So in your case, the pulseaudio dbus service is not available by the time Kodi is launched. I avoid this by using "su" in my startup. Maybe there is an optimization of the "After" targets possible. @all, a recommendation on an optimized startup script would be appreciated. RE: HOWTO Kodi with Equalizer on LinuxMint 20.1 - MicTie - 2021-12-01 @wastis my kodi startup required fiddling around for quite some time to start KODI via YATSE from my phone ... Currently I am happy that it's working with the equalizer Thanks! RE: HOWTO Kodi with Equalizer on LinuxMint 20.1 - wastis - 2021-12-10 V2.1.0 of PulseEqualizer is now finished. This release includes Digital Room Correction, absolute freedom in selection of filter frequencies and some improvements in the GUI colors (match better to different skins). To enable an independent configuration of the filter profiles from the room correction, I had to move the storage location away from the equalizer into the addon's settings directory. So the defined profiles of the older releases are not available anymore when upgrading. The learning of this thread have now been build into PulseEqualizer to make things more easy for user and to reduce frustration in set-up. If a problem occurs it is most likely new. For startup on debian and raspi headless systems, I now recommend user-linger as described in the git. That works very well. On Ubuntu, I did test the VAAPI set-up as described here in the form, also with success. Finally, enjoy RE: HOWTO Kodi with Equalizer on LinuxMint 20.1 - wastis - 2021-12-21 V2.1.1 of PulseEqualizerGUI is very stable, runs smooth on various systems including Kodi 19.3@raspberry 3B and I haven't found any issues so far. So time for some thoughts on the quality of the pulseaudio equalizer compared to other equalizers available on Linux. I did have a closer look in its and other equalizers source code and came to the following conclusion. Upfront, I think pulseaudio is currently the best equalizer available on Linux, if it comes to consumer audio streaming. The equalizer is designed around audio quality on the cost of cpu resources required and latency introduced. Pulseaudio equalizer is a fast convolution equalizer, it runs very stable, in two years I had not a single crash caused by this equalizer. With it's FFT size of 65536 @ 44100 or 48000 sample rate, it has a frequency resolution of 0,67 Hz, so it does very well on low frequencies which is a major concern for FFT based audio filters. Like any FIR filter, it keeps the phases and does not amplify intermediate frequencies (what IIR or bi-quad filter cascades would do). Due to it's high frequency resolution (it has 32768 bands), it is optimal for digital room correction and also enables some special use cases, for example the treatment for special forms of tinnitus, as it is possible to filter one or more frequencies with very narrow bands (Kodi's PulseEqualizerGUI can be configured for this). Unfortunately, all this come with some compromises. With it's hard coded sliding window size of 15999 samples, it introduces a latency of 363ms@44100 and 333ms@48000. This is not reported back correctly to applications like Kodi, which causes a sync problem of the audio and video stream. As a work around, PulseEqualizerGUI does sets the port latency of the output sink to 350ms if the equalizer is in the playback stream, so Audio and Video are in sync again. With its high cpu usage compared to other equalizers, it may introduce some auditable artifacts on systems with low cpu power. Nowadays however, even the raspberry PI3B has already more than sufficient power to run the equalizer smoothly with two channels and KODI 19.3 decoding x264 (thanks to the kodi developers). How does pulseaudio equalizer compare to other equalizers. Other equalizers are often designed around cpu performance and low latency rather than quality. Outside the streaming world (gaming, live music, professional music mastering), latency is quite an important topic. Examples are the EQ10 used by ALSA equalizer and mbeq_1197 used by this project for Linux desktop, of course there are also others. EQ10 is a 10 band bi-quad, with the typical disadvantages of IIR filter like phase shifting and potential intermediate frequency amplification. Though it is a very good equalizer in live music environments or where CPU is a concern, it is not so ideal for digital room correction due to it's limitation to 10 Bands and frequency shifts. In my tests, it also had some ugly noise when starting playback with Kodi using this equalizer. mbeq_1197 is a FFT equalizer with a FFT window size of 1024 samples. This gives a frequency resolution of 43Hz@44100 which destroys the signal for low frequencies. That means it can process 43Hz, 86Hz, 129Hz,... all frequencies in between those frequencies are rounded to those frequencies when this equalizer is used. I personally can clearly hear the difference of 43 and 86 Hz. On the positive side, it has a latency of only 23ms which might be useful for low latency use cases if audio quality is not so much a concern. What does the future bring. With pipewire around the corner, this is a very valid question. Though pipewire claims to be an adequate replacement for pulseaudio, currently it does not come with an equalizer and there a no plans to implement one. As a replacement it suggest the LADSPA module with an equalizer on top (e.q. EQ10 or mbeq_1197). LADSPA is quite old and has some shortcomings in it's interface, that would make equalizer implementations like the pulseaudio one difficult. LV2 (the LADSPA successor) is currently not available on pipewire but some how in the plans. It still needs someone to implement a fast convolution equalizer based on LV2, or is there already one? |