Browse Source

Car dock analog audio support (fixes CYAN-40 on i9100).

Change-Id: Ie1b26cc1d67ada9c1d639dc6fc6f69fd7504707a
replicant-6.0
David Čížek 5 years ago
parent
commit
e3591e7a64
4 changed files with 65 additions and 1 deletions
  1. +1
    -1
      configs/audio_policy.conf
  2. +10
    -0
      configs/tinyalsa-audio.xml
  3. +4
    -0
      overlay/frameworks/base/core/res/res/values/config.xml
  4. +50
    -0
      yamaha-mc1n2-audio/device/galaxys2.c

+ 1
- 1
configs/audio_policy.conf View File

@@ -26,7 +26,7 @@ audio_hw_modules {
sampling_rates 44100
channel_masks AUDIO_CHANNEL_OUT_STEREO
formats AUDIO_FORMAT_PCM_16_BIT
devices AUDIO_DEVICE_OUT_EARPIECE|AUDIO_DEVICE_OUT_SPEAKER|AUDIO_DEVICE_OUT_WIRED_HEADSET|AUDIO_DEVICE_OUT_WIRED_HEADPHONE|AUDIO_DEVICE_OUT_ALL_SCO|AUDIO_DEVICE_OUT_AUX_DIGITAL|AUDIO_DEVICE_OUT_DGTL_DOCK_HEADSET
devices AUDIO_DEVICE_OUT_EARPIECE|AUDIO_DEVICE_OUT_SPEAKER|AUDIO_DEVICE_OUT_WIRED_HEADSET|AUDIO_DEVICE_OUT_WIRED_HEADPHONE|AUDIO_DEVICE_OUT_ALL_SCO|AUDIO_DEVICE_OUT_AUX_DIGITAL|AUDIO_DEVICE_OUT_DGTL_DOCK_HEADSET|AUDIO_DEVICE_OUT_ANLG_DOCK_HEADSET
flags AUDIO_OUTPUT_FLAG_PRIMARY
}
# deep_buffer {


+ 10
- 0
configs/tinyalsa-audio.xml View File

@@ -79,6 +79,16 @@
<ctrl name="Headphone Playback Switch" value="off" />
</path>
</device>
<device type="analog-dock-headset">
<path type="enable">
<ctrl name="Line 1 Playback Volume" value="31" />
<ctrl name="Line 1 Playback Switch" value="on" />
</path>
<path type="disable">
<ctrl name="Line 1 Playback Volume" value="0" />
<ctrl name="Line 1 Playback Switch" value="off" />
</path>
</device>
</output>

<input card="0" device="0"


+ 4
- 0
overlay/frameworks/base/core/res/res/values/config.xml View File

@@ -163,4 +163,8 @@

<!-- Device supports LED flashlight -->
<bool name="config_enableTorch">true</bool>

<!-- Control whether a car dock event should override the default bluetooth
audio routing, FORCE_BT_CAR_DOCK, with an analog dock, FORCE_ANALOG_DOCK. -->
<bool name="config_forceAnalogCarDock">true</bool>
</resources>

+ 50
- 0
yamaha-mc1n2-audio/device/galaxys2.c View File

@@ -472,6 +472,56 @@ struct yamaha_mc1n2_audio_params_route galaxys2_params_routes[] = {
},
},
{
.device = AUDIO_DEVICE_OUT_ANLG_DOCK_HEADSET,
.direction = YAMAHA_MC1N2_AUDIO_DIRECTION_OUTPUT,

.ae_info = {
.bOnOff = 0x00,
.abBex = { 0x00 },
.abWide = { 0x00 },
.abDrc = { 0x00 },
.abEq5 = { 0x00 },
.abEq3 = { 0x00 },
},

.path_info.asHpOut[0].abSrcOnOff = { 0 },
.path_info.asHpOut[1].abSrcOnOff = { 0 },
.path_info.asSpOut[0].abSrcOnOff = { 0 },
.path_info.asSpOut[1].abSrcOnOff = { 0 },
.path_info.asRcOut[0].abSrcOnOff = { 0 },
.path_info.asLout1[0].abSrcOnOff = { 0 },
.path_info.asLout1[1].abSrcOnOff = { 0 },
.path_info.asLout2[0].abSrcOnOff = { 0 },
.path_info.asLout2[1].abSrcOnOff = { 0 },
.path_info.asPeak[0].abSrcOnOff = { 0 },
.path_info.asDit0[0].abSrcOnOff = { 0 },
.path_info.asDit1[0].abSrcOnOff = { 0 },
.path_info.asDit2[0].abSrcOnOff = { 0 },
.path_info.asDac[0].abSrcOnOff = { 0 },
.path_info.asDac[1].abSrcOnOff = { 0 },
.path_info.asAe[0].abSrcOnOff = { 0 },
.path_info.asCdsp[0].abSrcOnOff = { 0 },
.path_info.asCdsp[1].abSrcOnOff = { 0 },
.path_info.asCdsp[2].abSrcOnOff = { 0 },
.path_info.asCdsp[3].abSrcOnOff = { 0 },
.path_info.asAdc0[0].abSrcOnOff = { 0 },
.path_info.asAdc0[1].abSrcOnOff = { 0 },
.path_info.asAdc1[0].abSrcOnOff = { 0 },
.path_info.asMix[0].abSrcOnOff = { 0 },
.path_info.asBias[0].abSrcOnOff = { 0 },

.path_info.asLout1[0].abSrcOnOff[5] = MCDRV_SRC5_DAC_L_ON,
.path_info.asLout1[1].abSrcOnOff[5] = MCDRV_SRC5_DAC_R_ON,
.path_info.asDac[0].abSrcOnOff[6] = MCDRV_SRC6_MIX_ON,
.path_info.asMix[0].abSrcOnOff[3] = MCDRV_SRC3_DIR0_ON,

.dac_info = {
.bMasterSwap = 0,
.bVoiceSwap = 0,
.bDcCut = 0,
},
},
{
.device = AUDIO_DEVICE_IN_BUILTIN_MIC,
.direction = YAMAHA_MC1N2_AUDIO_DIRECTION_INPUT,



Loading…
Cancel
Save