2026-01-22 11:54 PM
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);
}
Solved! Go to Solution.
2026-01-23 7:03 AM - edited 2026-01-23 7:21 AM
Hello @ERROR
The issue has been solved and released on Github. Please check the link below:
STMicroelectronics/stm32-wm8904 at 195857c3b70fc582fc534df5c8e5d3b2a1c40bb4
2026-01-23 2:50 AM
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).
2026-01-23 7:03 AM - edited 2026-01-23 7:21 AM
Hello @ERROR
The issue has been solved and released on Github. Please check the link below:
STMicroelectronics/stm32-wm8904 at 195857c3b70fc582fc534df5c8e5d3b2a1c40bb4