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.

Proble managing the AIC31 codec driver with OMAPL138

Other Parts Discussed in Thread: OMAPL138

I am using the OMAPL138 eval board and I have some problems managing the AIC31 codec. I started from the pspdrivers_01_30_00_06 examples and used the provided drivers. All is ok concerning the example. I can configure the AIC31 from the TCI file with the structure “audioAic31Params” and able to send/receive samples with the SIO mechanism.

 

My problem is to control the device dynamically. I try to use the GIO mechanism to send command to the device.

 

First point, I call the GIO_create () command to get an handle like this:

Handle = GIO_create("/aic310", IOM_INOUT, &status, &audioAic31Params, &gioAttrs);

but the handle returned is always NULL. I don’t know why.  

 

Second point, I need to change the volume and the input/output selector. There are available commands (Aic31_AC_IOCTL_SET_VOLUME,  Aic31_AC_IOCTL_SELECT_INPUT_SOURCE) to do this listed in “Aic31.h” and a little documented in “BIOSPSP_AIC3106Codec_Driver_Design.pdf”.

The problem is I can’t find nowhere the parameters definition for Args required for the GIO_control() command.

GIO_control(Handle, Aic31_AC_IOCTL_SET_VOLUME, Args???)

What are the specific Args values for each command?

 

DSP/BIOS 5_41_10_36

pspdrivers_01_30_00_06

Code Generation tool 7.2.0

 

Thanks for your support

Jean 

  • Hi Jean,

    First of all, please use the latest BIOS PSP 1.30.01, which is the latest one. 

    To create any device dynamically, you need to use the BIOS API - DEV_createDevice(), please refer the BIOS user guide for more information. Only after creating the device, it can be openned by GIO_create().

    Thanks and Regards,

    Sandeep K

  • Thanks for your answer Sandeep. I will install the latest PSP.

    I succeed to make GIO_create() ok by modifying slightly the AIC31.c driver. There is a check verifying if the state is CLOSED. If not CLOSED it get out the function. Of course, on static instantiation the state is already OPEN. The rest of software manage properly the case of an already open software. I compare with the UART driver and the UART driver has not this input parameter check. I will check if PSP 1.30 fix this.

    Original code:

     

     

    if ((NULL == instHandle) ||

    (ICodec_DriverState_CREATED != instHandle->devState) ||

     

    (ICodec_DriverState_CLOSED != instHandle->ChanObj[mode-1].chanStatus))

     

    {

     

    / result = IOM_EBADARGS;

     

    }

    replaced by:

     

    if ((NULL == instHandle) ||

     (ICodec_DriverState_CREATED != instHandle->devState))

    {

    result = IOM_EBADARGS;

    }

    And I get a good handle and was able to send GIO_control() command.

    Thanks a lot

    Jean