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

[BUG] add_surface drains CPU on idle #329

Closed
oomek opened this issue Mar 12, 2017 · 2 comments
Closed

[BUG] add_surface drains CPU on idle #329

oomek opened this issue Mar 12, 2017 · 2 comments

Comments

@oomek
Copy link
Collaborator

oomek commented Mar 12, 2017

Gues what ... I found another bug :)
When using surfaces the CPU does not go into idle state when no transitions are occuring. With one surface CPU usage sits at around 15-20% on one core.
In the example below screen is filled with snaps, each has its own surface to emphasize the problem. It takes 100% of CPU on one core even when there is no transitions, funny thing it goes down a little when you start scrolling through snaps.

local surface = []
local snap = []
local tiles_x = 8
local tiles_y = 6
for( local x = 0; x < fe.layout.width; x += fe.layout.width / tiles_x )
    for( local y = 0; y < fe.layout.width; y += fe.layout.height / tiles_y )
    {
        local surf = fe.add_surface( fe.layout.width / tiles_x, fe.layout.height / tiles_y )
        surf.set_pos( x, y )
        local obj =  surf.add_artwork ( "snap" ,0 , 0, fe.layout.width / tiles_x, fe.layout.height / tiles_y )
        obj.video_flags = Vid.ImagesOnly
        obj.preserve_aspect_ratio = false
        surface.push( surf )
        snap.push( obj )
    }

Another example does not use surfaces and the idle CPU usage as expected sits at around 0.5%

local snap = []
local tiles_x = 8
local tiles_y = 6
for( local x = 0; x < fe.layout.width; x += fe.layout.width / tiles_x )
    for( local y = 0; y < fe.layout.width; y += fe.layout.height / tiles_y )
    {
        local obj =  fe.add_artwork ( "snap" ,x , y, fe.layout.width / tiles_x, fe.layout.height / tiles_y )
        obj.video_flags = Vid.ImagesOnly
        obj.preserve_aspect_ratio = false
        snap.push( obj )
    }

So please tell me if it's a limitation of the rendering pipeline or a bug. I need to know if it's the former, as I'will try to edit my code to get rid of surfaces.

@oomek oomek changed the title [BUG] add_surface CPU drain on idle [BUG] add_surface deains CPU on idle Mar 12, 2017
@oomek oomek changed the title [BUG] add_surface deains CPU on idle [BUG] add_surface drains CPU on idle Mar 12, 2017
@mickelson
Copy link
Owner

ok thanks, this one should be fixed now

@oomek
Copy link
Collaborator Author

oomek commented Mar 15, 2017

It is, indeed. Thank you for your awesome work.

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