[resolved] Revisiting egl.cfg

Search This thread

Mioze7Ae

Retired Recognized Developer
Dec 27, 2010
2,153
2,053
Queen City of the West
Google Pixel 7
Update: Resolved to my satisfaction: http://xdaforums.com/showpost.php?p=14323192&postcount=8
The egl.cfg we've been using:
Code:
1 1 android
0 1 POWERVR_SGX530_121
is functionally equivalent to removing the software renderer:
Code:
0 1 POWERVR_SGX530_121
Original post:
......................................................................................
So, we've been running /system/lib/egl/egl.cfg set as:
Code:
1 1 android
0 1 POWERVR_SGX530_121
This tweaked egl.cfg essentially disables hardware rendering and substitutes software rendering. The default setting is
Code:
0 0 android
0 1 POWERVR_SGX530_121
We do this because this was reported to be much, much faster by just about everyone and I will admit to also experiencing this improvement. However, I've recently run 2.1 and honestly it really puts our 2.2 to shame. Additionally it's never made any sense that the software renderer would outperform hardware acceleration. It makes more sense that there's something wrong with our graphics libraries and that's why software rendering wins. Or we were mistaken in believing things were faster.

In my work-in-progress ROM, I've updated graphics libraries (for other reasons) and then I tried disabling the tweak and performance seems much improved and much closer to what I see in 2.1 (FYI, for some reason I had to wipe dalvik-cache after making the change or boot got stuck, but that could be unrelated).

So, the question is: are the updated graphics libraries the reason it works or was changing egl.cfg a mistake?

Can some adventurous souls try going back to the defaults and report whether they really think the software render really is faster? Please post which ROM you are testing on. If switching egl.cfg back to defaults makes things worse, we can then try whether updating the graphics libraries to the versions I'm testing helps.
 
Last edited:

fjfalcon

Retired Recognized Developer
Jan 19, 2011
844
1,263
Schelkovo
RusMod,usyng egl.cfg as soft renderer.

In next version i will try to move egl.cfg to default from 2.1 and will ask people - how it feeling.

For results will post here.

btw, afaik defy uses same video accel?


p.s. http://xt720.fjfalcon.ru/Mods/rusmodv1.14.zip


RusMod users haven't noticed much problem(all usyng fastboot kernel)
But in quadrant when going test with2 planets - scores shows like in 2.1.
 
Last edited:
  • Like
Reactions: Mioze7Ae

reverendkjr

Senior Member
Nov 7, 2009
891
849
Cincinnati, OH
www.youtube.com
I wondered how long it would take for this to come back up. I think that the difference between hardware and software based encoding on our phone is more of a question of "What else is being affected?"

Obviously, there isn't too dramatic of a difference in the overall performance or people would have been screaming about it way back when we made this change. I am more concerned about the possibility of other things, such as battery life or video performance being affected by these settings. Is it possible that other things are being hit? Who knows. I always knew that this change was merely cosmetic, a way to boost quadrant scores.

Mioze7Ae, I switched mine back and have been tinkering with it since. I have not noticed a significant difference. It actually seemed a bit choppier. If you have a test build with new libs, I would be willing to try it out for a while and see if I can break it. :D

I forgot to add:

I'm running galaxyXTv4. I didn't like the way epicsteelblue looked. :)
 
Last edited:
  • Like
Reactions: Mioze7Ae

Mioze7Ae

Retired Recognized Developer
Dec 27, 2010
2,153
2,053
Queen City of the West
Google Pixel 7
Mioze7Ae, I switched mine back and have been tinkering with it since. I have not noticed a significant difference. It actually seemed a bit choppier. If you have a test build with new libs, I would be willing to try it out for a while and see if I can break it. :D

I also notice it is slightly choppier sometimes but on the other hand the software rendering to me feels sluggish and the hardware rendering feels more responsive. For example scrolling: open something with a long list and throw the list up and down. The software rendering seems to slow this down and lag a bit, but the hardware rendered flows faster and seems to stay underneath my finger. The 3D program list in ADW Launcher is noticeably faster and smoother.

