msm8953-mainline / linux

Linux mainline kernel with WIP patches for msm8953 devices
Other
111 stars 59 forks source link

xiaomi-ysl: enable soundcard #116

Closed barni2000 closed 1 year ago

barni2000 commented 1 year ago

I have enabled sound_card node for ysl with proper ucm (modified vince) config almost everything is working. It works with mido config. (speaker, earpiece, mics, headphones, headsetmic)

HiFi.conf Forked msm8916-mainline/alsa-ucm-conf

It also work with original mido HiFi.conf but /usr/share/alsa/ucm2/platforms/msm8916/qdsp6.conf should be modified, CS-Voice lines should be commented out.

In mido HiFi.conf cset "name='RX3 Digital Volume' 115" should be modified to cset "name='RX3 Digital Volume' 78"

M0Rf30 commented 1 year ago

For jack sensing use the wcd_codec.

&wcd_codec {

    qcom,gnd-jack-type-normally-open;

    qcom,hphl-jack-type-normally-open;

    qcom,mbhc-vthreshold-high = <75 150 237 450 500>;

    qcom,mbhc-vthreshold-low = <75 150 237 450 500>;

    qcom,micbias1-ext-cap;

 

    vdd-cdc-io-supply = <&pm8953_l5>;

    vdd-cdc-tx-rx-cx-supply = <&pm8953_s4>;

    vdd-micbias-supply = <&pm8953_l13>;

 

    status = "okay";

};

Obviously compare it with your downstream values

This also enable multimedia buttons on headset

barni2000 commented 1 year ago

For jack sensing use the wcd_codec.

&wcd_codec {

  qcom,gnd-jack-type-normally-open;

  qcom,hphl-jack-type-normally-open;

  qcom,mbhc-vthreshold-high = <75 150 237 450 500>;

  qcom,mbhc-vthreshold-low = <75 150 237 450 500>;

  qcom,micbias1-ext-cap;

  vdd-cdc-io-supply = <&pm8953_l5>;

  vdd-cdc-tx-rx-cx-supply = <&pm8953_s4>;

  vdd-micbias-supply = <&pm8953_l13>;

  status = "okay";

};

Obviously compare it with your downstream values

This also enable multimedia buttons on headset

I think it is not needed, i have realized it has a new input device [ 25.442325] input: xiaomi-mido Headset Jack as /devices/platform/soc@0/c051000.sound-card/sound/card0/input4 I have tested with evtest and it is works also pause/play works.

M0Rf30 commented 1 year ago

For loud speaker maybe you can use values in mixer_paths.xml for ysl and tweak them? https://github.com/xiaomi-msm8953-devs/android_device_xiaomi_ysl/blob/lineage-20/audio/mixer_paths_mtp.xml. line 1288

78 instead of 115

barni2000 commented 1 year ago

For loud speaker maybe you can use values in mixer_paths.xml for ysl and tweak them? https://github.com/xiaomi-msm8953-devs/android_device_xiaomi_ysl/blob/lineage-20/audio/mixer_paths_mtp.xml. line 1288

78 instead of 115

That helped, thanks. I have modified the original mido HiFi.conf

barni2000 commented 1 year ago

For jack sensing use the wcd_codec.

&wcd_codec {

  qcom,gnd-jack-type-normally-open;

  qcom,hphl-jack-type-normally-open;

  qcom,mbhc-vthreshold-high = <75 150 237 450 500>;

  qcom,mbhc-vthreshold-low = <75 150 237 450 500>;

  qcom,micbias1-ext-cap;

  vdd-cdc-io-supply = <&pm8953_l5>;

  vdd-cdc-tx-rx-cx-supply = <&pm8953_s4>;

  vdd-micbias-supply = <&pm8953_l13>;

  status = "okay";

};

Obviously compare it with your downstream values

This also enable multimedia buttons on headset

If find out for jack sensing codecs/msm8916-wcd/Headphones.conf should be modified. JackControl "Headphones Jack" should be modified to JackControl "Headset Jack" Maybe it is time to fork msm8916-mainline/alsa-ucm-conf because these changes needed for many device, at least for 4 device (mido, tissot, daisy/sakura, ysl)

alikates commented 1 year ago

I just forked alsa-ucm-conf. Can you open a MR here https://github.com/msm8953-mainline/alsa-ucm-conf?

barni2000 commented 1 year ago

I just forked alsa-ucm-conf. Can you open a MR here https://github.com/msm8953-mainline/alsa-ucm-conf?

It is done but for mainline alsa-ucm-conf whole thing should be restructured.

alikates commented 1 year ago

LGTM. I'll manually add it to the 6.4 or 6.5 tree