[WIP] Modified libstagefright for Qualcomm OMX IL for MSM7x27 SoCs running JB

Search This thread

Rashed97

Inactive Recognized Developer
May 28, 2012
1,624
10,632
First of all, here is Ganster41's original post and HERE is a link:
Hi, low-end devices users! I have good news for you :)

As you know, Qualcomm has ended support for their SoCs, based on ARMv6 core, and doesn't release OpenMax IL libraries for Android 4.0+. Someone was crying on Qualcomm's forum, someone try to understand, how to extend GB proprietaries to support new Google OMX extensions, but nobody try to modify libstagefright, and disable using new unimplemended functions...

I spent about a few weeks, learning stagefright architecture, and differents between GB and ICS OMX layers...and now I ready to show it to you :)

I have only ZTE Blade, and can make ROM only for it. You can download it here. In addition to worked hardware-accelerated video playback, and camcorder, it builded with Linaro GCC 4.7.1, and has a little UI speedup(if it not a placebo :) ). ROM based on KonstaT device tree, thanks him for it.
Oh, my Dropbox temporary blocked to public links. I upload ROM to letitbit too.

Modified framework's sources can be found on my github. Besides it, you need to add one global define to your device's BoardConfig.mk - COMMON_GLOBAL_CFLAGS += -DQCOM_LEGACY_OMX

UPD: I make same changes in CM10 sources tree, but it doesn't working, and I can't try to fix it, because haven't enough disk space to build CM10 ROM. I think, Google changes OMX API again, and it needs more fixes to get it working. You can download sources from here. For now I not interestid in CM10, because now it laggy and has some not good issues.

UPD2: Please, if you want my help with integration problem, attach logcat at the time, when you try to use vide playback/camcorder. I can't help without any information.

UPD3: If you trying to make port for your device, this post can be helpful. Thanks to cougarcougar for it.

UPD4: We still get errors, if trying to play videos from some apps(e.g. Android browser) in not-fullscreen mode. gralloc or mmap returns error, when try to map buffers from NativeWindow. If anybody have ideas how to fix it, please write it here, or to my PM...

Important addition!
Devices based on MSM7x27 chips has two different versions of OMX libs.
"Oldt"(for froyo?) has an unknown padding between color components parts of returning buffer. I have fixed that for most videos, but some strange resolutions are still gets broken colors with green line on top.
"New" version are present in Samsung/LG devices, who has official Gingerbread ROMs. It returns correct buffer in dfferent color format(YV12, instead of NV21), but it laggy on VGA+ videos. Now don't know why. May be it convert resulting buffer to YV12 on CPU... I will try to understand it later.
I think you can use "old" libs from ZTE Blade on any device, because "new" libs work on ZTE Blade too.

PS: If you want to thanks/support my work - you know where you can find button for it. ;)

Now for this thread:
This is a project for porting this over to JB. Currently it builds. That's just about it. We need to make this work.
Current contributors are:
  • Rashed97
  • Bytecode
  • bieltv.3
  • erikcas

And the repos currently resides at: https://github.com/androidarmv6/android_frameworks_av and https://github.com/androidarmv6/android_frameworks_native

Anyone else wanting to work on this, just shoot me a PM and I'll add you to the list and the repo!
 
Last edited:

Eskuero

Recognized Developer
Feb 15, 2012
1,388
2,284
I'm interesting on get it working, but not sure if really I can help, I'll continue testing some fixes in my local, and if a discover something interesting I'll give you the info.


Enviado desde mi Wildfire S A510e usando Tapatalk 2
 
  • Like
Reactions: Kevinjoa

hcgonzalezpr

Senior Member
Jun 16, 2009
98
121
Miami
harrygonzalez.me
Im gonna give it a try, and see what happends.

Edit 1: Mine did boot how can I verify that its working?

Edit 2: Its complaining about a missing libwvm.so
 
Last edited:

Rashed97

