[T-Mobile myTouch 4G Slide] Braccoz:
hey guys, i would like to share some of my findings about the 1080p camera issue

prologue: scverhagen's 1080p hack works but only with the m4v encoder which puts out an h263 file (basically, divx quality). i also found out that the stock rom encodes both 720p and 1080p @h264 baseline lvl 4.0 while CM only encodes h264 baseline level 3.2

the findings: when you try to record 1080p h264 the camera app crashes and this is the logcat:

I/OMXCodec( 1357): Attempting to allocate OMX node 'OMX.qcom.video.encoder.avc'

E/OMX-VENC-720p( 1357):

E/OMX-VENC-720p( 1357): omx_video(): Inside Constructor()

E/OMX-VENC-720p( 1357):

E/OMX-VENC-720p( 1357): omx_venc(): Inside component_init()

E/OMX-VENC-720p( 1357): bool venc_dev::venc_validate_profile_level(OMX_U32*, OMX_U32*): Returning with eProfile = 1Level = 4

E/OMX-VENC-720p( 1357):

E/OMX-VENC-720p( 1357): bool venc_dev::venc_open(OMX_U32)(): Init Profile/Level setting success

E/OMX-VENC-720p( 1357): vidc.venc.debug.sliceinfo value is 0

E/OMX-VENC-720p( 1357):

E/OMX-VENC-720p( 1357): Component_init return value = 0x0

I/OMXCodec( 1357): Successfully allocated OMX node 'OMX.qcom.video.encoder.avc'

E/OMX-VENC-720p( 1357):

E/OMX-VENC-720p( 1357): WARNING: Requested i/p bufsize[40960],Driver's updated i/p bufsize = 3133440

E/OMX-VENC-720p( 1357): bool venc_dev::venc_validate_profile_level(OMX_U32*, OMX_U32*): Returning with eProfile = 1Level = 2048

E/OMX-VENC-720p( 1357):

E/OMX-VENC-720p( 1357): bool venc_dev::venc_set_param(void*, OMX_INDEXTYPE)(): Profile/Level setting success

E/OMX-VENC-720p( 1357): get_parameter: OMX_IndexParamVideoProfileLevelQuerySupported for Input port returned Profile:1, Level:2048

E/OMX-VENC-720p( 1357): Profile/Level set equal to 1/2048

E/OMX-VENC-720p( 1357):

E/OMX-VENC-720p( 1357): ERROR: Unsuccessful in updating Profile and level 1, 2048

F/OMXCodec( 1357): frameworks/base/media/libstagefright/OMXCodec.cpp:1919 CHECK_EQ( err,(status_t)OK) failed: -1010 vs. 0

F/libc ( 1357): Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1)

I/DEBUG ( 1340): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***

I/DEBUG ( 1340): Build fingerprint: 'tmous/htc_doubleshot/doubleshot:4.0.3/IML74K/356011.14:user/release-keys'

I/DEBUG ( 1340): pid: 1357, tid: 1361 >>> /system/bin/mediaserver <<<

I/DEBUG ( 1340): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr deadbaad

I/DEBUG ( 1340): r0 deadbaad r1 000bdd00 r2 a0000000 r3 00000000

I/DEBUG ( 1340): r4 00000000 r5 00000027 r6 41964878 r7 4196486c

I/DEBUG ( 1340): r8 00000000 r9 00000000 10 00000007 fp 00000001

I/DEBUG ( 1340): ip 4013315c sp 419643b8 lr 4007c7a9 pc 40078af4 cpsr 60010030

I/DEBUG ( 1340): d0 7473282c72726520 d1 4f29745f73757461

I/DEBUG ( 1340): d2 656c69616620294b d3 303130312d203a64

I/DEBUG ( 1340): d4 702c746867696e2c d5 2c7469617274726f

I/DEBUG ( 1340): d6 6867696c6b636162 d7 7374726f70732c74

I/DEBUG ( 1340): d8 0000000000000000 d9 0000000000000000

I/DEBUG ( 1340): d10 0000000000000000 d11 0000000000000000

I/DEBUG ( 1340): d12 0000000000000000 d13 0000000000000000

I/DEBUG ( 1340): d14 0000000000000000 d15 0000000000000000

I/DEBUG ( 1340): d16 7473282c72726520 d17 4f29745f73757461

I/DEBUG ( 1340): d18 6e61632c73726577 d19 746867696c656c64

I/DEBUG ( 1340): d20 726f77657269662c d21 79747261702c736b