Anyway, as you wish here's the work-in-progress. ;)
http://www.multiupload.com/HYUZG4E3BZ
It's a larger rework of Dexter's 1.3. It's based on an analysis I'm doing where I compare which files change and which files remain identical between Motorola's XT720 2.1, Motoroi 2.1 and 2.2, and Milestone 2.1 and 2.2 releases in order to make predictions about which versions of these files should be on Milestone XT720 2.2. It's a full ROM that applies as an update instead of a nandroid image. I switched the 2nd-init hijack to the simpler bin/sh_hijack.sh+etc/rootfs one that is used on Milestone instead of the mot_boot_mode+lw+lw2+ramdisk.tar method. Not included are the init.d scripts--so the governors, overclocking, ext partition, swap, moving dalvik-cache to /cache are "do it yourself" for now. I'm porting the CM6 scripts to implement that, but they're not ready.
 
  • Like
Reactions: 3rdstring

Mioze7Ae

Retired Recognized Developer
Dec 27, 2010
2,153
2,053
Queen City of the West
Google Pixel 7
How is the battery life doing Mioze7Ae? And thanks for fixing, will try this weekend when im free. =)

Honestly, I haven't had that ROM running long enough to have an opinion about its battery life. ;) It's quickly evolving and I keep flashing back to an earlier version that's about half-way between bugfix-3 and this version for my everyday use. There's still a lot I need to do with this ROM before I'm ready to "move in" and dogfood it. :D Anyway it's my feeling that disabling the egl.cfg tweek improves performance on this ROM.

In the mean time, if changing the egl.cfg back actually makes things worse on current ROMs, we can see about testing just these specific libraries in those ROMs. There's just so many of them. I'll see if I can make a library patch for galaxyXTv4 for reverendkjr to test.

Which one do you run?
 
Last edited:

mchlbenner

Senior Member
Jul 1, 2008
3,381
842
Hi been useing the rus.mod and it has without error something could not say before very good build.

Sent from my XT720 using XDA Premium App
 

Mioze7Ae

Retired Recognized Developer
Dec 27, 2010
2,153
2,053
Queen City of the West
Google Pixel 7
I think I've figured this out

Ok, here's the scoop: contrary to what I thought, xav's hacked egl.cfg actually disables the software renderer all together. In testing with Quadrant Advance I get identical (best) performance from either of these two egl.cfg's:
Code:
1 1 android
0 1 POWERVR_SGX530_121
and (my recommendation):
Code:
0 1 POWERVR_SGX530_121

More info
The documentation header for egl.cfg says:
Code:
#
# One line per configuration, of the form:
#
# D I TAG
#
# D: display (0: default)
# I: implementation (0: software, 1: hardware)
# TAG: a unique tag
#
# The library name loaded by EGL is constructed as (in that order):
#
# /system/lib/egl/libGLES_$TAG.so
# /system/lib/egl/lib{EGL|GLESv1_CM|GLESv2}_$TAG.so
#
Now, what had me confused in the past is I couldn't make heads or tails of what "D: display (0: default)" means. Somehow when re-reading that today had the obvious revelation that it's referring to "display number" and 0 is the display number of the primary screen (the default screen) the same way that X11 in Unix refers to displays. So:
Code:
1 1 android
means "use the android software renderer as a hardware renderer on the second display" (we don't have a second display and I don't think it can mean the TV or HDMI out, either because Motorola never defined any renderers for a second device). In fact, you can just delete or comment out the entire 0 0 android line and get the same results.

From testing, a tale-tale sign of the software renderer being used is that messed up moon. Hardware rendering doesn't have the messed up moon.

Motorola's default enables both:
Code:
0 0 android
0 1 POWERVR_SGX530_121
It turns out that even making the software renderer available is bad for 3D performance.

So why does having the software renderer around cause trouble? Speculation: I thought OpenGL is supposed to figure out the best way to render things, so why is it getting this wrong? My guess is the software renderer must provide APIs that are preferred compared to what the hardware interface provides so applications or the GL library negotiates to use the software API rather than a less desirable hardware-accelerated library or perhaps they can't tell the difference. Or perhaps Quadrant is a piece of junk. That's my guess anyway.

Here's a bunch of testing I did (default kernel frequencies/voltages):

Code:
egl.cfg: 0 0 android
         0 1 POWERVR_SGX530_121
