6/22/2012

How to enable Analog audio over HS USB port on Qualcomm Android?

Q) could you provide the details about FEATURE_HS_USB_ANALOG_AUDIO? (Or)

Q) How to enable Analog audio over HS USB port?



Ans) If OEM enabled HS-USB feature "FEATURE_HS_USB_ANALOG_AUDIO" in the build, it will provide anhsu_analog_audio_config() API(in Hsu_analog_audio.c file) for switching between the normal USB mode(for data transmission) and one of the supported Analog Audio configurations. When switching to Analog audio mode USB PHY will be disconnected from D+/D- and ID lines and enter Low Power mode.



In the Analog Audio mode, audio can be routed in one of the following ways:


Please look in to hsu_analog_audio_config_phy_to_mode() function(in Hsu_analog_audio.c)for all the supported modes.


Stereo speaker : Left speaker D-, Right speaker D+( HSU_AUDIO_MODE_STEREO_SPK).

Stereo speaker & Mic : Left speaker D-, Right speaker D+, Mic over ID(HSU_AUDIO_MODE_STEREO_SPK_MIC).

Mono speaker : Left speaker D-, Right speaker D+( HSU_AUDIO_MODE_MONO_SPK).

Mono speaker & Mic : Speaker D-, Mic D+( HSU_AUDIO_MODE_MONO_SPK_MIC).



If OEM switch HS USB mode for normal USB operation from analog audio, the USB PHY will be reconnected.



OEM can add their code in below API for USB headset detection:

otg_notify_b_peripheral_state_transition_cb ( otg_appctx_t appctx ) in Hsu_otg_app.c file

The above callback is called by the USB stack when Vbus raised above B-Device Session Valid threshold, OEM can add their code to check headset detection and to switch analog audio mode.



Note: For electrical specification and software register settings OEM's can refer to doc 80-VM151-11.

No comments:

Post a Comment