Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Builder Assertion failed #135

Closed
OWL4C opened this issue Jan 12, 2024 · 17 comments
Closed

Builder Assertion failed #135

OWL4C opened this issue Jan 12, 2024 · 17 comments

Comments

@OWL4C
Copy link

OWL4C commented Jan 12, 2024

running the builder errors out with kdynamicwallpaperbuilder: ./av1/encoder/ratectrl.c:1219: rc_pick_q_and_bounds_no_stats_cbr: Assertion q <= rc->worst_quality && q >= rc->best_quality' failed.` when using both the default Ubuntu Repo version and the 4.4.0 version (IOT instruction (core dumped))

@zzag
Copy link
Owner

zzag commented Jan 12, 2024

Did you pass any arguments to kdynamicwallpaperbuilder?

@OWL4C
Copy link
Author

OWL4C commented Jan 13, 2024 via email

@zzag
Copy link
Owner

zzag commented Jan 14, 2024

Can you check that the images have the same resolution?

@OWL4C
Copy link
Author

OWL4C commented Jan 14, 2024 via email

@OWL4C
Copy link
Author

OWL4C commented Jan 14, 2024

{"Type": "solar", "Meta": [{"FileName": "P1150679.JPG", "Time": "13:07", "CrossFade": true}, {"FileName": "P1150656.JPG", "Time": "07:22", "CrossFade": true}, ... ]}
Paths are truncated but absolute, Time is gotten from exif. It seems this version is actually using double quotes.
The pictures are spaced 15 minutes apart and span a total of 96 pictures per set

@zzag
Copy link
Owner

zzag commented Jan 14, 2024

This is strange. Can you share the source images so I can test whether kdynamicwallpaperbuilder succeeds on my machine? and if not, debug why it fails. You can find my email at profile page.

@zzag
Copy link
Owner

zzag commented Jan 14, 2024

the source images and the manifest json file*

@OWL4C
Copy link
Author

OWL4C commented Jan 14, 2024

I could reliably get a crash with any picture and 96 entries, while a smaller set works without error. Currently trying to find out where the breaking point is
40 pictures crashes always, 20 only when using --speed 10
This seems to be a limitation of the av1 encoder, it seems to be unable to handle these amounts of data. (Guessing based on the error being from rate-control)
Running 40 pictures with a lower speed option works but is slow. Might want to add something into the README about too many files and think about switching to another encoder or JPEG-XL for real. (Or adding compatibility at least.)

@zzag
Copy link
Owner

zzag commented Jan 14, 2024

Hmm, it might be a bug in the encoder. It would be nice to test with rav1e.

@zzag
Copy link
Owner

zzag commented Jan 14, 2024

It looks like there's no way to specify the codec via an envvar :(, so I'll add an option in kdynamicwallpaperbuilder. Are you running qt5 or qt6 version?

@OWL4C
Copy link
Author

OWL4C commented Jan 14, 2024

qt5, but since the --speed 1 option is a valid workaround, you could maybe only update the newer version, if that is easier

zzag added a commit that referenced this issue Jan 14, 2024
@zzag
Copy link
Owner

zzag commented Jan 14, 2024

The linked commit adds a codec option. It can be used as kdynamicwallpaperbuilder --codec rav1e or --codec aom (I believe that's what you use now) or --codec svt.

but since the --speed 1 option is a valid workaround

--speed 0 should produce a file with the minimal size, but it can take a lot of time. Given how many images you have, it might be worth it. It would be a good idea to start with 4 or 5 and see at which point the file size doesn't change that much though.

zzag added a commit that referenced this issue Jan 14, 2024
cc #135

(cherry picked from commit e4328e6)
@zzag
Copy link
Owner

zzag commented Jan 14, 2024

^ that commits backports --codec option to 4.4. Run git clone https://github.com/zzag/plasma5-wallpapers-dynamic.git --branch 4.4 and then follow the build instructions in README file.

@zzag
Copy link
Owner

zzag commented Jan 14, 2024

Let me know if rav1e fixes the issue. It's actively maintained and it's written in Rust so it means that it is bug free 😄

@zzag
Copy link
Owner

zzag commented Jan 14, 2024

Oh wow, rav1e is actually pretty good. I have a wallpaper that's 180M when encoded by aom, but it's 8M when it's encoded by rav1e and it took less time too.

@zzag
Copy link
Owner

zzag commented Jan 14, 2024

BTW

{"Type": "solar", "Meta": [{"FileName": "P1150679.JPG", "Time": "13:07", "CrossFade": true}, {"FileName": "P1150656.JPG", "Time": "07:22", "CrossFade": true}, ... ]}

This should be

{
    "Type": "solar",
    "Meta": [
        {
            "FileName": "P1150679.JPG",
            "CrossFade": true,
            "Time": "*",
            "SolarElevation": "*",
            "SolarAzimuth": "*"
        },
        ...
    ]
}

The Time, SolarElevation and SolarAzimuth fields should be initialized based on Exif metadata. You don't need to fill them by hand, kdynamicwallpaperbuilder will do it for you.

@OWL4C
Copy link
Author

OWL4C commented Jan 15, 2024

The branch gives the error symbol lookup error: kdynamicwallpaperbuilder: undefined symbol: _ZN23KDynamicWallpaperWriter12setCodecNameERK7QString when using, the compiling works without errors though.
Edit: after purging and reinstalling, rebooting etc it is finally working.

Some observations handling these data sizes:
The old image was finally ready (took around 3 hours, 500MB in size) and uses around 1% more CPU in idle than the deer from the examples, as well as consuming around 25% of my cpu for a good few seconds when applied, 10% when changing appearance. Hopefully the new encoder can help that too.
On macos the file size was just as big, but integration was far more smooth. That should work out better with the new encoder too. (A quality of life update would be changing the wallpaper to a static version and then updating it to dynamic instead of seeming unresponsive, but usually users would not use these sizes either.)

One last idea would be some kind of progress indicator within the builder tool, currently i can only guess the progress with resource usage.
For example a progress bar counting the current picture of the total specified would be great.

Update: using rav1e i could encode the picture (using default options) in just under 1.5 hours. The file size is also ~100 MB smaller.

Thanks for your continued support and even just the project itself!

@OWL4C OWL4C closed this as completed Jan 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants