BKSalman / ytdlp-gui

a very simple GUI for ytdlp written in Rust
GNU General Public License v3.0
275 stars 16 forks source link

Crash at start #24

Closed HROMANO closed 5 months ago

HROMANO commented 11 months ago

I just built ytdlp-gui on Archlinux but it crashes at launch with the following message:

2023-12-04T08:44:33.018286Z  INFO ytdlp_gui: config loaded: Config {
    bin_dir: None,
    download_folder: None,
    options: Options {
        video_resolution: FullHD,
        video_format: Mp4,
        audio_quality: Good,
        audio_format: Mp3,
    },
}
warning: queue 0x56313cb8f150 destroyed while proxies still attached:
  wl_buffer@37 still attached
  wl_buffer@36 still attached
  wl_buffer@35 still attached
  wl_buffer@34 still attached
  wl_subsurface@29 still attached
  wl_surface@28 still attached
  wl_subsurface@27 still attached
  wl_surface@26 still attached
  wl_subsurface@25 still attached
  wl_surface@24 still attached
  wl_subsurface@23 still attached
  wl_surface@22 still attached
  wl_subsurface@21 still attached
  wl_surface@20 still attached
  xdg_wm_base@18 still attached
  xdg_activation_v1@12 still attached
  zwp_text_input_manager_v3@11 still attached
  zwp_pointer_constraints_v1@10 still attached
  zwp_relative_pointer_manager_v1@9 still attached
  wl_seat@8 still attached
  wl_subcompositor@7 still attached
  wl_output@6 still attached
  wl_shm@5 still attached
  wl_compositor@4 still attached
  wl_registry@2 still attached
Error: GraphicsCreationFailed(GraphicsAdapterNotFound)

I'm on Gnome desktop using Walyand. Am I missing something to make it work?

Thanks

BKSalman commented 11 months ago

Hmmm, it appears to be a Wayland issue, even tho the program should be able to support Wayland, but I will check it and get back to you

HROMANO commented 11 months ago

Not sure.

I switched to Xorg, and now I don't have all the wl_ messages, but only the last line Error: GraphicsCreationFailed(GraphicsAdapterNotFound)

I also tried the provided binary, and I get the same result.

Maybe I'm missing some library?

What are you using as a GUI? I see something related called iced that seems to support Vulkan, Metal, DX12. I have an old graphic card that don't support Vulkan, but at most GL 3.3. Could it be the problem?

Thanks

BKSalman commented 11 months ago

That's probably it, you could build it with glow (an OpenGL backend), but if you face issues I can provide instructions once I'm free, thank you for your patience

BKSalman commented 11 months ago

Also, yes, I'm using Iced as my GUI framework, so if you can find instructions there, then maybe that would be faster for you

BKSalman commented 11 months ago

@HROMANO could you test running the program with the WGPU_BACKEND=gl environment variable?

reference: https://github.com/gfx-rs/wgpu/blob/767ac03245ee937d3dc552edc13fe7ab0a860eec/README.md#environment-variables

HROMANO commented 11 months ago

Thank you for your help.

I tried WGPU_BACKEND=gl with no luck. I will try glow when I'll have enough time and I'll tell you the result.

In the mean time, I can still use the commandline :->

murlakatamenka commented 8 months ago

Yeah, it doesn't work on Wayland

Hyprland on Vulkan (WLR_RENDERER=vulkan), no luck with either

WGPU_BACKEND=vulkan ytdlp-gui
# nor
WGPU_BACKEND=gl ytdlp-gui

Version = 1.0.2 from AUR


Works just fine on X11 (i3), so this is Wayland-specific


Here is the log:

Details
$ WGPU_BACKEND=vulkan ytdlp-gui
--- SNIP: deserialized config ---
interface 'wl_surface' has no event 2
warning: queue 0x7808e0000ca0 destroyed while proxies still attached:
  zwp_primary_selection_offer_v1@4278190082 still attached
  zwp_primary_selection_offer_v1@4278190081 still attached
  wl_data_offer@4278190080 still attached
  zwp_primary_selection_device_v1@34 still attached
  zwp_primary_selection_device_manager_v1@27 still attached
  wl_data_device@33 still attached
  wl_seat@32 still attached
  wl_data_device_manager@31 still attached
  wl_registry@30 still attached
