Fixing MPV Playback from Samba Share

Running KDE is usually quite troublefree. However, on my new install I faced unusual problem. My photos and media on samba share simply would not open. I could see text files just fine. But no movie for me.

Interestingly, this behavior seemed limited to MPV and Haruna. Other media players seemed unaffected by whatever afflicted them. It took a bit of investigation but I traced the issue to the following line in their .desktop file:

X-KDE-Protocols=ftp,http,https,mms,rtmp,rtsp,sftp,smb,srt,rist,webdav,webdavs

While they both claim to understand samba protocol (smb), removing it from supported protocols actually solved the issue. It seems that my samba server was simply not to their liking. After doing a bit of investigation, I am still puzzled why exactly - especially since it works just fine on another computer. Some dependency is missing and, while finding it would be possible, it would also waste my time when I already have solution.

Just removing smb works like a charm:

sudo sed -i 's/,smb,/,/g' /usr/share/applications/mpv.desktop
sudo sed -i 's/,smb,/,/g' /usr/share/applications/org.kde.haruna.desktop

It’s a temporary fix but Kubuntu 26.04 is just around the corner anyhow.

ChSrt

Similar to the last year, this year I also took a bit of break from writing here. A bit of family time here and there is not a bad thing. :)

But that doesn’t mean I stopped playing with computers altogether. In addition to updates to applications I already maintain, I also had some time for personal projects. And I decided to share one of those personal projects here - just in case somebody finds it useful.

As somebody who edits subtitles from time to time, I really love Subtitle Editor. It’s a really powerful tool and it literally covers everything one might need around subtitles. However, while it works on Linux, it simply isn’t that nice to use from command line. Especially when one has simple subtitle needs.

So, I went to reinvent the wheel and called it ChSrt.

This is a really simple subtitle editor with a fraction of features that I most comonly needed. In general, I just call it with two arguments that perform all fixes in-place.

chsrt -ia *.srt

If interested, you can check it out. I will expand it as I need new features but it will always be driven by what I need.

Trace Console Output

One common behavior for Linux GUI applications when ran from console is to write log text directly there. It’s not really a mandatory feature but a lot of frameworks do it so it became de-facto standard. However, C# applications often don’t follow this principle. I will take Avalonia for example. While Avalonia itself will write log to console, user code will not.

If you are using some logging framework (e.g. Serilog), this is trivial to configure. But, what about simple applications? Can we do something there?

Well, you can always add a console listener.

#if DEBUG
  if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) {
    Trace.Listeners.Add(new ConsoleTraceListener());
  }
#endif

With this, any Trace.WriteLine will write its output to console in addition to other trace listeners.

Why only on Linux? Well, under Windows there is a nice DebugView utility that can capture this information without going through console listener.

Wago All the Way

Illustration

As someone who like to annoy folks doing an actual electrical work, I discussed topic of Wago connectors multiple times. First part of discussion is inevitably my (correct) pronouncation of Wago. It’s with with Wag as in Wagner, not as in wage. After that initial vorspeiz, topic inevitably goes to the superiority of the mighty Wire Nuts.

If you are from Europe, you might wonder what the heck is a wire nut? Well, do you remember old times when people just twisted wires together and wrapped them in some electrical tape? Wire nut is that same thing, just with plastic. And I personally find them lacking.

During cleaning of in-wall heaters (American thing, don’t think too hard about the wisdom of placing a furnace into a wooden wall structure), I found wire nuts a really problematic choice. To properly clean the heater, you really need to disconnect wires. With wire nuts you either untwist them, forcing you to unbend wires when you want to reconnect them. Or, you cut the wire nut and just later reterminate the connection with a new wire nut. Both of these choices usually lead to shorter and shorter wires each time - since even unbending wire that was once in a wire nut more often than not leads to breaking it. And, since most heaters have stranded wire, mess is even greater than what you get with a stranded wire.

If you use Wago to terminate those connections, you solve all your problems as wago accepts both stranded and solid wire. Now you can disconnect a solid wire from connector whenever you need cleaning. And reconnecting them again is a breeze, without any damage occuring in the process.

In junction box you have even easier time. Not only you can fold wires neatly in groups but you can also measure voltage. Every Wago connector has a hole just big enough for multimeter probes to fit.

How do the “wire nut” people measure voltage? Well, they try not to. I’ve seen electricians try 100 different things before resorting to an actual measurement. And I don’t blame them - I would do the same if measuring stuff required me to unbundle all the wires.

That said, connection with wire nuts can be better. Multiple people tested them and, under the full load, difference can be a staggering few degrees. It’s a meaningless difference.

I’ve also heard that Wago is not durable - mostly because it’s not pure copper. Having gone through period of dealing with issues between aluminium and copper connections, Americans are justifiably wary of issues that can arise when mixing materials. But not all “silvery” materials are aluminium. They might be copper with oxidation protection layer. Guess what, if you check a wire nut, you won’t see exposed copper there either. I guess logic there is that, in case of the wire nut, it’s an oxidation prevention. In case of Wago, it’s a durability issue.

The National Electrical Code is the only relevant source of truth. And Wago connectors meet UL 486C requirements. Same as wire nuts. Even their maximum temperature of 105 °C is the same.

Using one or other might be a matter of cost (wire nuts are cheaper). Or it might be matter of preference (wire nuts are belowed here). But it cannot be matter of performance. As long as they have the same (and sufficient) rating, wire nuts and wago connectors are interchangeable.

Me? I am going to continue making my live easier by replacing every electrical circuit I touch with something that’s actually user-friendly.


PS: If you were wondering how Wago 221 got their name, convert 105 °C to °F.

How Big Should a Linux EFI Be

My “standard” partition scheme is always, EFI, Boot, Swap, Data. I have been toying with an idea to swap EFI and Boot around but I stuck with the same order for a while now. However, sizes have changed over the time. One that changed the most is EFI.

Under Linux, assuming you have a separate Boot partition, you can have EFI really small. I’ve ran it at 32 MB for a while, not observing any negative issues. Until I did.

While most of the time Linux doesn’t really use EFI partition for much, things get interesting with firmware updates (fwupdmgr update). The only way for Linux (or any other OS, for that matter) to pass files to UEFI is a common partition. That common partition can only be FAT32 EFI. And, depending on your system, those files might need over 64 MB.

Translated, your EFI needs to be able to have more than 64 MB. How much more? Playing with power of two values is an unofficial standard and thus 128 MB is the next good spot.

But, is that future proof? Considering BIOS images are 32 MB these days (256 MBit), it’ll take a while before 128 MB is not enough

I am almost certain that more space will be needed at undefined time in the future. However, I won’t lose any sleep about it for at least couple of years.


PS: If you are dual-booting Windows, I would say doubling the partition might be a good idea as Windows does have a larger footprint on EFI partition.