# Has the messed up moon
   Tot  CPU Mem I/O  2D  3D
------+----+---+---+---+----
1: 573  954 813 630 194 273
2: 590  989 841 648 195 276
3: 627 1029 981 654 195 277
4: 597 1008 842 663 195 275
5: 601 1025 847 662 194 277

egl.cfg: 1 1 android
         0 1 POWERVR_SGX530_121
# No messed up moon
   Tot  CPU Mem I/O  2D  3D
------+----+---+---+---+----
1: 612  925 820 601 194 521
2: 590  935 842 459 195 519
3: 654  949 977 626 196 524
4: 642 1009 822 656 195 527
5: 643  998 854 645 194 524

egl.cfg: 0 1 android
         0 0 POWERVR_SGX530_121
# Noticably awful--feels like a Macintosh 512k
# Quadrant warns about using software rendering
# Has the messed up moon
   Tot  CPU Mem I/O  2D  3D
------+----+---+---+---+----
1: 465  803 730 562  79 151
2: 477  735 784 635  80 152
3: 487  773 791 638  80 153
4: 472  750 757 622  80 153
5: 468  785 773 552  80 152

egl.cfg: 0 0 POWERVR_SGX530_121
# No messed up moon
   Tot  CPU Mem I/O  2D  3D
------+----+---+---+---+----
1: 613  860 860 626 193 524
2: 635  963 836 658 194 522
3: 641 1014 807 661 196 526
4: 654  989 912 653 194 522
5: 674 1026 977 648 194 525

egl.cfg: 0 1 POWERVR_SGX530_121
# No messed up moon
   Tot  CPU Mem I/O  2D  3D
------+----+---+---+---+----
1: 609  919 960 452 193 519
2: 601  946 716 620 195 528
3: 664  999 960 647 195 521
4: 627 1014 751 651 194 527
5: 642 1008 820 661 192 529

egl.cfg: 0 1 POWERVR_SGX530_121
         0 0 android
# Has the messed up moon
   Tot  CPU Mem I/O  2D  3D
------+----+---+---+---+----
1: 575  917 872 626 189 269
2: 595  967 890 651 193 273
3: 597  978 901 634 194 277
4: 577 1006 845 571 192 272
5: 591  982 834 665 195 278
 
Last edited:

reverendkjr

Senior Member
Nov 7, 2009
891
849
Cincinnati, OH
www.youtube.com
I flashed dexter's 1.3, then I installed your update. I'll run it for a while and get back to you on my results. A couple of items though. First, the camera apk doesnt work. I tried deleting and reinstalling, but it will not. Also, Milestone Overclock refuses to load. I am wondering if you have experienced anything along these lines yet.
 

Mioze7Ae

Retired Recognized Developer
Dec 27, 2010
2,153
2,053
Queen City of the West
Google Pixel 7
I flashed dexter's 1.3, then I installed your update. I'll run it for a while and get back to you on my results. A couple of items though. First, the camera apk doesnt work. I tried deleting and reinstalling, but it will not. Also, Milestone Overclock refuses to load. I am wondering if you have experienced anything along these lines yet.

Yeah, none of that works yet. It's probably not worth playing with extensively yet. I've only just started getting into the libraries. When it's closer to usable I'll post another.
 

reverendkjr

Senior Member
Nov 7, 2009
891
849
Cincinnati, OH
www.youtube.com
I changed my egl to

0 1 POWERVR_SGX530_121

completely removed the android line. I was surprised to see that was even possible. I also managed to get the Milestone Overclock v. 1.4.1 to run on this and OC to 1ghz. I was thinking about trying

1 1 android
0 0 POWERVR_SGX530_121

since it doesn't look like that was tried yet. I'll do that later. I have been running the all day and do believe there is a level of "snappiness" that the other versions do not have.
 
Last edited:
  • Like
Reactions: Mioze7Ae

reverendkjr

Senior Member
Nov 7, 2009
891
849
Cincinnati, OH
www.youtube.com
I changed my egl to

0 1 POWERVR_SGX530_121

completely removed the android line. I was surprised to see that was even possible. I also managed to get the Milestone Overclock v. 1.4.1 to run on this and OC to 1ghz. I was thinking about trying

