Coder Social home page Coder Social logo

mpvpaper hanging on startup about mpvpaper HOT 19 CLOSED

ghostnan avatar ghostnan commented on June 27, 2024
mpvpaper hanging on startup

from mpvpaper.

Comments (19)

GhostNaN avatar GhostNaN commented on June 27, 2024 1

So.... now I'm having this issue.
I'll look into replacing this getopt_long() system.

from mpvpaper.

GhostNaN avatar GhostNaN commented on June 27, 2024

So even with -v arg there's no output at all?
Are you sure you aren't passing -f or --fork by accident?
At a minimum it should of said "Verbose Level 1 enabled"

Just to be sure this isn't a mpv issue, try running:
mpvpaper -v -o "--log-file=output.txt" "*" [small gif]
And report back with the log.

from mpvpaper.

ddxtanx avatar ddxtanx commented on June 27, 2024

Even with that command, mpvpaper outputs nothing, and nothing is written to output.txt somehow...
20230507_22h05m47s_grim. I interrupted after ~10 seconds

from mpvpaper.

GhostNaN avatar GhostNaN commented on June 27, 2024

The only way that could happen is if mpvpaper caught either SIGINT, SIGQUIT or SIGTERM while starting up.
And I have no idea so far how or why that's possible.
But it must be happening while parsing the args inparse_command_line()

What kind of PC do you have? OS? Hardware? DE?

from mpvpaper.

ddxtanx avatar ddxtanx commented on June 27, 2024

I'm currently running the Arch version of Asahi Linux on an M1 Macbook Pro, and I'm using Wayland, wlroots compositor, sway window manager.

from mpvpaper.

GhostNaN avatar GhostNaN commented on June 27, 2024

M1 Macbook Pro?
Didn't even know that could work on Wayland.

Did you try something other than a GIF or tried running in just the normal MPV player?

from mpvpaper.

ddxtanx avatar ddxtanx commented on June 27, 2024

I've tried an MP4, PNG, and JPEG as well all with the same weird hanging error. mpv is able to open all of those media types just fine, though it does complain about

[vo/gpu/opengl] after rendering: OpenGL error INVALID_ENUM.
[vo/gpu/opengl] after OSD rendering: OpenGL error INVALID_ENUM.

a couple of times. Running mpvpaper -v -o "--log-file=output.txt" "*" [file] also successfully creates an output.txt which I've attached to this reply. output.txt

Also while Asahi is a lil' buggy, the experience is still really nice. Highly recommend.

from mpvpaper.

GhostNaN avatar GhostNaN commented on June 27, 2024

I just realized you caused the SIGINT when you put in ctrl+c, my bad. So that makes sense.
But hanging at the start is still very bizarre behavior.
We are in unknown territory because this is an Apple ARM SOC.
After doing very light digging I found this: https://github.com/AsahiLinux/docs/wiki/Broken-Software
It shows there is some limitations for this kind of hardware and I'm not sure what it's getting snagged on.

It could be even getting stuck just outputting the error.
But that could be tested by just trying to passing -l asdf and seeing if it responds back.

And again, it's breaking while just parsing the args.
So who knows what else it would break if that problem is even fixable.

If you want to get your hands dirty to see if this is even possible to fix.
You could try going step by step with gdb in your favorite debugger and seeing where it's going wrong.
Otherwise, I'm not quite sure how to proceed and am open to suggestions.

from mpvpaper.

GhostNaN avatar GhostNaN commented on June 27, 2024

Wait, it just got OpenGL 2.1 support? https://asahilinux.org/2022/12/gpu-drivers-now-in-asahi-linux/
So it doesn't even have OpenGL 3.0 or higher support? That's rough.
That would definitely make this a lot harder to work with.

from mpvpaper.

ddxtanx avatar ddxtanx commented on June 27, 2024

Thankfully it was a small error that most likely came from how different systems store chars. I introduced a fix in #49

from mpvpaper.

GhostNaN avatar GhostNaN commented on June 27, 2024

Huh, just like that?
Is it completely working now?

from mpvpaper.

ddxtanx avatar ddxtanx commented on June 27, 2024

Yep! 100% working and even functioning in tandem with swaylock-plugin!

from mpvpaper.

GhostNaN avatar GhostNaN commented on June 27, 2024

I'm constantly humbled by others, thanks.
I'll look over your pull and make sure it does have any side effects.

from mpvpaper.

ddxtanx avatar ddxtanx commented on June 27, 2024

Welp that’s not good. Let me see if treating the opt as an int works; if it does then a direct comparison with -1 ought to do the trick for all systems

from mpvpaper.

GhostNaN avatar GhostNaN commented on June 27, 2024

Read the MAN: https://linux.die.net/man/3/getopt_long

from mpvpaper.

ddxtanx avatar ddxtanx commented on June 27, 2024

Yeah, changing the type to an int still works on my system. Then since getopt_long returns (int)-1 when all options are processed this ought to work on your system as well

from mpvpaper.

GhostNaN avatar GhostNaN commented on June 27, 2024

I should've read the man page myself. Turns out they use int for opt as well.
Funny how simple problems can be. I'm pulling the request and closing the issue.

Thanks again.

from mpvpaper.

ddxtanx avatar ddxtanx commented on June 27, 2024

Happy to help!πŸ˜„

from mpvpaper.

GhostNaN avatar GhostNaN commented on June 27, 2024

I just fully realized what when wrong, if you are curious.
This was a classic case of integer overflow.
When getopt_long() returned -1 to the char for some reason on most systems it just handles it.
Probably because it's treated like a signed int.
But on yours it's like a unsigned int so it overflowed back to 255.
Hence why setting to 255 worked on your system.
Just some food for thought.

from mpvpaper.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.