WIP: MPV backend for Kaffeine #13
Draft
blu.256
wants to merge 19 commits from feat/libmpv-backend
into master
Loading…
Reference in new issue
There is no content yet.
Delete Branch 'feat/libmpv-backend'
Deleting a branch is permanent. It CANNOT be undone. Continue?
This is a work in progress for a Kaffeine backend based on the C API of MPV.
Currently supported/implemented:
What is missing:
More ideas:
af
/vf
)Bugs:
[space]
!= play ??To build set
-DWITH_LIBMPV=ON
.8b513bc98e
toc70f082f0f
12 months agoCurrent state:
I am working on the context menu. It is not finished yet, esp. the subtitles submenu does not work as intended yet. I'll get back to this in a few days' time.
Great, let me know when you need a test.
b11fbcb60d
to51fe380bab
11 months ago51fe380bab
to0d47ec38d5
11 months agoI think it would be great to have a TDE-wide MPV backend, then various applications like amarok, kaffeine or other players could take advantage of that. What do you think?
Probably the best way for that would be a TDE API for multimedia playback with several backends, e.g. GStreamer, libMPV, Xine and possibly libVLC. If I'm not mistaken, this was something that was worked on in KDE3 days and resulted in Phonon in KDE4. Providing such unified API for applications is a great idea, but needs additional consideration. I propose discussing this in a separate issue (probably under TDE/tdemultimedia or TDE/tde).
Ok, we can address this separately. I also expect it to be a bigger task to implement.
I was just about to write an issue about the Xine backend for Kaffeine freezing near the end of playing a FLAC but it appears to be an upstream issue because I tried xine-ui and it has the same problem. All the more reason to have newer backends.
@hunter0one
Have you considered reporting this bug to the Xine developers? Or has it been reported already?
I temporarily put this PR on hold to focus on other issues, but it already has the basic functions and works pretty well. You could help by compiling this and reporting any issues you notice here. :-)
@blu.256
It looks like people have had similar issues with it for over 13 years but the most recent is this and it sounds just like what I experienced, except I found out it only seems to happen near the end of playback. Either way, similar problems with FLAC have been reported, and in all of them I haven't seen any response from the Xine devs.. Good news is Kaffeine using Gstreamer doesn't have this problem, I just miss the audio visualizer effects
Sure thing. I'll try it out and report here again. EDIT: It fails while building in two places.
I think the idea behind this PR is great, so I encourage you in your work Philippe!
134bc1f787
tob69aea1fa0
5 months ago@hunter0one FTBFS should be fixed now; it occured due to recent TQt-related changes.
The latest commit (screenshot) depends on TDE/tdegraphics#77.
I switched to Void Linux recently but I'll try and get a VM up to see if I can test it.
@MicheleC Would you like to test the latest version and especially the screenshot feature? It's fresh out of the oven but seems to work :-)
Hi Philippe, I built this PR on debian, installed and tested. when I select the mpv engine from the menu, kaffeine crashes. I have attached a zip of the crash dump.
Also I noticed a little thing to fix. If you look at the .desktop, .rc and folder names for gstreamer, xine and mpv, you can see that the mpv ones have a 'lib' prefix too much in the names. It would be good to be consistent with the names used in the other engines.
@MicheleC
Strange. I remember Kaffeine crashing when switching from Xine to GStreamer, but this is new to me. Did you do anything else before switching the engine? (e.g. load a file, press a button)
Just built under debian, launched and selected the mpv xine.
Does Kaffeine launch with the selected engine on next start?
Upd.: Just viewed the crash dump. Looks like we might be trying to access an MPV handle which is not instantiated yet.
Some sort of error might be causing an error dialog to appear very early, triggering pause, while the MPV handle is not yet initialized.
It's a theory which I'll test tomorrow.
Nope, xine is still the selected engine at the next start.
If I launch Kaffeine, select a song, start playing with xine and switch engine while playing, it does not crash. But it crashes if I try to switch back to xine engine.
@MicheleC Could you please test with the latest commit?
This should fix the crash that you sent the dump for, though I expect that you will still see an error dialog pop up, which is probably related to another bug. If you do see it, it would help if you could send the details and probably the full mpv log (which you can copy through File->View MPV log->Copy).
Thank you very much for the feedback so far. :)
Hi Philippe,
I tested the latest version under Debian.
This time kaffeine crashes at the start, without even creating a window. See attached crash dump.
I think kaffeine was set to start with mpv engine.
No problem, that is what team work means 🙂
Confirmed. I deleted kaffeinerc and kaffeine can launch with xine engine. If I switch to mpv engine, it crashes with similar crash dump.
4fd7b9fc35
to41e36f4aca
5 months agoI hope this time fixes it. I was sure that I had initialized m_mpv as a null pointer but in fact I had forgotten to do so, and anything that checked if m_mpv was initialized was bound to have unexpected behaviour... It's a miracle that it worked flawlessly for me so far.
Hi Philippe,
new test, new crash, new crash dump file.
Launched Kaffeine with xine engine. Selected mpv engine from Settings menu. SEGV.
Well, I'm running out of ideas :(
Could you please send the stdout/stderr output, if any? I'm interested in any sort of debug information.
This is all I get if I run Kaffeine from command line:
If this is still not enough, I guess I will need to help you debugging locally at some point :-)
It is important to note that this might be a double bug:
Does this mean that you are testing in a VM? I remember you saying that you usually test in a VM. I'm testing on real hardware, so things are surely different. Could it be that lack of 3D acceleration somehow triggers point 1 above?
That would be helpful, but it is not a priority right now since this PR is not totally feature complete and you are doing some very important work on TQt/tqtinterface merge.
I have not selected any file to play in Kaffeine, so in theory there should be nothing being played
This one buffles me too. I do use a VM, but it is a VirtualBox one, not a VMware. No idea where and why that msg is popping up. The only vmware related package installed on my machine is
xserver-xorg-video-vmware
. I removed that and I still get the same crash and same weird message.Will try enabling 3D acceleration and let you know. Just tried mpv from CLI: audio files play fine but video files give an error, so I think you assumption could be correct.
I have enabled 3D acceleration and there is no more any crash.
This brings up two topics:
I think the mpv backend should:
a. only instantiate the video backend part if needed, that is when we want to play video files
b. detect whether 3D acceleration is available or not, avoid crashing and at worst bring up a message dialog telling the users that video could not be played.
What do you think?
This is not totally true. On startup Kaffeine "plays" its logo file, which is a small video or image located in its data folder. This is something that all of the backends do.
This would probably mean that we would not play the logo file on startup.
Probably makes sense to test for 3D acceleration and handle it specially.
Thanks for the info, I wasn't aware/didn't notice that.
Yeah, probably the most sensible choice. I can help testing there are no crashes when 3D is not there.