Tuesday, April 24, 2012

[SKYPEKIT][DM368][IPNC] H.264 QQVGA Encoding with DM36x

    According to Skypekit Video RTP host requirement, "Skype requires that all video endpoints support 160x120 video (QQVGA) to ensure a minimum level of interoperability." Thus, the first job is to ask DM368 to do QQVGA encoding (in H.264).

It seemed to be an easy job since in UI_setConfig( )@avServerUi.c, we can set
config->encodeConfig[i].cropWidth and
config->encodeConfig[i].cropHeight
to desired resolution and let the framework to do the rest.

However, it's not easy as dummy thought (代誌不是像憨人想的那麼簡單). you will find that the change will result in VIDEO_encodeTskRun error because the alg framework ALG_vidEncRun( )@alg_vidEnc.c returns error with message


CODEC RUN FAIL ERROR CODE: -1 32784 12206
 ERROR  (videoEncodeThr.c|VIDEO_encodeTskRun|292): ALG_vidEncRun()

because of the print statement 

OSA_printf("CODEC RUN FAIL ERROR CODE: %d %d %d\n", status, 264OutArgs.videncOutArgs.extendedError, h264OutArgs.videncOutArgs.bytesGenerated);




the 2nd returned error code (extendedError, 0x8010 in hex)  means IH264VENC_ERR_PROCESS_CALL

It's quite annoyed because there is not other detail information describing this error and the user's guide "H.264 Base/Main/High Profile Encoder on DM365/DM368" doesn't either. Thankfully by searching e2e forum, I found someone had the same problem, in post

DM36x H.264 encoder error 0x8010 at relatively high bitrates+low resolutions

Although it doesn't provide the exact solution, the hint is to reduce desired bitrate, which is a parameter of av_server.out if you are using IPNC platform.

for QQVGA, you can set the bitrate as low as 320k, or even set 0. rather than 5M in original, and the error is gone and I am able to get streamed QQVGA H264 video successfully.

Tuesday, April 10, 2012

[SKYPEKIT][DM368][IPNC] Revised: the Reason of "Account::LOGOUTREASON Unknown:673000" in Tutorials

In  Starting Skypekit on DM368-IPNC - setup environment and build the 1st tutorial example, we discussed  "Account::LOGOUTREASON<Unknown:673000>" problem in end of the article.  There we introduced a workaround to reduce the chance generating this error message.


After digging into skypekit examples a little bit deeper, the root cause *might be* found because improperly trying to get "GetPropLogoutreason", in MyAccount::OnChange@tutorial_common.h.


The original implementation imply that after Account::P_STATUS fired, the Account::LOGOUTREASON has already prepared, which *might* not be true. It can only be sure after Account::P_LOGOUTREASON is fired.


To fix this, try to catch Account::P_LOGOUTREASON at MyAccount::OnChange, Then you are safe to invoke 
this->GetPropLogoutreason for the logout reason.


Note:
Sorry I cannot put the code piece here because of skypekit legal term. but it's easy to patch by yourselves even with even little of experience of skypekit.