cancel
Showing results for 
Search instead for 
Did you mean: 

Output gain set is omitted in WM8904_Init()

ERROR
Senior

Hi,

// WM8904.c
int32_t WM8904_Init(WM8904_Object_t *pObj, WM8904_Init_t *pInit)
  // ...
  if ((WM8904_CurrentDevices & WM8904_OUT_HEADPHONE) == WM8904_OUT_HEADPHONE)
  {
    ret += WM8904_SetVolume(pObj, VOLUME_OUTPUT, (uint8_t)pInit->Volume);
  }

  // ...
  
  /* Store current devices */
  WM8904_CurrentDevices = (pInit->OutputDevice | pInit->InputDevice);

 in line 4, WM8904_CurrentDevices is still 0, so the gain is not set.

I'd change the line this way:

  if ((pInit->OutputDevice & WM8904_OUT_HEADPHONE) == WM8904_OUT_HEADPHONE)
  {
    ret += WM8904_SetVolume(pObj, VOLUME_OUTPUT, (uint8_t)pInit->Volume);
  }

 

1 ACCEPTED SOLUTION

Accepted Solutions
Saket_Om
ST Employee

Hello @ERROR 

The issue has been solved and released on Github. Please check the link below:

STMicroelectronics/stm32-wm8904 at 195857c3b70fc582fc534df5c8e5d3b2a1c40bb4

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
Saket_Om

View solution in original post

2 REPLIES 2
Saket_Om
ST Employee

Hello @ERROR 

Thank you for bringing this issue to our attention.

I reported this internally.

Internal ticket number: 225790 (This is an internal tracking number and is not accessible or usable by customers).

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
Saket_Om
Saket_Om
ST Employee

Hello @ERROR 

The issue has been solved and released on Github. Please check the link below:

STMicroelectronics/stm32-wm8904 at 195857c3b70fc582fc534df5c8e5d3b2a1c40bb4

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
Saket_Om