1 1 android
0 0 POWERVR_SGX530_121

since it doesn't look like that was tried yet. I'll do that later. I have been running the all day and do believe there is a level of "snappiness" that the other versions do not have.

Not much of a difference. I went back to

0 1 POWERVR_SGX530_121.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 10
    I think I've figured this out

    Ok, here's the scoop: contrary to what I thought, xav's hacked egl.cfg actually disables the software renderer all together. In testing with Quadrant Advance I get identical (best) performance from either of these two egl.cfg's:
    Code:
    1 1 android
    0 1 POWERVR_SGX530_121
    and (my recommendation):
    Code:
    0 1 POWERVR_SGX530_121

    More info
    The documentation header for egl.cfg says:
    Code:
    #
    # One line per configuration, of the form:
    #
    # D I TAG
    #
    # D: display (0: default)
    # I: implementation (0: software, 1: hardware)
    # TAG: a unique tag
    #
    # The library name loaded by EGL is constructed as (in that order):
    #
    # /system/lib/egl/libGLES_$TAG.so
    # /system/lib/egl/lib{EGL|GLESv1_CM|GLESv2}_$TAG.so
    #
    Now, what had me confused in the past is I couldn't make heads or tails of what "D: display (0: default)" means. Somehow when re-reading that today had the obvious revelation that it's referring to "display number" and 0 is the display number of the primary screen (the default screen) the same way that X11 in Unix refers to displays. So:
    Code:
    1 1 android
    means "use the android software renderer as a hardware renderer on the second display" (we don't have a second display and I don't think it can mean the TV or HDMI out, either because Motorola never defined any renderers for a second device). In fact, you can just delete or comment out the entire 0 0 android line and get the same results.

    From testing, a tale-tale sign of the software renderer being used is that messed up moon. Hardware rendering doesn't have the messed up moon.

    Motorola's default enables both:
    Code:
    0 0 android
    0 1 POWERVR_SGX530_121
    It turns out that even making the software renderer available is bad for 3D performance.

    So why does having the software renderer around cause trouble? Speculation: I thought OpenGL is supposed to figure out the best way to render things, so why is it getting this wrong? My guess is the software renderer must provide APIs that are preferred compared to what the hardware interface provides so applications or the GL library negotiates to use the software API rather than a less desirable hardware-accelerated library or perhaps they can't tell the difference. Or perhaps Quadrant is a piece of junk. That's my guess anyway.

    Here's a bunch of testing I did (default kernel frequencies/voltages):

    Code:
    egl.cfg: 0 0 android
             0 1 POWERVR_SGX530_121
    # Has the messed up moon
       Tot  CPU Mem I/O  2D  3D
    ------+----+---+---+---+----
    1: 573  954 813 630 194 273
    2: 590  989 841 648 195 276
    3: 627 1029 981 654 195 277
    4: 597 1008 842 663 195 275
    5: 601 1025 847 662 194 277
    
    egl.cfg: 1 1 android
             0 1 POWERVR_SGX530_121
    # No messed up moon
       Tot  CPU Mem I/O  2D  3D
    ------+----+---+---+---+----
    1: 612  925 820 601 194 521
    2: 590  935 842 459 195 519
    3: 654  949 977 626 196 524
    4: 642 1009 822 656 195 527
    5: 643  998 854 645 194 524
    
    egl.cfg: 0 1 android
             0 0 POWERVR_SGX530_121
    # Noticably awful--feels like a Macintosh 512k
    # Quadrant warns about using software rendering
    # Has the messed up moon
       Tot  CPU Mem I/O  2D  3D
    ------+----+---+---+---+----
    1: 465  803 730 562  79 151
    2: 477  735 784 635  80 152
    3: 487  773 791 638  80 153
    4: 472  750 757 622  80 153
    5: 468  785 773 552  80 152
    
    egl.cfg: 0 0 POWERVR_SGX530_121
    # No messed up moon
       Tot  CPU Mem I/O  2D  3D
    ------+----+---+---+---+----
    1: 613  860 860 626 193 524
    2: 635  963 836 658 194 522
    3: 641 1014 807 661 196 526
    4: 654  989 912 653 194 522
    5: 674 1026 977 648 194 525
    
    egl.cfg: 0 1 POWERVR_SGX530_121
    # No messed up moon
       Tot  CPU Mem I/O  2D  3D
    ------+----+---+---+---+----
    1: 609  919 960 452 193 519
    2: 601  946 716 620 195 528
    3: 664  999 960 647 195 521
    4: 627 1014 751 651 194 527
    5: 642 1008 820 661 192 529
    
    egl.cfg: 0 1 POWERVR_SGX530_121
             0 0 android
    # Has the messed up moon
       Tot  CPU Mem I/O  2D  3D
    ------+----+---+---+---+----
    1: 575  917 872 626 189 269
    2: 595  967 890 651 193 273
    3: 597  978 901 634 194 277
    4: 577 1006 845 571 192 272
    5: 591  982 834 665 195 278
    3
    Update: Resolved to my satisfaction: http://xdaforums.com/showpost.php?p=14323192&postcount=8
    The egl.cfg we've been using:
    Code:
    1 1 android
    0 1 POWERVR_SGX530_121
    is functionally equivalent to removing the software renderer:
    Code:
    0 1 POWERVR_SGX530_121
    Original post:
    ......................................................................................
    So, we've been running /system/lib/egl/egl.cfg set as:
    Code:
    1 1 android
    0 1 POWERVR_SGX530_121
    This tweaked egl.cfg essentially disables hardware rendering and substitutes software rendering. The default setting is
    Code:
    0 0 android
    0 1 POWERVR_SGX530_121
    We do this because this was reported to be much, much faster by just about everyone and I will admit to also experiencing this improvement. However, I've recently run 2.1 and honestly it really puts our 2.2 to shame. Additionally it's never made any sense that the software renderer would outperform hardware acceleration. It makes more sense that there's something wrong with our graphics libraries and that's why software rendering wins. Or we were mistaken in believing things were faster.

    In my work-in-progress ROM, I've updated graphics libraries (for other reasons) and then I tried disabling the tweak and performance seems much improved and much closer to what I see in 2.1 (FYI, for some reason I had to wipe dalvik-cache after making the change or boot got stuck, but that could be unrelated).

    So, the question is: are the updated graphics libraries the reason it works or was changing egl.cfg a mistake?

    Can some adventurous souls try going back to the defaults and report whether they really think the software render really is faster? Please post which ROM you are testing on. If switching egl.cfg back to defaults makes things worse, we can then try whether updating the graphics libraries to the versions I'm testing helps.
    2
    I changed my egl to

    0 1 POWERVR_SGX530_121

    completely removed the android line. I was surprised to see that was even possible. I also managed to get the Milestone Overclock v. 1.4.1 to run on this and OC to 1ghz. I was thinking about trying

    1 1 android
    0 0 POWERVR_SGX530_121

    since it doesn't look like that was tried yet. I'll do that later. I have been running the all day and do believe there is a level of "snappiness" that the other versions do not have.

    Not much of a difference. I went back to

    0 1 POWERVR_SGX530_121.
    1
    RusMod,usyng egl.cfg as soft renderer.

    In next version i will try to move egl.cfg to default from 2.1 and will ask people - how it feeling.

    For results will post here.

    btw, afaik defy uses same video accel?


    p.s. http://xt720.fjfalcon.ru/Mods/rusmodv1.14.zip


    RusMod users haven't noticed much problem(all usyng fastboot kernel)
    But in quadrant when going test with2 planets - scores shows like in 2.1.
    1
    I wondered how long it would take for this to come back up. I think that the difference between hardware and software based encoding on our phone is more of a question of "What else is being affected?"

    Obviously, there isn't too dramatic of a difference in the overall performance or people would have been screaming about it way back when we made this change. I am more concerned about the possibility of other things, such as battery life or video performance being affected by these settings. Is it possible that other things are being hit? Who knows. I always knew that this change was merely cosmetic, a way to boost quadrant scores.

    Mioze7Ae, I switched mine back and have been tinkering with it since. I have not noticed a significant difference. It actually seemed a bit choppier. If you have a test build with new libs, I would be willing to try it out for a while and see if I can break it. :D

    I forgot to add:

    I'm running galaxyXTv4. I didn't like the way epicsteelblue looked. :)