This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TDA3XEVM: Vision SDK3.2: How can I change the reference channel of the AEWB on-the-fly?

Part Number: TDA3XEVM

Hi,

I'm trying to switch the AEWB's reference camera channel of a four camera system. As I found only how set this  channel at creation time, I tried to set the chId by implementing a new control command by doing a call like this:

And in issAewb1Link_algPlugin.h I added:

typedef struct
{
  AlgorithmLink_ControlParams baseClassControl;
  /**< Base class control params */
  UInt32 chId;
  /**< Auto Exposure Channel */
} AlgorithmLink_IssAewbChId;


In my display function I added:


static Void switchAewbChannel(chains_xxx_DisplayAppObj *pObj, UInt32 chNum)
{
  Int32 status;
  static AlgorithmLink_IssAewbChId gActAewbChannel={.chId=0};
  gActAewbChannel.chId =chNum;
  gActAewbChannel.baseClassControl.size=sizeof(gActAewbChannel);
  status = System_linkControl(pObj->ucObj.Alg_IssAewbLinkID,
    ALGORITHM_AEWB_LINK_CMD_SET_AEWB_CAMID,
    &gActAewbChannel,
    sizeof(gActAewbChannel),
    TRUE);
  UTILS_assert(SYSTEM_LINK_STATUS_SOK == status);
}

And in issAewb1Link_algPlugin.c I added in function

Int32 AlgorithmLink_issAewb1Control(void *pObj, void *pControlParams):


switch(pAlgLinkControlPrm->controlCmd)

{
  case ALGORITHM_AEWB_LINK_CMD_SET_AEWB_CAMID:
  {
    AlgorithmLink_IssAewbChId *cp=(AlgorithmLink_IssAewbChId *)pControlParams;
    if(cp->chId<ISS_AEWB1_LINK_MAX_CH)
    {
      pAlgObj->algLinkCreateParams.chId=cp->chId;

      status = SYSTEM_LINK_STATUS_SOK;
    }
    else
    {
      status = SYSTEM_LINK_STATUS_EINVALID_PARAMS;
    }
    break;

(...)

As I did not succeed to transfer the simple parameter (What do I make wrong ???), I tried to set with a fixed value to see if it would work, when the paramter passing problem has been solved. But also this did not work. Isn't there a way to switch the AEWB reference channel on-the-fly?

Regards,

Guenter

  • Hi Guenter,

    I have forwarded your question to ISS experts.

    Regards,
    Yordan
  • Hi Guenter,

    When the AEWB is configured, at the create time, to run only for one channel, it will run for that channel only. The reason for this is, at create time, the output buffers are allocated and enqueued to this channel's queue only (putEmptyBuffer). At the process time, when link tries to get the free output buffer (getEmptyBuffer). it would return error as there are not frames enqueude for the new channel..

    Regards,
    Brijesh
  • Hi Brijesh,

    thanks for your answer even my problem cannot be solved with the software's restriction in the way I planned to do. But maybe you can give me an answer to the remaing question, why the parameter has not been passed to the AEWB algo in my code shown above.

    The problem is now, that the surround system uses only one camera (e.g. the front cam) to make a propper photoalignemt. But if I want to switch quickly to only the rearview (by using gates), I cannot accept, that the rearview's exposure will be controlled by using the front camera's data. The same problem happens with the sideviews etc.

    Because the current system will not comply to our customer's requirements, if I cannot switch the camera's reference AEWB channel, I'm planning to modify the AEWB in that way, that the statistical data of every camera will be fetched (That means I will set "UcObj-"Alg_IssAewbPrm.runAewbOnlyForOneCh = FALSE;").

    Than I will switch, which set of the statistical data will be used for the algo itself and send this back to every sensor as broadcast or - depending on the chosen views - I will peform the AEWB for every camera individually.

    Now, I set as first try, the runAewbOnlyForOneCh to false with the result, that the system does not work at all. Might it be, that this mode is currently not supported?

    Regards,

    Guenter

  • Hi Guenter,

    The problem is wrong control command used in the code. I am pasting below a sample code to send control command to algorithm link. Essentially, we need to set the actual control command in the baseClass and in the linkControl, we need to use Algoruthm_link_cmd_config command..

    dccCtrlPrms.baseClassControl.controlCmd = ALGORITHM_AEWB_LINK_CMD_GET_DCC_BUF_PARAMS;

    dccCtrlPrms.baseClassControl.size = sizeof(dccCtrlPrms);

    dccCtrlPrms.dccBuf = NULL;

    status = System_linkControl(linkId, ALGORITHM_LINK_CMD_CONFIG, &dccCtrlPrms, sizeof(dccCtrlPrms), TRUE);

    Yes, setting this flag to FALSE will make AEWB to run for all channels, it will allocate buffers for all channels and run AEWB algortithm for all channels. Now you could change the plugin code to run it for the selected channel and that selected channel can be changed using this control command.. 

    Regards,

    Brijesh

  • Hi Brijesh,

    thank you for your answer. This solved the partitial problem concerning Algorithm-Link parameter problem.

    Regards,

    Guenter

  • Hi Guenter,

    i did not get, are you also facing some other problem?

    Rgds,

    Brijesh