diff options
author | Eric Laurent <elaurent@google.com> | 2010-10-21 11:49:45 -0700 |
---|---|---|
committer | Eric Laurent <elaurent@google.com> | 2010-10-22 17:39:32 -0700 |
commit | 5f3ccdc426ae00d6caacc33810d373ac2f1a4d50 (patch) | |
tree | 7c41841ca3113b2d947fa2deb83f89b9a908a9f0 | |
parent | 98447ec76f11e15025991d367e48ea052756245e (diff) | |
download | device_samsung_crespo-5f3ccdc426ae00d6caacc33810d373ac2f1a4d50.zip device_samsung_crespo-5f3ccdc426ae00d6caacc33810d373ac2f1a4d50.tar.gz device_samsung_crespo-5f3ccdc426ae00d6caacc33810d373ac2f1a4d50.tar.bz2 |
Fix issue 3119463.
There is no call audio uplink when headphones w/o mic are connected.
This change together with a corresponding change in the kernel driver adds
a separate device for headphonjes without mic: output is routed to headphones
and input is routed from built-in mic.
Change-Id: I19955f76ece19f661ae25d6a42bbcbe235a9e652
-rwxr-xr-x | asound.conf | 271 | ||||
-rwxr-xr-x | libaudio/AudioHardwareALSA.cpp | 4 |
2 files changed, 225 insertions, 50 deletions
diff --git a/asound.conf b/asound.conf index a1c9119..fce98c5 100755 --- a/asound.conf +++ b/asound.conf @@ -1,14 +1,14 @@ # Android ALSA configuration file for the WM8994 audio. -###################################################################################### +################################################################################################################## # -# {name "Playback Path" value 2} # 0:OFF 1:RCV 2:SPK 3:HP 4:BT -# # 5:SPK_HP 6:R_SPK 7:R_HP 8:R_SPK_HP -# {name "Capture MIC Path" value 1} # 0:Main Mic 1:Ear MIC 2:BT MIC -# {name "Voice Call Path" value 1} # 0:OFF 1:RCV 2:SPK 3:HP 4:BT +# {name "Playback Path" value 2} # 0:OFF 1:RCV 2:SPK 3:HP 4:HP_NO_MIC 5:BT +# # 6:SPK_HP 7:R_SPK 8:R_HP 9:R_HP_NO_MIC 9:R_SPK_HP +# {name "Capture MIC Path" value 1} # 0:Main Mic 1:Ear MIC 2:BT MIC +# {name "Voice Call Path" value 1} # 0:OFF 1:RCV 2:SPK 3:HP 4:HP_NO_MIC 5:BT # -###################################################################################### +################################################################################################################## ## @@ -56,7 +56,7 @@ pcm.AndroidPlayback_Earpiece { type ctl_elems hook_args [ # Enable audio output from the DSP - {name "Voice Call Path" value 1} # 0:OFF 1:RCV 2:SPK 3:HP 4:BT + {name "Voice Call Path" value 1} # 0:OFF 1:RCV 2:SPK 3:HP 4:HP_NO_MIC 5:BT ] } } @@ -72,8 +72,8 @@ pcm.AndroidPlayback_Speaker { type ctl_elems hook_args [ # Enable audio output from the DSP - {name "Playback Path" value 2} # 0:OFF 1:RCV 2:SPK 3:HP 4:BT - # 5:SPK_HP 6:R_SPK 7:R_HP 8:R_SPK_HP + {name "Playback Path" value 2} # 0:OFF 1:RCV 2:SPK 3:HP 4:HP_NO_MIC 5:BT + # 6:SPK_HP 7:R_SPK 8:R_HP 9:R_HP_NO_MIC 10:R_SPK_HP ] } } @@ -89,8 +89,25 @@ pcm.AndroidPlayback_Headset { type ctl_elems hook_args [ # Enable audio output from the DSP - {name "Playback Path" value 3} # 0:OFF 1:RCV 2:SPK 3:HP 4:BT - # 5:SPK_HP 6:R_SPK 7:R_HP 8:R_SPK_HP + {name "Playback Path" value 3} # 0:OFF 1:RCV 2:SPK 3:HP 4:HP_NO_MIC 5:BT + # 6:SPK_HP 7:R_SPK 8:R_HP 9:R_HP_NO_MIC 10:R_SPK_HP + ] + } +} + +pcm.AndroidPlayback_Headphone { + type hooks + slave.pcm { + type hw + card 0 + device 0 # Must be of type "digital audio playback" + } + hooks.0 { + type ctl_elems + hook_args [ + # Enable audio output from the DSP + {name "Playback Path" value 4} # 0:OFF 1:RCV 2:SPK 3:HP 4:HP_NO_MIC 5:BT + # 6:SPK_HP 7:R_SPK 8:R_HP 9:R_HP_NO_MIC 10:R_SPK_HP ] } } @@ -106,8 +123,8 @@ pcm.AndroidPlayback_Bluetooth { type ctl_elems hook_args [ # Enable audio output from the DSP - {name "Playback Path" value 4} # 0:OFF 1:RCV 2:SPK 3:HP 4:BT - # 5:SPK_HP 6:R_SPK 7:R_HP 8:R_SPK_HP + {name "Playback Path" value 5} # 0:OFF 1:RCV 2:SPK 3:HP 4:HP_NO_MIC 5:BT + # 6:SPK_HP 7:R_SPK 8:R_HP 9:R_HP_NO_MIC 10:R_SPK_HP ] } } @@ -123,8 +140,8 @@ pcm.AndroidPlayback_Earpiece_normal { type ctl_elems hook_args [ # Enable audio output from the DSP - {name "Playback Path" value 1} # 0:OFF 1:RCV 2:SPK 3:HP 4:BT - # 5:SPK_HP 6:R_SPK 7:R_HP 8:R_SPK_HP + {name "Playback Path" value 1} # 0:OFF 1:RCV 2:SPK 3:HP 4:HP_NO_MIC 5:BT + # 6:SPK_HP 7:R_SPK 8:R_HP 9:R_HP_NO_MIC 10:R_SPK_HP ] } } @@ -140,8 +157,8 @@ pcm.AndroidPlayback_Speaker_normal { type ctl_elems hook_args [ # Enable audio output from the DSP - {name "Playback Path" value 2} # 0:OFF 1:RCV 2:SPK 3:HP 4:BT - # 5:SPK_HP 6:R_SPK 7:R_HP 8:R_SPK_HP + {name "Playback Path" value 2} # 0:OFF 1:RCV 2:SPK 3:HP 4:HP_NO_MIC 5:BT + # 6:SPK_HP 7:R_SPK 8:R_HP 9:R_HP_NO_MIC 10:R_SPK_HP ] } } @@ -157,8 +174,25 @@ pcm.AndroidPlayback_Headset_normal { type ctl_elems hook_args [ # Enable audio output from the DSP - {name "Playback Path" value 3} # 0:OFF 1:RCV 2:SPK 3:HP 4:BT - # 5:SPK_HP 6:R_SPK 7:R_HP 8:R_SPK_HP + {name "Playback Path" value 3} # 0:OFF 1:RCV 2:SPK 3:HP 4:HP_NO_MIC 5:BT + # 6:SPK_HP 7:R_SPK 8:R_HP 9:R_HP_NO_MIC 10:R_SPK_HP + ] + } +} + +pcm.AndroidPlayback_Headphone_normal { + type hooks + slave.pcm { + type hw + card 0 + device 0 # Must be of type "digital audio playback" + } + hooks.0 { + type ctl_elems + hook_args [ + # Enable audio output from the DSP + {name "Playback Path" value 4} # 0:OFF 1:RCV 2:SPK 3:HP 4:HP_NO_MIC 5:BT + # 6:SPK_HP 7:R_SPK 8:R_HP 9:R_HP_NO_MIC 10:R_SPK_HP ] } } @@ -174,8 +208,8 @@ pcm.AndroidPlayback_Bluetooth_normal { type ctl_elems hook_args [ # Enable audio output from the DSP - {name "Playback Path" value 4} # 0:OFF 1:RCV 2:SPK 3:HP 4:BT - # 5:SPK_HP 6:R_SPK 7:R_HP 8:R_SPK_HP + {name "Playback Path" value 5} # 0:OFF 1:RCV 2:SPK 3:HP 4:HP_NO_MIC 5:BT + # 6:SPK_HP 7:R_SPK 8:R_HP 9:R_HP_NO_MIC 10:R_SPK_HP ] } } @@ -191,8 +225,25 @@ pcm.AndroidPlayback_Speaker_Headset_normal { type ctl_elems hook_args [ # Enable audio output from the DSP - {name "Playback Path" value 5} # 0:OFF 1:RCV 2:SPK 3:HP 4:BT - # 5:SPK_HP 6:R_SPK 7:R_HP 8:R_SPK_HP + {name "Playback Path" value 6} # 0:OFF 1:RCV 2:SPK 3:HP 4:HP_NO_MIC 5:BT + # 6:SPK_HP 7:R_SPK 8:R_HP 9:R_HP_NO_MIC 10:R_SPK_HP + ] + } +} + +pcm.AndroidPlayback_Speaker_Headphone_normal { + type hooks + slave.pcm { + type hw + card 0 + device 0 # Must be of type "digital audio playback" + } + hooks.0 { + type ctl_elems + hook_args [ + # Enable audio output from the DSP + {name "Playback Path" value 6} # 0:OFF 1:RCV 2:SPK 3:HP 4:HP_NO_MIC 5:BT + # 6:SPK_HP 7:R_SPK 8:R_HP 9:R_HP_NO_MIC 10:R_SPK_HP ] } } @@ -208,8 +259,8 @@ pcm.AndroidPlayback_Earpiece_ringtone { type ctl_elems hook_args [ # Enable audio output from the DSP - {name "Playback Path" value 6} # 0:OFF 1:RCV 2:SPK 3:HP 4:BT - # 5:SPK_HP 6:R_SPK 7:R_HP 8:R_SPK_HP + {name "Playback Path" value 7} # 0:OFF 1:RCV 2:SPK 3:HP 4:HP_NO_MIC 5:BT + # 6:SPK_HP 7:R_SPK 8:R_HP 9:R_HP_NO_MIC 10:R_SPK_HP ] } } @@ -225,8 +276,8 @@ pcm.AndroidPlayback_Speaker_ringtone { type ctl_elems hook_args [ # Enable audio output from the DSP - {name "Playback Path" value 6} # 0:OFF 1:RCV 2:SPK 3:HP 4:BT - # 5:SPK_HP 6:R_SPK 7:R_HP 8:R_SPK_HP + {name "Playback Path" value 7} # 0:OFF 1:RCV 2:SPK 3:HP 4:HP_NO_MIC 5:BT + # 6:SPK_HP 7:R_SPK 8:R_HP 9:R_HP_NO_MIC 10:R_SPK_HP ] } } @@ -242,8 +293,25 @@ pcm.AndroidPlayback_Headset_ringtone { type ctl_elems hook_args [ # Enable audio output from the DSP - {name "Playback Path" value 7} # 0:OFF 1:RCV 2:SPK 3:HP 4:BT - # 5:SPK_HP 6:R_SPK 7:R_HP 8:R_SPK_HP + {name "Playback Path" value 8} # 0:OFF 1:RCV 2:SPK 3:HP 4:HP_NO_MIC 5:BT + # 6:SPK_HP 7:R_SPK 8:R_HP 9:R_HP_NO_MIC 10:R_SPK_HP + ] + } +} + +pcm.AndroidPlayback_Headphone_ringtone { + type hooks + slave.pcm { + type hw + card 0 + device 0 # Must be of type "digital audio playback" + } + hooks.0 { + type ctl_elems + hook_args [ + # Enable audio output from the DSP + {name "Playback Path" value 9} # 0:OFF 1:RCV 2:SPK 3:HP 4:HP_NO_MIC 5:BT + # 6:SPK_HP 7:R_SPK 8:R_HP 9:R_HP_NO_MIC 10:R_SPK_HP ] } } @@ -259,8 +327,8 @@ pcm.AndroidPlayback_Bluetooth_ringtone { type ctl_elems hook_args [ # Enable audio output from the DSP - {name "Playback Path" value 4} # 0:OFF 1:RCV 2:SPK 3:HP 4:BT - # 5:SPK_HP 6:R_SPK 7:R_HP 8:R_SPK_HP + {name "Playback Path" value 5} # 0:OFF 1:RCV 2:SPK 3:HP 4:HP_NO_MIC 5:BT + # 6:SPK_HP 7:R_SPK 8:R_HP 9:R_HP_NO_MIC 10:R_SPK_HP ] } } @@ -276,8 +344,25 @@ pcm.AndroidPlayback_Speaker_Headset_ringtone { type ctl_elems hook_args [ # Enable audio output from the DSP - {name "Playback Path" value 8} # 0:OFF 1:RCV 2:SPK 3:HP 4:BT - # 5:SPK_HP 6:R_SPK 7:R_HP 8:R_SPK_HP + {name "Playback Path" value 10} # 0:OFF 1:RCV 2:SPK 3:HP 4:HP_NO_MIC 5:BT + # 6:SPK_HP 7:R_SPK 8:R_HP 9:R_HP_NO_MIC 10:R_SPK_HP + ] + } +} + +pcm.AndroidPlayback_Speaker_Headphone_ringtone { + type hooks + slave.pcm { + type hw + card 0 + device 0 # Must be of type "digital audio playback" + } + hooks.0 { + type ctl_elems + hook_args [ + # Enable audio output from the DSP + {name "Playback Path" value 10} # 0:OFF 1:RCV 2:SPK 3:HP 4:HP_NO_MIC 5:BT + # 6:SPK_HP 7:R_SPK 8:R_HP 9:R_HP_NO_MIC 10:R_SPK_HP ] } } @@ -293,8 +378,7 @@ pcm.AndroidPlayback_Earpiece_incall { type ctl_elems hook_args [ # Enable audio output from the DSP - {name "Voice Call Path" value 1} # 0:OFF 1:RCV 2:SPK - # 3:HP 4:BT + {name "Voice Call Path" value 1} # 0:OFF 1:RCV 2:SPK 3:HP 4:HP_NO_MIC 5:BT ] } } @@ -310,8 +394,7 @@ pcm.AndroidPlayback_Speaker_incall { type ctl_elems hook_args [ # Enable audio output from the DSP - {name "Voice Call Path" value 2} # 0:OFF 1:RCV 2:SPK - # 3:HP 4:BT + {name "Voice Call Path" value 2} # 0:OFF 1:RCV 2:SPK 3:HP 4:HP_NO_MIC 5:BT ] } } @@ -327,8 +410,23 @@ pcm.AndroidPlayback_Headset_incall { type ctl_elems hook_args [ # Enable audio output from the DSP - {name "Voice Call Path" value 3} # 0:OFF 1:RCV 2:SPK - # 3:HP 4:BT + {name "Voice Call Path" value 3} # 0:OFF 1:RCV 2:SPK 3:HP 4:HP_NO_MIC 5:BT + ] + } +} + +pcm.AndroidPlayback_Headphone_incall { + type hooks + slave.pcm { + type hw + card 0 + device 0 # Must be of type "digital audio playback" + } + hooks.0 { + type ctl_elems + hook_args [ + # Enable audio output from the DSP + {name "Voice Call Path" value 4} # 0:OFF 1:RCV 2:SPK 3:HP 4:HP_NO_MIC 5:BT ] } } @@ -344,8 +442,7 @@ pcm.AndroidPlayback_Bluetooth_incall { type ctl_elems hook_args [ # Enable audio output from the DSP - {name "Voice Call Path" value 4} # 0:OFF 1:RCV 2:SPK - # 3:HP 4:BT + {name "Voice Call Path" value 5} # 0:OFF 1:RCV 2:SPK 3:HP 4:HP_NO_MIC 5:BT ] } } @@ -361,8 +458,23 @@ pcm.AndroidPlayback_Speaker_Headset_incall { type ctl_elems hook_args [ # Enable audio output from the DSP - {name "Voice Call Path" value 2} # 0:OFF 1:RCV 2:SPK - # 3:HP 4:BT + {name "Voice Call Path" value 2} # 0:OFF 1:RCV 2:SPK 3:HP 4:HP_NO_MIC 5:BT + ] + } +} + +pcm.AndroidPlayback_Speaker_Headphone_incall { + type hooks + slave.pcm { + type hw + card 0 + device 0 # Must be of type "digital audio playback" + } + hooks.0 { + type ctl_elems + hook_args [ + # Enable audio output from the DSP + {name "Voice Call Path" value 2} # 0:OFF 1:RCV 2:SPK 3:HP 4:HP_NO_MIC 5:BT ] } } @@ -427,6 +539,17 @@ pcm.AndroidRecord_Headset_normal { } } +pcm.AndroidRecord_Headphone_normal { + type hooks + slave.pcm default + hooks.0 { + type ctl_elems + hook_args [ + {name "Capture MIC Path" value 0} # 0:Main Mic 1:Ear MIC 2:BT MIC + ] + } +} + pcm.AndroidRecord_Bluetooth_normal { type hooks slave.pcm { @@ -453,6 +576,17 @@ pcm.AndroidRecord_Speaker_Headset_normal { } } +pcm.AndroidRecord_Speaker_Headphone_normal { + type hooks + slave.pcm default + hooks.0 { + type ctl_elems + hook_args [ + {name "Capture MIC Path" value 0} # 0:Main Mic 1:Ear MIC 2:BT MIC + ] + } +} + pcm.AndroidRecord_Speaker_ringtone { type hooks slave.pcm { @@ -463,8 +597,8 @@ pcm.AndroidRecord_Speaker_ringtone { hooks.0 { type ctl_elems hook_args [ - {name "Playback Path" value 2} # 0:OFF 1:RCV 2:SPK 3:HP 4:BT - # 5:SPK_HP 6:R_SPK 7:R_HP 8:R_SPK_HP + {name "Playback Path" value 2} # 0:OFF 1:RCV 2:SPK 3:HP 4:HP_NO_MIC 5:BT + # 6:SPK_HP 7:R_SPK 8:R_HP 9:R_HP_NO_MIC 10:R_SPK_HP ] } } @@ -479,8 +613,24 @@ pcm.AndroidRecord_Headset_ringtone { hooks.0 { type ctl_elems hook_args [ - {name "Playback Path" value 3} # 0:OFF 1:RCV 2:SPK 3:HP 4:BT - # 5:SPK_HP 6:R_SPK 7:R_HP 8:R_SPK_HP + {name "Playback Path" value 3} # 0:OFF 1:RCV 2:SPK 3:HP 4:HP_NO_MIC 5:BT + # 6:SPK_HP 7:R_SPK 8:R_HP 9:R_HP_NO_MIC 10:R_SPK_HP + ] + } +} + +pcm.AndroidRecord_Headphone_ringtone { + type hooks + slave.pcm { + type hw + card 0 + device 0 # Must be of type "digital audio capture" + } + hooks.0 { + type ctl_elems + hook_args [ + {name "Playback Path" value 4} # 0:OFF 1:RCV 2:SPK 3:HP 4:HP_NO_MIC 5:BT + # 6:SPK_HP 7:R_SPK 8:R_HP 9:R_HP_NO_MIC 10:R_SPK_HP ] } } @@ -521,6 +671,18 @@ pcm.AndroidRecord_Headset_incall { } } +pcm.AndroidRecord_Headphone_incall { + type hooks + slave.pcm default + hooks.0 { + type ctl_elems + hook_args [ + # Enable audio output from the DSP + {name "Capture MIC Path" value 0} # 0:Main Mic 1:Ear MIC 2:BT MIC + ] + } +} + pcm.AndroidRecord_Bluetooth_incall { type hooks slave.pcm default @@ -541,7 +703,20 @@ pcm.AndroidRecord_Speaker_Headset_incall { hook_args [ # Enable audio output from the DSP {name "Capture MIC Path" value 1} # 0:Main Mic 1:Ear MIC 2:BT MIC - {name "Voice Call Path" value 3} # 0:OFF 1:RCV 2:SPK 3:HP 4:BT + {name "Voice Call Path" value 3} # 0:OFF 1:RCV 2:SPK 3:HP 4:HP_NO_MIC 5:BT + ] + } +} + +pcm.AndroidRecord_Speaker_Headphone_incall { + type hooks + slave.pcm default + hooks.0 { + type ctl_elems + hook_args [ + # Enable audio output from the DSP + {name "Capture MIC Path" value 0} # 0:Main Mic 1:Ear MIC 2:BT MIC + {name "Voice Call Path" value 4} # 0:OFF 1:RCV 2:SPK 3:HP 4:HP_NO_MIC 5:BT ] } } diff --git a/libaudio/AudioHardwareALSA.cpp b/libaudio/AudioHardwareALSA.cpp index db2a767..45223f3 100755 --- a/libaudio/AudioHardwareALSA.cpp +++ b/libaudio/AudioHardwareALSA.cpp @@ -118,7 +118,7 @@ static const char *deviceSuffix[] = { /* ROUTE_EARPIECE */ "_Earpiece", /* ROUTE_SPEAKER */ "_Speaker", /* ROUTE_HEADSET */ "_Headset", - /* ROUTE_HEADPHONE */ "_Headset", + /* ROUTE_HEADPHONE */ "_Headphone", /* ROUTE_BLUETOOTH_SCO */ "_Bluetooth", /* ROUTE_BLUETOOTH_SCO_HEADSET */ "_Bluetooth", /* ROUTE_BLUETOOTH_SCO_CARKIT */ "_Bluetooth", //"_Bluetooth_Carkit" @@ -333,7 +333,6 @@ status_t AudioHardwareALSA::setVoiceVolume(float volume) LOGI("### route(%d) call volume(%f)", routes, volume); switch (routes) { case AudioSystem::ROUTE_EARPIECE: - case AudioSystem::ROUTE_HEADPHONE: // Use receive path with 3 pole headset. LOGI("### earpiece call volume"); setCallVolume(mRilClient, SOUND_TYPE_VOICE, int_volume); break; @@ -352,6 +351,7 @@ status_t AudioHardwareALSA::setVoiceVolume(float volume) break; case AudioSystem::ROUTE_HEADSET: + case AudioSystem::ROUTE_HEADPHONE: // Use receive path with 3 pole headset. LOGI("### headset call volume"); setCallVolume(mRilClient, SOUND_TYPE_HEADSET, int_volume); break; |