GyulyVGC / sniffnet

Comfortably monitor your Internet traffic 🕵️‍♂️
https://sniffnet.net
Apache License 2.0
18.56k stars 558 forks source link

Sniffnet crashes when screen color depth is set below 24 bit #589

Open TyseEX opened 3 months ago

TyseEX commented 3 months ago

Is there an existing issue for this?

What's the problem?

I installed Sniffnet on Manjaro Linux from pacman repos and when I tried to launch it, nothing happened. Then I reinstalled package, but nothing changed. I tried to run Sniffnet in a terminal and got this:

thread 'main' panicked at /build/.cargo/registry/src/index.crates.io-6f17d22bba15001f/iced_tiny_skia-0.12.1/src/window/compositor.rs:56:10:
Create softbuffer surface for window: PlatformError(Some("Visual 0x21 does not use softbuffer's pixel format and is unsupported"), None)
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

After trying nvidia-xconfig --depth=24 Sniffnet launched normally. Is there any way to use Sniffnet with 16-bit color depth?

How did you install the app?

downloaded one of the provided packages

Operating System

Linux

Additional context

No response

GyulyVGC commented 3 months ago

Hi @TyseEX, the GUI library in use by Sniffnet supports choosing different graphical renderers at runtime via the environment variable ICED_BACKEND. By default, wgpu is used, but in your case it appears that it's trying to use tiny-skia. Can you try to set this environment variable to either of these two values and see if it works?

TyseEX commented 3 months ago

Something like this: env ICED_BACKEND=wgpu sniffnet? изображение

GyulyVGC commented 3 months ago

Ok, so the problem is that your graphical adapter doesn't support wgpu and the app is falling back to use tiny-skia. This issue cannot be solved with the tiny-skia renderer since it appears to be an intrinsic limitation of it. A possible strategy to solve this would be to try to understand why wgpu isn't working, but if your graphical adapter is up to date, I think there isn't much we can do.

GyulyVGC commented 3 months ago

I think reading this can be of help for your use case: https://github.com/iced-rs/iced/issues/1898

TyseEX commented 3 months ago

I think it may be a solution, but WGPU_BACKEND=vulkan doesn't work and gives the same issue. A guy, that solved it with nvidia-dkms probably used a driver that was installed from a package. I installed driver from Nvidia official website and my system didn't had any packages except for nvidia-dkms. The most interesting thing about this is that my package has version 550.107.02-1, when the repositories already have version 555.58.02-15. pacman -Syu still can't detect version 555, which means I'll probably have to remove the current driver and install a new one from the repositories. Maybe then the environment variables will work fine, but I need time to check it. Anyway, thanks for helping me solve my problem :)

GyulyVGC commented 3 months ago

No problem! Let me know when you have some news.

TyseEX commented 3 months ago

Unfortunately, removing the driver and installing it from the repositories did not help in any way. Even the Nvidia package that lies in the repositories is defined as Nvidia-utils, and when you try to install it through pacman -U, it looks for the "Nvidia" package as a dependency, which it itself should be. Nvidia-dkms from repositories also doesn't help. Probably, this problem is definitely not in the drivers, and it's worth waiting for some solutions from the developers of Iced...

GyulyVGC commented 3 months ago

Yeah... in the meantime I hope it's not a big problem for you to use it with depth 24.

i-amgeek commented 2 months ago

ICED_BACKEND=tiny-skia sniffnet worked for me in resolving this issue.

GyulyVGC commented 2 months ago

Interesting, thanks @i-amgeek

GyulyVGC commented 2 months ago

Something like this: env ICED_BACKEND=wgpu sniffnet?

@TyseEX could you try setting it to tiny-skia as suggested by @i-amgeek?

TyseEX commented 2 months ago

Something like this: env ICED_BACKEND=wgpu sniffnet?

@TyseEX could you try setting it to tiny-skia as suggested by @i-amgeek?

I sold my old GPU and today I bought GTX 1060, but issue didn't gone. Setting backend to tiny-skia craches Sniffnet with the same message:

thread 'main' panicked at /build/.cargo/registry/src/index.crates.io-6f17d22bba15001f/iced_tiny_skia-0.12.1/src/window/compositor.rs:56:10:
Create softbuffer surface for window: PlatformError(Some("Visual 0x21 does not use softbuffer's pixel format and is unsupported"), None)
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

wgpu also says GraphicsAdapterNotFound...