warning: queue 0x5ed81329d040 destroyed while proxies still attached:
  xdg_wm_base@19 still attached
  wl_output@13 still attached
  xdg_activation_v1@12 still attached
  zwp_text_input_manager_v3@11 still attached
  zwp_relative_pointer_manager_v1@10 still attached
  zwp_pointer_constraints_v1@9 still attached
  zxdg_decoration_manager_v1@8 still attached
  wl_seat@7 still attached
  wl_subcompositor@6 still attached
  wl_compositor@5 still attached
  wl_shm@4 still attached
  wl_registry@2 still attached

The other iced-based app ludusavi launches its GUI fine. Flatpak, version 0.22.0. Can't remember if I have any other iced apps on my machine rn.

BKSalman commented 8 months ago

Did older versions work before?

I added glow support on 1.0.2 for better support for older hardware and stuff, but maybe it broke the app?

(I can run the app on my personal wayland compositor)

BKSalman commented 8 months ago

Also this issue could be solved if I update the iced package to 0.12.0

David-Valters commented 7 months ago

I have a similar problem

Plasma Wayland 1.0.2-1 AUR

interface 'wl_surface' has no event 2
warning: queue 0x5a6f34120e20 destroyed while proxies still attached:
  xdg_wm_base@19 still attached
  wl_output@13 still attached
  zwp_text_input_manager_v3@12 still attached
  xdg_activation_v1@11 still attached
  wl_subcompositor@10 still attached
  zwp_relative_pointer_manager_v1@9 still attached
  zwp_pointer_constraints_v1@8 still attached
  wl_seat@7 still attached
  wl_shm@6 still attached
  zxdg_decoration_manager_v1@5 still attached
  wl_compositor@4 still attached
  wl_registry@2 still attached
Error: GraphicsCreationFailed(BackendError("eglInitialize failed"))
BKSalman commented 7 months ago

@David-Valters are you using an Nvidia GPU?

David-Valters commented 7 months ago

@David-ValtersВи використовуєте графічний процесор Nvidia?

no i disabled the nvidia graphics card at the kernel level and my laptop doesn't see it and i'm using intel now

simonbcn commented 7 months ago
CachyOS Linux (=Arch Linux)
Gnome 46 Wayland

Same problem:

❯ ytdlp-gui 
2024-03-30T13:07:25.829618Z  INFO ytdlp_gui: config loaded: Config {
    bin_dir: None,
    download_folder: None,
    options: Options {
        video_resolution: FullHD,
        video_format: Mp4,
        audio_quality: Good,
        audio_format: Mp3,
    },
}
interface 'wl_surface' has no event 2
warning: queue 0x5b2b555fddd0 destroyed while proxies still attached:
  wl_buffer@65 still attached
  wl_buffer@64 still attached
  wl_buffer@63 still attached
  wl_buffer@62 still attached
  wl_subsurface@56 still attached
  wl_surface@55 still attached
  wl_subsurface@54 still attached
  wl_surface@53 still attached
  wl_subsurface@52 still attached
  wl_surface@51 still attached
  wl_subsurface@50 still attached
  wl_surface@49 still attached
  wl_subsurface@48 still attached
  wl_surface@47 still attached
  wl_buffer@38 still attached
  wl_buffer@37 still attached
  wl_buffer@36 still attached
  wl_buffer@35 still attached
  wl_subsurface@29 still attached
  wl_surface@28 still attached
  wl_subsurface@27 still attached
  wl_surface@26 still attached
  wl_subsurface@25 still attached
  wl_surface@24 still attached
  wl_subsurface@23 still attached
  wl_surface@22 still attached
  wl_subsurface@21 still attached
  wl_surface@20 still attached
  xdg_wm_base@18 still attached
  wl_output@12 still attached
  xdg_activation_v1@11 still attached
  zwp_text_input_manager_v3@10 still attached
  zwp_pointer_constraints_v1@9 still attached
  zwp_relative_pointer_manager_v1@8 still attached
  wl_seat@7 still attached
  wl_subcompositor@6 still attached
  wl_shm@5 still attached
  wl_compositor@4 still attached
  wl_registry@2 still attached
Error: GraphicsCreationFailed(BackendError("eglInitialize failed"))
BKSalman commented 7 months ago

I will test if updating iced to 0.12 solves these issues, so please wait until I release a new version to the AUR and other stuff, I could also send a patch if anyone wants to test it earlier

BKSalman commented 7 months ago

can someone try using the application from this branch and see if it solves the issue?

HROMANO commented 7 months ago

It's working now. First impression was not good because the window was small, labels overlapped or were missing, I couldn't enlarge the window using the borders.… But I could maximize, and the UI was then readable enough.

BKSalman commented 7 months ago

Hmm, do you use scaling in your desktop environment?

David-Valters commented 7 months ago

can someone try using the application from this branch and see if it solves the issue?

It worked, but the interface appears broken, and the button to start the download is also not visible зображення

HROMANO commented 7 months ago

I don't use scaling. It's just a basic 1920×1080 screen.

The download button reappears when you maximize the window.

BKSalman commented 7 months ago

Can you both please provide a video recording or something? That would make it easier to understand the issue

David-Valters commented 7 months ago

Can you both please provide a video recording or something? That would make it easier to understand the issue

https://github.com/BKSalman/ytdlp-gui/assets/46930139/cec6ab03-6270-4ce8-b75d-86f5f5d59d7a

BKSalman commented 7 months ago

@HROMANO @David-Valters can you try it now? I added a bit of height to the window to show the download button, and made the window resizable just in case

David-Valters commented 7 months ago

@HROMANO @David-Valters can you try it now? I added a bit of height to the window to show the download button, and made the window resizable just in case

зображення the icon of closing the window is not displayed correctly, maybe I am also missing some dependencies? зображення for some reason the progress bar is not displayed зображення

BKSalman commented 7 months ago

the icon of closing the window is not displayed correctly, maybe I am also missing some dependencies?

I just fixed that, you can pull the latest commit

for some reason the progress bar is not displayed

will look into this

BKSalman commented 7 months ago

for some reason the progress bar is not displayed

I think this is caused by yt-dlp sending total_bytes as NA so the progress bar can't know how much it should display

example:

2024-04-21T13:32:50.080738Z DEBUG ytdlp_gui::progress: received progress from yt-dlp: __{"type": "downloading", "video_title": "A New Vision for Consumer Hardware | Framework", "eta": 107.24503662830055, "downloaded_bytes": 4076125, "total_bytes": NA, "elapsed": 4.859860747001221, "speed": 1241942.1759469812, "playlist_count": NA, "playlist_index": NA }

both downloaded_bytes and total_bytes are needed

David-Valters commented 7 months ago

the icon of closing the window is not displayed correctly, maybe I am also missing some dependencies?

I just fixed that, you can pull the latest commit

for some reason the progress bar is not displayed

will look into this

yes it worked

David-Valters commented 7 months ago

for some reason the progress bar is not displayed

I think this is caused by yt-dlp sending total_bytes as NA so the progress bar can't know how much it should display

example:

2024-04-21T13:32:50.080738Z DEBUG ytdlp_gui::progress: received progress from yt-dlp: __{"type": "downloading", "video_title": "A New Vision for Consumer Hardware | Framework", "eta": 107.24503662830055, "downloaded_bytes": 4076125, "total_bytes": NA, "elapsed": 4.859860747001221, "speed": 1241942.1759469812, "playlist_count": NA, "playlist_index": NA }

both downloaded_bytes and total_bytes are needed

Can something be done with this?

also there is an error in the terminal image

BKSalman commented 7 months ago

Can something be done with this?

Probably, yes

Will check it when I have the time

also there is an error in the terminal

image

Hmmm, looks like yt-dlp is sending an error while sending the progress at the same time, will check that

Tensorect commented 6 months ago

guys I am facing this same issue , how to fix this , I am on hyprland wayland wm

BKSalman commented 6 months ago

guys I am facing this same issue , how to fix this , I am on hyprland wayland wm

Try cloning and building this branch

BKSalman commented 6 months ago

yo, I finally got some free time to work on this a little bit, could you guys test the latest commit? it should've fixed the progress bar (as much as possible)

if everything is working well I could close this issue and merge the branch into main

cc: @David-Valters @HROMANO @murlakatamenka @Tensorect

HROMANO commented 6 months ago

I tried and it's better.

But it feels strange to be able to resize the window to something like 0x0 px and hide all the gui (no minimum size for the widgets?)

BKSalman commented 6 months ago

I tried and it's better.

good good :)

But it feels strange to be able to resize the window to something like 0x0 px and hide all the gui (no minimum size for the widgets?)

not a problem, will add a minimum size or something, should be easy to fix (the linked fix might be outdated but we will see)

I will commit it maybe tomorrow, then publish a new release inshallah :)