I/DEBUG ( 1340): d22 702d746867696e2c d23 2c7469617274726f

I/DEBUG ( 1340): d24 0000000000000000 d25 0000000000000000

I/DEBUG ( 1340): d26 0000000000000000 d27 0000000000000000

I/DEBUG ( 1340): d28 0000000000000000 d29 0000000000000000

I/DEBUG ( 1340): d30 0000000000000000 d31 0000000000000000

I/DEBUG ( 1340): scr 60000010

I/DEBUG ( 1340):

when you try to go 720p instead it works and this is the output:

I/OMXCodec( 1357): Attempting to allocate OMX node 'OMX.qcom.video.encoder.avc'

E/OMX-VENC-720p( 1357):

E/OMX-VENC-720p( 1357): omx_video(): Inside Constructor()

E/OMX-VENC-720p( 1357):

E/OMX-VENC-720p( 1357): omx_venc(): Inside component_init()

E/OMX-VENC-720p( 1357): bool venc_dev::venc_validate_profile_level(OMX_U32*, OMX_U32*): Returning with eProfile = 1Level = 4

E/OMX-VENC-720p( 1357):

E/OMX-VENC-720p( 1357): bool venc_dev::venc_open(OMX_U32)(): Init Profile/Level setting success

E/OMX-VENC-720p( 1357): vidc.venc.debug.sliceinfo value is 0

E/OMX-VENC-720p( 1357):

E/OMX-VENC-720p( 1357): Component_init return value = 0x0

I/OMXCodec( 1357): Successfully allocated OMX node 'OMX.qcom.video.encoder.avc'

E/OMX-VENC-720p( 1357):

E/OMX-VENC-720p( 1357): WARNING: Requested i/p bufsize[40960],Driver's updated i/p bufsize = 1382400

E/OMX-VENC-720p( 1357): bool venc_dev::venc_validate_profile_level(OMX_U32*, OMX_U32*): Returning with eProfile = 1Level = 512

E/OMX-VENC-720p( 1357):

E/OMX-VENC-720p( 1357): bool venc_dev::venc_set_param(void*, OMX_INDEXTYPE)(): Profile/Level setting success

E/OMX-VENC-720p( 1357): bool venc_dev::venc_validate_profile_level(OMX_U32*, OMX_U32*): Returning with eProfile = 1Level = 1024

E/OMX-VENC-720p( 1357): Calling set level (Framerate) with 19

E/OMX-VENC-720p( 1357): bool venc_dev::venc_validate_profile_level(OMX_U32*, OMX_U32*): Returning with eProfile = 1Level = 1024

E/OMX-VENC-720p( 1357): Calling set level (Bitrate) with 19

E/OMX-VENC-720p( 1357): get_parameter: OMX_IndexParamVideoProfileLevelQuerySupported for Input port returned Profile:1, Level:2048

E/OMX-VENC-720p( 1357): Profile/Level set equal to 1/1024

E/OMX-VENC-720p( 1357): bool venc_dev::venc_validate_profile_level(OMX_U32*, OMX_U32*): Returning with eProfile = 1Level = 1024

E/OMX-VENC-720p( 1357):

E/OMX-VENC-720p( 1357): venc_set_intra_period: nPFrames = 31 nBFrames = 0

E/OMX-VENC-720p( 1357): bool venc_dev::venc_validate_profile_level(OMX_U32*, OMX_U32*): Returning with eProfile = 1Level = 1024

E/OMX-VENC-720p( 1357): Calling set level (Bitrate) with 19

V/AudioHardwareMSM8660( 1357): AudioStreamInMSM72xx::set(1, 16, 48000)

after some digging i found out that basically every phone (soc) has specific video hardware encoding capabilities and that there is a "standard" layer much like Direct3D/OpenGL for that, and is called OpenMAX (OMX).

it seems that omx implementation for every soc is, of course, closed source, but fortunately there is enough open source stuff to be able to use proprietary binary blobs (i may not be correct here, i am making educated guesses taking the info i found as a base)

so what i'm thinking currently is that the libOmxVenc.so that is provided with CM (seems like qualcomm donated/helped with the code) is intentionally limited to 720p max (and probably level 3.2 too, this would explain why the media_profiles.xml setting has no effect) and it just crashes when trying to encode anything >720p

so what i would like to try is take libOmxVenc.so from an ICS sensation stock rom and see if that is capable of encoding 1080p without modifications to the code (unlikely... 50% probability maybe but still worth a try)