7
submitted 10 months ago* (last edited 10 months ago) by Fisch@lemmy.ml to c/raspberrypi@lemmy.ml

I installed LibreELEC on a Raspberry Pi 4 yesterday and it's working really well, except for AV1 playback. The thing is, it's almost fast enough but the video stutters every few seconds and is a little slower than it should be. Is there a way to make it faster, by switching the decoder or enabling multi-core decode or something like that?

I found this decoder which might be what I'm searching for but I don't know how to make it work in LibreELEC.

top 14 comments
sorted by: hot top controversial new old
[-] 0x4E4F@infosec.pub 1 points 10 months ago

Have you checked CPU usage when playing back AV1?

[-] Fisch@lemmy.ml 1 points 10 months ago

No, will do that once I get back home

[-] Fisch@lemmy.ml 1 points 10 months ago

I tested it again and it actually works sometimes and then sometimes it gets slow again. When it gets slow, CPU usage is at around 330%-380% in top for Kodi. That's the maximum, I think, since it has 4 cores.

The Pi is already overclocked but overclocking it further is probably my only option. I don't have active cooling so I'm not sure if that would be a good idea.

[-] 0x4E4F@infosec.pub 1 points 10 months ago

What 🤨? How can it go above 100% 🤨. Auto overclock?

[-] Fisch@lemmy.ml 0 points 10 months ago

It's the usage of all 4 cores added together, so the maximum is 400%

[-] 0x4E4F@infosec.pub 1 points 10 months ago* (last edited 10 months ago)

Oh, makes sense now 😂.

Wow, that is a lot. All 4 cores are at almost max... and not even passive cooling... that can be a problem.

Hm, have you tried compiling it natively? Like for best optmization. Maybe add some hardware switches to make/cmake/whatever-it-uses-for-building?

[-] Fisch@lemmy.ml 1 points 10 months ago

I'll probably buy the Flirc case so it has some passive cooling. Temperatures are fine tho, it's at around 82-83°C.

Does compiling natively with extra optimizations make a noticable difference? Might try that.

[-] 0x4E4F@infosec.pub 1 points 10 months ago

Temperatures are fine tho, it's at around 82-83°C.

+80C is just asking for trouble if you ask me... I wouldn't be comfortable with anything above 70C.

But, than again, I don't own a Pi, so I wouldn't know. Maybe working in the middle of the second half of the 100C mark is normal for a Pi 🤷.

Does compiling natively with extra optimizations make a noticable difference?

In some cases, yes. Codecs are known to greatly increase performace if adequate CPU optimizations are used. Don't know what ARM uses, but AVX, AVX2, SSE3, etc. on Intel CPUs does significantly increase performance in codecs. It's mostly noticable when encoding, but it helps decoding as well (not to the extent that it helps in encoding though, but adequate switches when building can reduce CPU usage when decoding by about 10 to 20%... which should help a lot in your case).

But, you have to compile the software with those switches, otherwise, it won't use the optimizations 🤷.

If you can, also have a look at the build scripts of the AV1 binary/library, see if they used CPU specific optimizations or not. Maybe they did, maybe they didn't 🤷.

[-] Fisch@lemmy.ml 1 points 10 months ago

I want to try compiling it with those optimizations and I found this Reddit post, which explains how to do it. I'm not sure if just compiling and installing it is enough to make LibreELEC use it tho.

[-] 0x4E4F@infosec.pub 1 points 10 months ago* (last edited 10 months ago)

If it needs that library to work, then yes, compiling it and installing it is all it takes. Also, make sure it's installed in the right place. If it isn't, symlink it to where LibreELEC wants it to be.

Make a package of the library after compiling it... or if you can't make one, make a snapshot of the OS before installing it, so you can bring everything back the way it was in case something goes wrong.

[-] RubberElectrons@lemmy.world 1 points 10 months ago

Get active cooling as this kinda sounds like thermal throttling.

I added a 40mm Noctua fan blowing on the heatsinks of my pi3 to get it to play h265, otherwise I'd keep having issues like what you're describing.

[-] Fisch@lemmy.ml 1 points 10 months ago

That's probably the cheapest option. I already have it overclocked and it's running at about 82-83°C (But at 85°C it resets to the base clock so maybe the overclock isn't even being used). Adding active cooling might also allow me to overclock it further.

[-] RubberElectrons@lemmy.world 1 points 10 months ago

Based on this pull request, looks like dav1d is at v1.3 already. It was originally merged back in 2021, though there may be a config setting to enable it.

[-] RubberElectrons@lemmy.world 1 points 10 months ago* (last edited 10 months ago)

In fact, that PR pulls a package file from videolan, take a look at the commit for dav1d v1.3.

So you may need to ssh in and download the dav1d package: https://wiki.libreelec.tv/development/release-management

this post was submitted on 04 Dec 2023
7 points (100.0% liked)

raspberrypi

3207 readers
12 users here now

Community about the single-board computers, micro-controllers and related projects.

https://www.raspberrypi.com/

Other RaspberryPi communities on Lemmy

founded 4 years ago
MODERATORS