Inactive Recognized Developer
May 28, 2012
1,624
10,632
Rashed, sent you PM. Done some things on this.
like I said in PM, it is some port from CM9 and result of a little out-of-the-box thinking
HQ stream comes in but lags (..we're much too late, skipping..." in logcat)
see https://github.com/erikcas/android_frameworks_av/

Are the errors something like this?
"The main process is doing to much work on its main thread. Skipping xx frames!"

If they are I get those too...



Sent from my iPod touch using Tapatalk
 
  • Like
Reactions: TdiGuy

hcgonzalezpr

Senior Member
Jun 16, 2009
98
121
Miami
harrygonzalez.me
Are the errors something like this?
"The main process is doing to much work on its main thread. Skipping xx frames!"

If they are I get those too...



Sent from my iPod touch using Tapatalk

Exactly those

Verstuurd van mijn GT-S5660 met Tapatalk

I get those everywhere including messeges app with or without the omx hack, to me those errors can be ignore, that's android saying the thing it just doing it taking a lot of cpu power to the point the screen frame started to skip.
 
  • Like
Reactions: keensha

erikcas

Inactive Recognized Developer
May 16, 2008
2,808
5,943
Castricum
www.cas-online.nl
I get those everywhere including messeges app with or without the omx hack, to me those errors can be ignore, that's android saying the thing it just doing it taking a lot of cpu power to the point the screen frame started to skip.

I got those on ICS too when lagging. When solved they dissapeared so in my opinion they cannot be ignored.

Also. Skipping frames equals lag implicitly imo

Verstuurd van mijn GT-S5660 met Tapatalk
 

hcgonzalezpr

Senior Member
Jun 16, 2009
98
121
Miami
harrygonzalez.me
I got those on ICS too when lagging. When solved they dissapeared so in my opinion they cannot be ignored.

Also. Skipping frames equals lag implicitly imo

Verstuurd van mijn GT-S5660 met Tapatalk

I know its a more detailed way of saying the app just hanged and its laggin, its helpfull to identify if its running full at perfromance, but imo it does not give right now a reason why it does not work at all. Later this night im gonna post a more detail log about the errors.
 

erikcas

Inactive Recognized Developer
May 16, 2008
2,808
5,943
Castricum
www.cas-online.nl
I know its a more detailed way of saying the app just hanged and its laggin, its helpfull to identify if its running full at perfromance, but imo it does not give right now a reason why it does not work at all. Later this night im gonna post a more detail log about the errors.
well, here is my logcat for 40 secs of video:
Code:
I/ChromiumHTTPDataSource(  608): connect to http://redirector.c.youtube.com/videoplayback?id=5f20aa830f9249fd&itag=18&source=youtube&uaopt=no-save&upn=Dp7QSj_dcks&el=user_uploads&devKey=ATpxuMO4AN5NR1nGmfaQDBQO88HsQjpE1a8d1GxQnGDm&app=youtube_gdata&ip=0.0.0.0&ipbits=0&expire=1352524595&sparams=id,itag,source,uaopt,upn,ip,ipbits,expire&signature=1F93E556DA16E6BC085D0445694060D308BD3315.D2FB8F933BAF64B5E643B42AB1CF25EB36D630E7&key=yta1&androidcid=android-google&dnc=1 @0
I/AudioHardware(  608): set device to SND_DEVICE_SPEAKER device_id=0
I/AudioHardware(  608): disabling post proc features with mask 0x0000
W/WVMExtractor(  608): Failed to open libwvm.so
E/OMXCodec(  608): failed to allocate node OMX.qcom.video.decoder.h264
I/OMXCodec(  608): [OMX.google.h264.decoder] Non-Interlaced format detected
I/OMXCodec(  608): [OMX.google.h264.decoder] AVC profile = 66 (Baseline), level = 30
I/OMXCodec(  608): [OMX.google.h264.decoder] Enable frame by frame mode
W/OMXCodec(  608): Failed to set frame packing format on component
I/OMXCodec(  608): [OMX.google.h264.decoder] video dimensions are 320 x 240
I/OMXCodec(  608): [OMX.google.h264.decoder] Crop rect is 320 x 240 @ (0, 0)
E/OMXCodec(  608): [OMX.google.h264.decoder] Ignore PortSettingsChanged event
I/OMXCodec(  608): [OMX.google.h264.decoder] video dimensions are 640 x 368
I/OMXCodec(  608): [OMX.google.h264.decoder] Crop rect is 640 x 360 @ (0, 0)
I/SoftwareRenderer(  608): Buffer color format: 0x13
I/SoftwareRenderer(  608): Video params: mWidth: 640, mHeight: 368, mCropWidth: 640, mCropHeight: 360, mCropTop: 0, mCropLeft: 0
I/AudioHardware(  608): set device to SND_DEVICE_SPEAKER device_id=0
I/AudioHardware(  608): Enabling post proc features with mask 0x0000
I/AwesomePlayer(  608): we're much too late (0.51 secs), video skipping ahead
I/AwesomePlayer(  608): we're much too late (0.52 secs), video skipping ahead
I/NuCachedSource2(  608): ERROR_END_OF_STREAM
I/AwesomePlayer(  608): we're much too late (0.50 secs), video skipping ahead
D/NetlinkEvent(  606): Unexpected netlink message. type=0x0
D/NetlinkEvent(  606): Unexpected netlink message. type=0x0
D/NetlinkEvent(  606): Unexpected netlink message. type=0x0
D/NetlinkEvent(  606): Unexpected netlink message. type=0x0
I/AwesomePlayer(  608): we're much too late (0.50 secs), video skipping ahead
I/AwesomePlayer(  608): we're much too late (0.51 secs), video skipping ahead
 

psyke83

Inactive Recognized Developer
Mar 29, 2011
1,267
3,959
well, here is my logcat for 40 secs of video:
Code:
E/OMXCodec(  608): failed to allocate node OMX.qcom.video.decoder.h264

Your device didn't allocate the hardware codec - see the line above. The reason why your video is laggy is simply because it's using the software fallback...
 

hcgonzalezpr

Senior Member
Jun 16, 2009
98
121
Miami
harrygonzalez.me
yup I know. That is where I am in a loop. So gonna have a bear to get out of it :)
Edit: beer :p

Insted of trying to play a youtube video I tried playing a .mp4 video and I got preatty much the same results as your logcat, but

Code:
W/WVMExtractor(  608): Failed to open libwvm.so

Came up alot to the point I needed to end the logcat to read what was going on. But right now im waiting for a phone call ( this is my main phone ), so i cant test my build, but as soon im done with the phone call gonna try again my build and report back.
 

Eskuero

Recognized Developer
Feb 15, 2012
1,388
2,284
I can play mp4 videos on gallery perfectly, only 3gp and youtube hq lags.

Enviado desde mi Wildfire S A510e usando Tapatalk 2
 

erikcas

Inactive Recognized Developer
May 16, 2008
2,808
5,943
Castricum
www.cas-online.nl
Insted of trying to play a youtube video I tried playing a .mp4 video and I got preatty much the same results as your logcat, but

Code:
W/WVMExtractor(  608): Failed to open libwvm.so

Came up alot to the point I needed to end the logcat to read what was going on. But right now im waiting for a phone call ( this is my main phone ), so i cant test my build, but as soon im done with the phone call gonna try again my build and report back.

I think that can be ignored. The "error" has been there allways.
 
Last edited:

Rashed97

Inactive Recognized Developer
May 28, 2012
1,624
10,632
Hm... Try using the ICS libwmv.so file and see if that works. Also for some reason it keeps using the non-Qualcomm libs so that's why it insists on not working.
 
  • Like
Reactions: AHLASSICH

Bytecode

Inactive Recognized Developer
Dec 30, 2010
2,683
4,487
25
/dev/null
Hello everyone,did not see this thread before,anyways I think the problem is into the decoder select. When comparing my Jellybean roms with the Gangster41's hack,all I can see into the logcat are output from OMX.google video codec. Therefore,AwesomePlayer tells us we're too much late and skips the video. I think we need to revise that portion of the code.

Sincerely,
Bytecode
 

erikcas

Inactive Recognized Developer
May 16, 2008
2,808
5,943
Castricum
www.cas-online.nl
Last edited:
  • Like
Reactions: Rashed97

