Kitkat: A2DP playback no sound

106 views
Skip to first unread message

Uday Gupta

unread,
Apr 14, 2014, 7:10:24 PM4/14/14
to android...@googlegroups.com
Hi,

On our development platform on KK, A2DP playback has no sound. Data dump in the A2DP HAL shows all zeros.

Enabling and adding some logs in AudioFlinger.cpp and threads.cpp shows the master volume as -0.000002.

Has sometime changed in KK compared to JB and some configuration parameters need to be set to set the master volume to 1.0f.

Thanks

Glenn Kasten

unread,
Apr 15, 2014, 10:39:35 AM4/15/14
to android...@googlegroups.com
This seems like an uninitialized value, not a valid value.

I suggest that you find a known working reference device
(e.g. Nexus family) running the same OS version, and then
start comparing logs, volumes at various places etc., to
see where the difference first appears in the pipeline.

Uday Gupta

unread,
Apr 15, 2014, 12:54:19 PM4/15/14
to android...@googlegroups.com
Thanks for the hint. Our primary audio HAL implemented a get_master_volume function but did not update the volume value and thus the uninitialized value. We don't do volume control in the HAL so removed it now and everything is working now.

Uday Gupta

unread,
Apr 15, 2014, 1:11:14 PM4/15/14
to android...@googlegroups.com
One issue though. Looks like if one audio HAL implements master volume control then audio flinger expects all other HAL's to do the same as there is only one mMasterVolume in audio flinger. Is my understanding correct?

Eric Laurent

unread,
Apr 16, 2014, 12:15:09 PM4/16/14
to android...@googlegroups.com
This is not what is implemented. There is indeed one single master volume shared by all HALs. But if one HAL does not implement it, then it will fall back to software master volume.

Uday Gupta

unread,
Apr 16, 2014, 2:38:06 PM4/16/14
to android...@googlegroups.com
In my case on KK below is what happened..

1. primary audio HAL did a stub implementation for get_master_volume but did not update the master volume so mastervolume got set to an uninitialized value
            if (NULL != dev->get_master_volume) {
                float mv;   // Uninitialized
                if (OK == dev->get_master_volume(dev, &mv)) {
                    mMasterVolume = mv;
                }
            }

2. A2DP HAL does not implement any support for mater volume. So the mastervolume set in 1 above to some uninitialized value gets sent to the A2DP mixer thread for SW master volume control.

Is above the intended implementation.
Reply all
Reply to author
Forward
0 new messages