A2DP sink volume cap
Posted: Mon Dec 19, 2022 11:09 am
ESP32 Wrover-E
IDF 4.4
ADF 2.4
Hi,
i've set up an A2DP sink (https://github.com/espressif/esp-adf/bl ... _example.c) and modified it.
I can play music via bluetooth and the remote control also works well.
However i have difficulties getting the volume control to work properly.
I can change the volume value from the ESP and receive it properly on the device.
(If i set f.e. 50% on the device, the ESP gets the info "50%")
(If i set f.e. 50% on the ESP, the device also gets the info "50%" and shows it)
So i guess the root of my problem is not where i send the volume commands as they seem to work fine.
If i look at the PCM data received via bluetooth i noticed the problem: It seems like the volume of the PCM signal caps at about 40%.
I created a .mp3 file with an 1kHz sine wave and amplitude 1 (max. amplitude).
As the ESP32 defaults to 16bit PCM, the absolute min and max of the signal should be about -32000 and 32000 (not exactly).
My problem is, that if i set the volume value to 40% or above, the peak of the sine wave always reaches the min and max.
So it doesn't change for volume values between 40% and 100%.
The control works ok'ish in the range from 0% to 40%... At least the signal amplitude is changing.
It acts like the whole range from 0% to 100% is scaled down to 0% to 40%.
If i connect a device that doesn't support the remote control features, the volume range is fine.
Am i doing something wrong in general or am I missing something?
Thank you in advance!
IDF 4.4
ADF 2.4
Hi,
i've set up an A2DP sink (https://github.com/espressif/esp-adf/bl ... _example.c) and modified it.
I can play music via bluetooth and the remote control also works well.
However i have difficulties getting the volume control to work properly.
I can change the volume value from the ESP and receive it properly on the device.
(If i set f.e. 50% on the device, the ESP gets the info "50%")
(If i set f.e. 50% on the ESP, the device also gets the info "50%" and shows it)
So i guess the root of my problem is not where i send the volume commands as they seem to work fine.
If i look at the PCM data received via bluetooth i noticed the problem: It seems like the volume of the PCM signal caps at about 40%.
I created a .mp3 file with an 1kHz sine wave and amplitude 1 (max. amplitude).
As the ESP32 defaults to 16bit PCM, the absolute min and max of the signal should be about -32000 and 32000 (not exactly).
My problem is, that if i set the volume value to 40% or above, the peak of the sine wave always reaches the min and max.
So it doesn't change for volume values between 40% and 100%.
The control works ok'ish in the range from 0% to 40%... At least the signal amplitude is changing.
It acts like the whole range from 0% to 100% is scaled down to 0% to 40%.
If i connect a device that doesn't support the remote control features, the volume range is fine.
Am i doing something wrong in general or am I missing something?
Thank you in advance!