Top Liked Posts

  • There are no posts matching your filters.
  • 50
    First of all, here is Ganster41's original post and HERE is a link:
    Hi, low-end devices users! I have good news for you :)

    As you know, Qualcomm has ended support for their SoCs, based on ARMv6 core, and doesn't release OpenMax IL libraries for Android 4.0+. Someone was crying on Qualcomm's forum, someone try to understand, how to extend GB proprietaries to support new Google OMX extensions, but nobody try to modify libstagefright, and disable using new unimplemended functions...

    I spent about a few weeks, learning stagefright architecture, and differents between GB and ICS OMX layers...and now I ready to show it to you :)

    I have only ZTE Blade, and can make ROM only for it. You can download it here. In addition to worked hardware-accelerated video playback, and camcorder, it builded with Linaro GCC 4.7.1, and has a little UI speedup(if it not a placebo :) ). ROM based on KonstaT device tree, thanks him for it.
    Oh, my Dropbox temporary blocked to public links. I upload ROM to letitbit too.

    Modified framework's sources can be found on my github. Besides it, you need to add one global define to your device's BoardConfig.mk - COMMON_GLOBAL_CFLAGS += -DQCOM_LEGACY_OMX

    UPD: I make same changes in CM10 sources tree, but it doesn't working, and I can't try to fix it, because haven't enough disk space to build CM10 ROM. I think, Google changes OMX API again, and it needs more fixes to get it working. You can download sources from here. For now I not interestid in CM10, because now it laggy and has some not good issues.

    UPD2: Please, if you want my help with integration problem, attach logcat at the time, when you try to use vide playback/camcorder. I can't help without any information.

    UPD3: If you trying to make port for your device, this post can be helpful. Thanks to cougarcougar for it.

    UPD4: We still get errors, if trying to play videos from some apps(e.g. Android browser) in not-fullscreen mode. gralloc or mmap returns error, when try to map buffers from NativeWindow. If anybody have ideas how to fix it, please write it here, or to my PM...

    Important addition!
    Devices based on MSM7x27 chips has two different versions of OMX libs.
    "Oldt"(for froyo?) has an unknown padding between color components parts of returning buffer. I have fixed that for most videos, but some strange resolutions are still gets broken colors with green line on top.
    "New" version are present in Samsung/LG devices, who has official Gingerbread ROMs. It returns correct buffer in dfferent color format(YV12, instead of NV21), but it laggy on VGA+ videos. Now don't know why. May be it convert resulting buffer to YV12 on CPU... I will try to understand it later.
    I think you can use "old" libs from ZTE Blade on any device, because "new" libs work on ZTE Blade too.

    PS: If you want to thanks/support my work - you know where you can find button for it. ;)

    Now for this thread:
    This is a project for porting this over to JB. Currently it builds. That's just about it. We need to make this work.
    Current contributors are:
    • Rashed97
    • Bytecode
    • bieltv.3
    • erikcas

    And the repos currently resides at: https://github.com/androidarmv6/android_frameworks_av and https://github.com/androidarmv6/android_frameworks_native

    Anyone else wanting to work on this, just shoot me a PM and I'll add you to the list and the repo!
    13
    erikcas, great idea! Why don't we use the Google encoders but the QCOM decoders? Then video recording will work! I'm trying it right now ;)

    It works. Check out the commit: https://github.com/lgics/cm_device_...mmit/9d0a71cd8de0250eb17d9759581096acea0886d9
    He came up with the idea, and I commited it and tested it. Try those media_codecs and _profiles with the libs that give you working HQ video. That should do it :D

    Oh yeah and Oliver: That commit should fix your low FPS too

    I'm gonna push a fix that I saw on Sunday in a few min. It fixes the video thumbnail issues.
    10
    Nice to start with after my android-break! Good job Rashed!

    Confirmed on samsung :cool:

    Verstuurd van mijn GT-S5660 met Tapatalk
    7
    Look at my last commit and updated first post in CM9 thread. I have some good improvements ;)
    5
    I've got YouTube hq and camcorder working.

    I got rid of all cts hacks and using konstat's gerrit patch and GitHub patches and the media codecs file from earlier in the thread both work at the same time.