#!/bin/bash

# This file is part of PulseAudio.
#
# PulseAudio is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# PulseAudio is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.
set -e

link_notebook_profile() {
    if [ ! -f "/usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-internal-mic.conf" ] ;then
        ln -s /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-notebook-internal-mic.conf /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-internal-mic.conf
    fi
    if [ ! -f "/usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-mic.conf" ] ;then
        ln -s /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-notebook-mic.conf /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-mic.conf
    fi
}

link_desktop_profile() {
    if [ ! -f "/usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-internal-mic.conf" ] ;then
	 ln -s /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-desktop-internal-mic.conf /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-internal-mic.conf
    fi
    if [ ! -f "/usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-mic.conf" ] ;then
         ln -s /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-desktop-mic.conf /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-mic.conf
    fi
}

#check UNIS-D3830-G3
if [[ `dmidecode |grep "UNIS D3830 G3" -c` != "0" ]] ;then
	echo "UNIS D3830 G3"
	if [ -f "/usr/share/pulseaudio/alsa-mixer/profile-sets/alc4080-mh243a-usb-audio.conf" ] ;then
           rm -f /usr/share/pulseaudio/alsa-mixer/profile-sets/alc4080-mh243a-usb-audio.conf
        fi
	ln -fs /usr/share/pulseaudio/alsa-mixer/profile-sets/UNIS-D3830-G3-audio.conf /usr/share/pulseaudio/alsa-mixer/profile-sets/alc4080-mh243a-usb-audio.conf
	echo "ln -fs UNIS-D3830-G3-audio.conf -> alc4080-mh243a-usb-audio.conf"
fi

#check EMEM1314
if [[ `ls /sys/devices/platform |grep -c "EMEM1314"` != "0" ]] ;then
        echo " EMEM1314 "
        ln -fs /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-internal-mic-0boost.conf /usr/share/pulseaudio/alsa-mixer/paths/analog-input-alc269vc-internal-mic.conf
        ln -fs /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-notebook-mic.conf /usr/share/pulseaudio/alsa-mixer/paths/analog-input-alc269vc-mic.conf
        echo " EMEM1314  analog-input-hda-internal-mic-0boost.conf -> analog-input-alc269vc-internal-mic.conf "
        echo " EMEM1314  analog-input-hda-notebook-mic.conf -> analog-input-alc269vc-mic.conf "
fi

#check w410-bug:169010
if [[ `dmidecode |grep Centerm -c` != "0" ]] ;then
    if [[ `dmidecode |grep W410 -c` != "0" ]] ;then
    	echo "#bug169010 W410"
	if [ -f "/usr/share/pulseaudio/alsa-mixer/paths/analog-input-rear-mic.conf" ] ;then
	   rm -f /usr/share/pulseaudio/alsa-mixer/paths/analog-input-rear-mic.conf
	fi
	ln -s /usr/share/pulseaudio/alsa-mixer/paths/analog-input-rear-mic-0boost.conf /usr/share/pulseaudio/alsa-mixer/paths/analog-input-rear-mic.conf
    fi
fi

#check 广州云麒D2000-bug:169288
if [[ `dmidecode -t bios |grep CB.FD20. -c` != "0" ]] ;then
    echo "#bug:169288 CB.FD20.MA01-6-V0.01"
    if [ -f "/usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-linein.conf" ] ;then
      rm -f /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-linein.conf
    fi
    ln -s /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-linein-0boost.conf /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-linein.conf
fi


#check LM-LS3A4000-7A1000-1w-V01-pc_A2005
if [[ `dmidecode |grep LM-LS3A4000-7A1000-1w-V01-pc_A2005 -c` != "0" ]] ;then
    echo "LM-LS3A4000-7A1000-1w-V01-pc_A2005"
    if [ -f "/usr/share/pulseaudio/alsa-mixer/paths/analog-input-front-mic.conf" ] ;then
      rm -f /usr/share/pulseaudio/alsa-mixer/paths/analog-input-front-mic.conf
    fi
    if [ -f "/usr/share/pulseaudio/alsa-mixer/paths/analog-input-rear-mic.conf" ] ;then
      rm -f /usr/share/pulseaudio/alsa-mixer/paths/analog-input-rear-mic.conf
    fi
    ln -s /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-front-mic-1boost.conf /usr/share/pulseaudio/alsa-mixer/paths/analog-input-front-mic.conf
    ln -s /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-rear-mic-2boost.conf /usr/share/pulseaudio/alsa-mixer/paths/analog-input-rear-mic.conf
fi

#CP320F
if [[ `dmidecode |grep -c CP320F` != "0" ]] ;then
   echo "CP320F"
   if [ -f "/usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-internal-mic.conf" ] ;then
	rm -f /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-internal-mic.conf
	echo "rm analog-input-hda-internal-mic.conf"
   fi
   if [ -f "/usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-mic.conf" ] ;then
	rm -f /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-mic.conf
	echo "rm analog-input-hda-mic.conf"
   fi
   echo "link analog-input-hda-internal-mic-1boost.conf ---> analog-input-hda-internal-mic.conf"
   echo "link analog-input-hda-notebook-mic.conf ---> analog-input-hda-mic.conf"
   ln -s /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-internal-mic-1boost.conf /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-internal-mic.conf
   ln -s /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-notebook-mic.conf /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-mic.conf
fi

#FDJ-326
if [[ `dmidecode |grep -c FDJ-326` != "0" ]] ;then
   echo "FDJ-326"
   if [ -f "/usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-internal-mic.conf" ] ;then
	rm -f /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-internal-mic.conf
	echo "rm analog-input-hda-internal-mic.conf"
   fi
   if [ -f "/usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-mic.conf" ] ;then
	rm -f /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-mic.conf
	echo "rm analog-input-hda-mic.conf"
   fi
   echo "link analog-input-hda-internal-mic-0boost.conf ---> analog-input-hda-internal-mic.conf"
   echo "link analog-input-hda-notebook-mic.conf ---> analog-input-hda-mic.conf"
   ln -s /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-internal-mic-0boost.conf /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-internal-mic.conf
   ln -s /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-notebook-mic.conf /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-mic.conf
fi

#check 长城世恒TD120A2
if [[ `dmidecode |grep -c TD120A2` != "0" ]] ;then
    echo "TD120A2"
    if [ -f "/usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-front-mic.conf" ] ;then
      rm -f /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-front-mic.conf
    fi
    if [ -f "/usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-rear-mic.conf" ] ;then
      rm -f /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-rear-mic.conf
    fi
    ln -s /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-front-mic-1boost.conf /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-front-mic.conf
    ln -s /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-rear-mic-2boost.conf /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-rear-mic.conf
fi

#check PMDK
if [[ `aplay -l |grep -c "PMDK"` != "0" ]] ;then
	echo "PMDK"
	if [ -f "/etc/pulse/daemon.conf" ] && [ -f "/etc/pulse/daemon-PMDKHDMI.conf" ] ;then
		echo "mv /etc/pulse/daemon-PMDKHDMI.conf /etc/pulse/daemon.conf"
		mv /etc/pulse/daemon-PMDKHDMI.conf /etc/pulse/daemon.conf
	fi
fi

#ft-hda sound card
if [[ `dmidecode --type 11 |grep -c T321` == "1" ]] ;then
    link_notebook_profile
    echo "T321" 
elif [[ `dmidecode --type 11 |grep -c T322` == "1" ]] ;then
    echo "T322"
    link_notebook_profile
elif [[ `dmidecode --type 11 |grep -c 129FBS27` == "1"  ]] ;then
    echo "F129"
    if [ -f "/usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-front-mic.conf" ] ;then
      rm -f /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-front-mic.conf
    fi
    if [ -f "/usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-rear-mic.conf" ] ;then
      rm -f /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-rear-mic.conf
    fi
    ln -s /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-front-mic-2boost.conf /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-front-mic.conf
    ln -s /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-rear-mic-2boost.conf /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-rear-mic.conf
elif [[ `dmidecode -s system-product-name |grep -c N69f` == "1" ]] ;then
    echo "N69f"
    ln -s /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-internal-mic-2boost.conf /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-internal-mic.conf
    ln -s /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-notebook-mic.conf /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-mic.conf
elif [[ `dmidecode -s system-product-name |grep -c N70Z` == "1" ]] ;then
    echo "N70Z"
    if [ -f "/usr/share/pulseaudio/alsa-mixer/paths/analog-input-internal-mic.conf" ] ;then
      rm -f /usr/share/pulseaudio/alsa-mixer/paths/analog-input-internal-mic.conf
    fi
    if [ -f "/usr/share/pulseaudio/alsa-mixer/paths/analog-input-mic.conf" ] ;then
      rm -f /usr/share/pulseaudio/alsa-mixer/paths/analog-input-mic.conf
    fi
    if [[ `dmidecode |grep -c "KaiTian N70Z G1d"` != "0" ]] ;then
       echo "KaiTian N70Z G1d"
       if [ -f "/usr/share/pulseaudio/alsa-mixer/paths/analog-input-alc269vc-mic.conf" ] ;then
	  rm -f /usr/share/pulseaudio/alsa-mixer/paths/analog-input-alc269vc-mic.conf
	  echo "KaiTian N70Z G1d ->analog-input-alc269vc-mic-3boost.conf"
	  ln -s /usr/share/pulseaudio/alsa-mixer/paths/analog-input-alc269vc-mic-3boost.conf /usr/share/pulseaudio/alsa-mixer/paths/analog-input-alc269vc-mic.conf
      fi
    fi
    ln -s /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-internal-mic-3boost.conf /usr/share/pulseaudio/alsa-mixer/paths/analog-input-internal-mic.conf
    ln -s /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-mic-2boost.conf /usr/share/pulseaudio/alsa-mixer/paths/analog-input-mic.conf
elif [[ `dmidecode -s system-product-name |grep -c ............221EA` == "1" ]] ;then
    echo "baixinchenlong221EA"
    if [ -f "/usr/share/pulseaudio/alsa-mixer/paths/analog-input-front-mic.conf" ] ;then
      rm -f /usr/share/pulseaudio/alsa-mixer/paths/analog-input-front-mic.conf
    fi
    if [ -f "/usr/share/pulseaudio/alsa-mixer/paths/analog-input-rear-mic.conf" ] ;then
      rm -f /usr/share/pulseaudio/alsa-mixer/paths/analog-input-rear-mic.conf
    fi
    ln -s /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-front-mic-2boost.conf /usr/share/pulseaudio/alsa-mixer/paths/analog-input-front-mic.conf
    ln -s /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-rear-mic-2boost.conf /usr/share/pulseaudio/alsa-mixer/paths/analog-input-rear-mic.conf
elif [[ `dmidecode --type 11 |grep -c 323` == "1" ]] ;then
    echo "F323"
    link_notebook_profile
elif [[ `grep -nr "14f10312" /proc/asound/ |grep -c "14f10312"` == "1" ]] ;then
    echo "X100-lenovo"
    if [ -f "/usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-internal-mic.conf" ] ;then
      rm -f /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-internal-mic.conf 
    fi
    echo "link analog-input-hda-internal-mic-2boost.conf  -> analog-input-hda-internal-mic.conf"
    ln -s /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-internal-mic-2boost.conf /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-internal-mic.conf
    if [ -f "/usr/share/pulseaudio/alsa-mixer/paths/analog-input-mic.conf" ] ;then
      rm -f /usr/share/pulseaudio/alsa-mixer/paths/analog-input-mic.conf
    fi
    if [ -f "/usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-mic.conf" ] ;then
      rm -f /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-mic.conf
    fi
    echo "link analog-input-hda-mic-2boost.conf -> analog-input-hda-mic.conf"
    ln -s /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-mic-2boost.conf /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-mic.conf
elif [[ `dmidecode --type 11 |grep B50-FJ2 -c` != "0" ]] ;then
    echo "B50-FJ2"
    ln -s /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-internal-mic-0boost.conf /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-internal-mic.conf
elif [[ `dmidecode --type 2 |grep -c "Q90-H"` == "1" ]] ;then
	echo "EAECIS IZ67AC TBD"
	if [ -f "/usr/share/pulseaudio/alsa-mixer/paths/analog-input-alc269vc-mic.conf" ] ;then
		rm -f /usr/share/pulseaudio/alsa-mixer/paths/analog-input-alc269vc-mic.conf
		ln -s /usr/share/pulseaudio/alsa-mixer/paths/analog-input-alc269vc-mic-3boost.conf /usr/share/pulseaudio/alsa-mixer/paths/analog-input-alc269vc-mic.conf
	fi
#check KU-326
elif [[ `dmidecode --type 2 |grep -c "KU-326"` != "0" ]] ;then
	echo "KU-326"
	if [ -f "/usr/share/pulseaudio/alsa-mixer/paths/analog-input-alc269vc-internal-mic.conf" ] ;then
		echo "rm -f /usr/share/pulseaudio/alsa-mixer/paths/analog-input-alc269vc-internal-mic.conf"
		rm -f /usr/share/pulseaudio/alsa-mixer/paths/analog-input-alc269vc-internal-mic.conf
		echo "KU-326 -> paths/analog-input-alc269vc-internal-mic.conf"
		ln -s /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-internal-mic-0boost.conf /usr/share/pulseaudio/alsa-mixer/paths/analog-input-alc269vc-internal-mic.conf
	fi
#check nBook ZX601\ZX602
elif [[ `dmidecode --type 2 |grep -c "nBook ZX601\|nBook ZX602"` != "0" ]] ;then
        echo "nBook ZX601\ZX602 -> paths/analog-input-alc269vc-internal-mic.conf"
        ln -s /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-internal-mic-0boost.conf /usr/share/pulseaudio/alsa-mixer/paths/analog-input-alc269vc-internal-mic.conf
	ln -s /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-mic-0boost.conf /usr/share/pulseaudio/alsa-mixer/paths/analog-input-alc269vc-mic.conf
#check KX-326
elif [[ `dmidecode --type 2 |grep -c "KX-326"` != "0" ]] ;then
        echo "KX-326"
        if [ -f "/usr/share/pulseaudio/alsa-mixer/paths/analog-input-alc269vc-internal-mic.conf" ] ;then
                echo "rm -f /usr/share/pulseaudio/alsa-mixer/paths/analog-input-alc269vc-internal-mic.conf"
                rm -f /usr/share/pulseaudio/alsa-mixer/paths/analog-input-alc269vc-internal-mic.conf
                echo "KX-326 -> paths/analog-input-alc269vc-internal-mic.conf"
                ln -s /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-internal-mic-0boost.conf /usr/share/pulseaudio/alsa-mixer/paths/analog-input-alc269vc-internal-mic.conf
        fi
#check KX-819
elif [[ `dmidecode --type 2 |grep -c "KX-819"` != "0" ]] ;then
        echo "KX-819"
        if [ -f "/usr/share/pulseaudio/alsa-mixer/paths/analog-input-alc269vc-internal-mic.conf" ] ;then
                echo "rm -f /usr/share/pulseaudio/alsa-mixer/paths/analog-input-alc269vc-internal-mic.conf"
                rm -f /usr/share/pulseaudio/alsa-mixer/paths/analog-input-alc269vc-internal-mic.conf
                echo "KX-819 -> paths/analog-input-alc269vc-internal-mic.conf"
                ln -s /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-internal-mic-0boost.conf /usr/share/pulseaudio/alsa-mixer/paths/analog-input-alc269vc-internal-mic.conf
        fi
#check NZ252C
elif [[ `dmidecode --type 1 |grep -c "ChaoRui Series"` != "0" ]] ;then
	echo "NZ252C"
	if [ -f "/usr/share/pulseaudio/alsa-mixer/paths/analog-input-alc269vc-internal-mic.conf" ] ;then
		rm -f /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-internal-mic.conf
		echo "rm -f /usr/share/pulseaudio/alsa-mixer/paths/analog-input-alc269vc-internal-mic.conf"
	fi
	ln -s /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-internal-mic-0boost.conf /usr/share/pulseaudio/alsa-mixer/paths/analog-input-alc269vc-internal-mic.conf
	ln -s /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-notebook-mic.conf /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-mic.conf
	   echo "NZ252C analog-input-hda-internal-mic-0boost.conf -> analog-input-alc269vc-internal-mic.conf"
#check M70Z-G1TS
elif [[ `dmidecode  | grep LXCF-ZXE-ZX200-mATX -c` != "0" ]] ;then
	echo "bug#178139 M70Z-G1TS"
	if [ -f "/usr/share/pulseaudio/alsa-mixer/paths/analog-input-front-mic.conf" ] ;then
		rm -f /usr/share/pulseaudio/alsa-mixer/paths/analog-input-front-mic.conf
		echo "rm -f /usr/share/pulseaudio/alsa-mixer/paths/analog-input-front-mic.conf"
		echo "ln analog-input-hda-front-mic-0boost.conf -> analog-input-front-mic.conf"
		ln -s /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-front-mic-0boost.conf /usr/share/pulseaudio/alsa-mixer/paths/analog-input-front-mic.conf
	fi
#check TR4266
elif [[ `dmidecode -t system |grep -c "TR4266"` != "0" ]] ;then
	echo "TR4266"
	if [ -f "/usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-internal-mic.conf" ] ;then
		rm -f /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-internal-mic.conf
		echo "rm analog-input-hda-internal-mic.conf"
	fi
	if [ -f "/usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-mic.conf" ] ;then
		rm -f /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-mic.conf
		echo "rm analog-input-hda-mic.conf"
	fi
		ln -s /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-internal-mic-0boost.conf /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-internal-mic.conf
		ln -s /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-notebook-mic.conf /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-mic.conf
		echo "TR4266 analog-input-hda-internal-mic-0boost.conf -> analog-input-hda-internal-mic.conf"
		echo "TR4266 analog-input-hda-mic-0boost.conf -> analog-input-hda-mic.conf"
#check Lenovo N60f
elif [[ `dmidecode  --type 2 | grep -c NF271B` == "1" ]] ;then
        echo "Lenovo N60fG2d"
        if [ -f "/usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-internal-mic.conf" ] ;then
            rm -f /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-internal-mic.conf
        fi
        if [ -f "/usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-mic.conf" ] ;then
            rm -f /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-mic.conf
        fi
        ln -s /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-internal-mic-0boost.conf /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-internal-mic.conf
        ln -s /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-notebook-mic.conf /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-mic.conf
#check N140RKX01
elif [[ `dmidecode  --type 1 | grep -c N140RKX01` != "0" ]] ;then
	echo "N140RKX01 -> analog-input-hda-internal-mic-1boost.conf -> paths/analog-input-alc269vc-internal-mic.conf"
	echo "N140RKX01 -> analog-input-hda-mic-1boost.conf -> paths/analog-input-alc269vc-mic.conf"
	ln -s /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-internal-mic-1boost.conf /usr/share/pulseaudio/alsa-mixer/paths/analog-input-alc269vc-internal-mic.conf
	ln -s /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-mic-1boost.conf /usr/share/pulseaudio/alsa-mixer/paths/analog-input-alc269vc-mic.conf
#check JW-S0D2-D2000
elif [[ `dmidecode  --type 0 | grep -c JW-S0D2-D2000` != "0" ]] ;then
        echo "JW-S0D2-D2000"
        if [ -f "/usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-mic.conf" ] ;then
            echo " rm -f analog-input-hda-mic.conf "
            rm -f /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-mic.conf
        fi
        echo " JW-S0D2-D2000 -> analog-input-hda-mic-2boost.conf -> analog-input-hda-mic.conf "
        ln -s /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-mic-2boost.conf /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-mic.conf
#check UNIS D3890 G2
elif [[ `dmidecode  --type 2 | grep -c "UNIS D3890 G2"` != "0" ]] ;then
	echo "UNIS D3890 G2"
	if [ -f "/usr/share/pulseaudio/alsa-mixer/paths/analog-input-rear-mic.conf" ] ;then
		echo " rm -f analog-input-rear-mic.conf "
		rm -f /usr/share/pulseaudio/alsa-mixer/paths/analog-input-rear-mic.conf
	fi
	ln -fs /usr/share/pulseaudio/alsa-mixer/paths/analog-input-rear-mic-1boost.conf /usr/share/pulseaudio/alsa-mixer/paths/analog-input-rear-mic.conf
	echo " UNIS D3890 G2 -> analog-input-rear-mic-1boost.conf -> analog-input-rear-mic.conf "
#check greatewall ALC269, lenovo j321 j322
elif [[ `dmidecode -s baseboard-product-name | grep -c "GWMNDA1GL1A" ` != "0" ]] ;then
  echo "greatewall ALC269"
  if [ -f "/usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-internal-mic.conf" ] ;then
    rm -f /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-internal-mic.conf
    echo "rm -f analog-input-hda-internal-mic.conf"
  fi
  if [ -f "/usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-mic.conf" ] ;then
    rm -f /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-mic.conf
    echo "rm -f analog-input-hda-mic.conf"
  fi
  echo "ln analog-input-hda-internal-mic-0boost.conf -> analog-input-hda-internal-mic.conf"
  echo "ln analog-input-hda-notebook-mic.conf -> analog-input-hda-mic.conf"
  ln -s /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-internal-mic-0boost.conf /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-internal-mic.conf
  ln -s /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-notebook-mic.conf /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-mic.conf
elif [[ `dmidecode -s system-product-name | grep -c "GW-001N1B-FTF" ` != "0" && `aplay -l |grep -c "fthda"` != "0" ]] ;then
  echo "greatewall fthda"
  if [ -f "/usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-internal-mic.conf" ] ;then
    rm -f /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-internal-mic.conf
    echo "rm -f analog-input-hda-internal-mic.conf"
  fi
  if [ -f "/usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-mic.conf" ] ;then
    rm -f /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-mic.conf
    echo "rm -f analog-input-hda-mic.conf"
  fi
  echo "ln analog-input-hda-internal-mic-0boost.conf -> analog-input-hda-internal-mic.conf"
  echo "ln analog-input-hda-notebook-mic.conf -> analog-input-hda-mic.conf"
  ln -s /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-internal-mic-0boost.conf /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-internal-mic.conf
  ln -s /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-notebook-mic.conf /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-mic.conf
# TR4261笔记本
elif [[ `dmidecode -s system-product-name | grep -c "TR4261" ` != "0" ]] ;then
  echo "TR4261 fthda"
  if [ -f "/usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-internal-mic.conf" ] ;then
    rm -f /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-internal-mic.conf
    echo "rm -f analog-input-hda-internal-mic.conf"
  fi
  if [ -f "/usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-mic.conf" ] ;then
    rm -f /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-mic.conf
    echo "rm -f analog-input-hda-mic.conf"
  fi
  echo "ln analog-input-hda-internal-mic-1boost.conf -> analog-input-hda-internal-mic.conf"
  echo "ln analog-input-hda-notebook-mic.conf -> analog-input-hda-mic.conf"
  ln -s /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-internal-mic-1boost.conf /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-internal-mic.conf
  ln -s /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-notebook-mic.conf /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-mic.conf
elif [[ `dmidecode -s system-product-name | grep -c "CF4720J" ` != "0"  &&  `aplay -l | grep -c SN6140 ` != "0" ]] ;then
# 联想CF4720J-63f笔记本(D3000m)
  echo "LEGEND CF4720J-63f D3000m : fthda SN6140"
  if [ -f "/usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-internal-mic.conf" ] ;then
    rm -f /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-internal-mic.conf
    echo "rm -f analog-input-hda-internal-mic.conf"
  fi
  if [ -f "/usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-mic.conf" ] ;then
    rm -f /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-mic.conf
    echo "rm -f analog-input-hda-mic.conf"
  fi
  echo "ln analog-input-hda-internal-mic-2boost.conf -> analog-input-hda-internal-mic.conf"
  echo "ln analog-input-hda-mic-2boost.conf -> analog-input-hda-mic.conf"
  ln -s /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-internal-mic-2boost.conf /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-internal-mic.conf
  ln -s /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-mic-2boost.conf /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-mic.conf
  if [ -f "/usr/share/pulseaudio/alsa-mixer/profile-sets/pulse-ft-hda.conf" ] ;then
    cp -f /usr/share/pulseaudio/alsa-mixer/profile-sets/pulse-ft-hda.conf /usr/share/pulseaudio/alsa-mixer/profile-sets/pulse-ft-hda.conf.bak
    cp -f /usr/share/pulseaudio/alsa-mixer/profile-sets/pulse-ft-hda-cf4720.conf /usr/share/pulseaudio/alsa-mixer/profile-sets/pulse-ft-hda.conf
    echo "pulse-ft-hda-cf4720.conf instead pulse-ft-hda.conf"
  fi
# 超越PT3214-F笔记本
elif [[ `dmidecode -t 1 | grep -c "PT3214-F" ` != "0" ]] ;then
  echo "CY PT3214-F fthda ALC269VC"
  if [ -f "/usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-internal-mic.conf" ] ;then
    rm -f /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-internal-mic.conf
    echo "rm -f analog-input-hda-internal-mic.conf"
  fi
  if [ -f "/usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-mic.conf" ] ;then
    rm -f /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-mic.conf
    echo "rm -f analog-input-hda-mic.conf"
  fi
  if [ -f "/usr/share/pulseaudio/alsa-mixer/profile-sets/chaoyue-usb-hid-audio.conf" ] ;then
    rm -f /usr/share/pulseaudio/alsa-mixer/profile-sets/chaoyue-usb-hid-audio.conf
    echo "rm -f chaoyue-usb-hid-audio.conf"
  fi
  echo "ln analog-input-hda-internal-mic-1boost.conf -> analog-input-hda-internal-mic.conf"
  echo "ln analog-input-hda-mic-2boost.conf -> analog-input-hda-mic.conf"
  ln -s /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-internal-mic-1boost.conf /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-internal-mic.conf
  ln -s /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-mic-2boost.conf /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-mic.conf
  ln -s /usr/share/pulseaudio/alsa-mixer/profile-sets/chaoyue-usb-hid-audio-3214.conf /usr/share/pulseaudio/alsa-mixer/profile-sets/chaoyue-usb-hid-audio.conf
  
# 超越PT3020-F笔记本
elif [[ `dmidecode -t 1 | grep -c "PT3020-F" ` != "0" ]] ;then
  echo "CY PT3020-F fthda ALC269"
  if [ -f "/usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-internal-mic.conf" ] ;then
    rm -f /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-internal-mic.conf
    echo "rm -f analog-input-hda-internal-mic.conf"
  fi
  if [ -f "/usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-mic.conf" ] ;then
    rm -f /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-mic.conf
    echo "rm -f analog-input-hda-mic.conf"
  fi
  echo "ln analog-input-hda-internal-mic-1boost.conf -> analog-input-hda-internal-mic.conf"
  echo "ln analog-input-hda-mic-2boost.conf -> analog-input-hda-mic.conf"
  ln -s /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-internal-mic-1boost.conf /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-internal-mic.conf
  ln -s /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-mic-2boost.conf /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-mic.conf
elif [[ `dmidecode -t 1 | grep -c "F870-J1" ` != "0" ]] ;then
  echo "同方F870-J1 : fthda ALC233"
  if [ -f "/usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-internal-mic.conf" ] ;then
    rm -f /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-internal-mic.conf
    echo "rm -f analog-input-hda-internal-mic.conf"
  fi
  if [ -f "/usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-mic.conf" ] ;then
    rm -f /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-mic.conf
    echo "rm -f analog-input-hda-mic.conf"
  fi
  echo "ln analog-input-hda-internal-mic-1boost.conf -> analog-input-hda-internal-mic.conf"
  echo "ln analog-input-hda-mic-1boost.conf -> analog-input-hda-mic.conf"
  ln -s /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-internal-mic-1boost.conf /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-internal-mic.conf
  ln -s /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-mic-1boost.conf /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-mic.conf
else
    echo "else link_desktop_profile"
    link_desktop_profile
fi

#ALC269VC sound card
if [[ `aplay -l |grep -c "ALC269VC"` != "0" ]] ;then
        echo "ALC269VC"
        if [[ `aplay -l |grep -c "HDMI"` != "0" ]] ;then
            echo "exist HDMI"
        if [ ! -f "/usr/share/pulseaudio/alsa-mixer/profile-sets/alc269vc-internal-mic.conf" ] ;then
            ln -s /usr/share/pulseaudio/alsa-mixer/profile-sets/alc269vc-internal-mic-exist-hdmi.conf /usr/share/pulseaudio/alsa-mixer/profile-sets/alc269vc-internal-mic.conf
        fi
        else
            echo "NO HDMI"
            if [ ! -f "/usr/share/pulseaudio/alsa-mixer/profile-sets/alc269vc-internal-mic.conf" ] ;then
                ln -s /usr/share/pulseaudio/alsa-mixer/profile-sets/alc269vc-internal-mic-dev3.conf /usr/share/pulseaudio/alsa-mixer/profile-sets/alc269vc-internal-mic.conf
            fi
            if [ ! -f "/usr/share/pulseaudio/alsa-mixer/profile-sets/analog-input-alc269vc-internal-mic.conf" ] ;then
                if [[ `dmidecode |grep -c "CP300L"` != "0" ]] ;then
                        echo "CP300L"
                        ln -s /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-internal-mic-2boost.conf /usr/share/pulseaudio/alsa-mixer/paths/analog-input-alc269vc-internal-mic.conf
                fi
            fi
        fi
fi

#避免其他声卡与ALC269VC 重复的情况：PID=0x7a07 VID=0x0014
if [ ! -f "/usr/share/pulseaudio/alsa-mixer/profile-sets/alc269vc-internal-mic.conf" ] ;then
        echo "no alc269vc-internal-mic.conf file"
        if [[ `aplay -l |grep -c "HDMI"` != "0" ]] ;then
             echo "exist HDMI -> profile-sets/alc269vc-internal-mic-exist-hdmi.conf"
             ln -s /usr/share/pulseaudio/alsa-mixer/profile-sets/alc269vc-internal-mic-exist-hdmi.conf /usr/share/pulseaudio/alsa-mixer/profile-sets/alc269vc-internal-mic.conf
        else
             echo "NO HDMI -> profile-sets/alc269vc-internal-mic-dev3.conf"
             ln -s /usr/share/pulseaudio/alsa-mixer/profile-sets/alc269vc-internal-mic-dev3.conf /usr/share/pulseaudio/alsa-mixer/profile-sets/alc269vc-internal-mic.conf
        fi
fi

if [ ! -f "/usr/share/pulseaudio/alsa-mixer/paths/analog-input-alc269vc-internal-mic.conf" ] ;then
	echo "no analog-input-alc269vc-internal-mic.conf file"
	if [[ `dmidecode |grep -c "CP302L2"` != "0" ]] ;then
		echo "NL203B CP302L2 -> paths/analog-input-hda-internal-mic-0boost.conf"
		ln -s /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-internal-mic-0boost.conf /usr/share/pulseaudio/alsa-mixer/paths/analog-input-alc269vc-internal-mic.conf
	elif [[ `dmidecode --type 2 |grep -c KG-326` == "1" ]] ;then
        	echo "KG-326"
        	ln -s /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-internal-mic-0boost.conf /usr/share/pulseaudio/alsa-mixer/paths/analog-input-alc269vc-internal-mic.conf
	elif [[ `dmidecode |grep -c "CP300L2"` != "0" ]] ;then
                echo "NL203B CP300L2 -> paths/analog-input-hda-internal-mic-0boost.conf"
                ln -s /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-internal-mic-0boost.conf /usr/share/pulseaudio/alsa-mixer/paths/analog-input-alc269vc-internal-mic.conf
        elif [[ `dmidecode |grep -c "ZGN52"` != "0" ]] ;then
                echo "ZGN52 -> paths/analog-input-hda-internal-mic-0boost.conf"
                ln -s /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-internal-mic-0boost.conf /usr/share/pulseaudio/alsa-mixer/paths/analog-input-alc269vc-internal-mic.conf
	elif [[ `dmidecode |grep -c "UNIS L3893 G2"` != "0" ]] ;then
		echo "UNIS L3893 G2 -> paths/analog-input-hda-internal-mic-0boost.conf"
		ln -s /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-internal-mic-0boost.conf /usr/share/pulseaudio/alsa-mixer/paths/analog-input-alc269vc-internal-mic.conf
	elif [[ `dmidecode --type 1 |grep -c TR41A4` == "1" ]] ;then
		echo "706 TR41A4 -> paths/analog-input-hda-internal-mic-1boost.conf"
                ln -s /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-internal-mic-1boost.conf /usr/share/pulseaudio/alsa-mixer/paths/analog-input-alc269vc-internal-mic.conf
	elif [[ `dmidecode -s system-product-name |grep -c "M460"` == "1" ]] ;then
                echo "M460 -> paths/analog-input-hda-internal-mic-0boost.conf"
                ln -s /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-internal-mic-0boost.conf /usr/share/pulseaudio/alsa-mixer/paths/analog-input-alc269vc-internal-mic.conf
	elif [[ `dmidecode -t 2 |grep -c "EM_KG326"` != "0" ]] ;then
                if [ -f "/usr/share/pulseaudio/alsa-mixer/paths/analog-input-alc269vc-mic.conf" ] ;then
                        echo "rm analog-input-alc269vc-mic.conf"
                        rm -f /usr/share/pulseaudio/alsa-mixer/paths/analog-input-alc269vc-mic.conf
                fi
                echo "L851 EM_KG326 -> paths/analog-input-hda-notebook-mic.conf -> analog-input-alc269vc-mic.conf"
                echo "L851 EM_KG326 ->  analog-input-hda-mic-0boost.conf -> analog-input-hda-mic.conf"
                ln -s /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-notebook-mic.conf /usr/share/pulseaudio/alsa-mixer/paths/analog-input-alc269vc-mic.conf
                ln -s /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-internal-mic-0boost.conf /usr/share/pulseaudio/alsa-mixer/paths/analog-input-alc269vc-internal-mic.conf
	else
		echo "else -> paths/analog-input-hda-internal-mic-3boost.conf"
		ln -s /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-internal-mic-3boost.conf /usr/share/pulseaudio/alsa-mixer/paths/analog-input-alc269vc-internal-mic.conf
	fi
fi

#check 40A1
if [[ `dmidecode |grep -c "706-LS3A5000-4-V1.0-B40L-41A1"` != "0" ]] ;then
        echo "TR41A1"
        if [ -f "/usr/share/pulseaudio/alsa-mixer/paths/analog-output-headphones.conf" ] ;then
                 echo "rm -f /usr/share/pulseaudio/alsa-mixer/paths/analog-output-headphones.conf"
                 rm -f /usr/share/pulseaudio/alsa-mixer/paths/analog-output-headphones.conf
                 echo "TR41A1 -> paths/analog-output-headphones-enabled-AutoMute.conf"
                 ln -s /usr/share/pulseaudio/alsa-mixer/paths/analog-output-headphones-enabled-AutoMute.conf /usr/share/pulseaudio/alsa-mixer/paths/analog-output-headphones.conf
        fi
#check 41A4
elif [[ `dmidecode |grep -c "706-LS3A5000-4-V1.0-B50-TR41A4"` != "0" ]] ;then
        echo "TR41A4"
        if [ -f "/usr/share/pulseaudio/alsa-mixer/paths/analog-input-alc269vc-internal-mic.conf" ] ;then
                 echo "rm -f /usr/share/pulseaudio/alsa-mixer/paths/analog-input-alc269vc-internal-mic.conf"
                 rm -f /usr/share/pulseaudio/alsa-mixer/paths/analog-input-alc269vc-internal-mic.conf
                 echo "TR41A4 -> paths/analog-input-hda-internal-mic-0boost.conf"
                 ln -s /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-internal-mic-0boost.conf /usr/share/pulseaudio/alsa-mixer/paths/analog-input-alc269vc-internal-mic.conf
        fi
elif [[ `dmidecode |grep -c "TR41A4"` != "0" ]] ;then
	if [ -e "/usr/share/pulseaudio/alsa-mixer/paths/analog-input-alc269vc-mic.conf" ] ;then
		rm -f /usr/share/pulseaudio/alsa-mixer/paths/analog-input-alc269vc-mic.conf
	fi
	if [ -f "/usr/share/pulseaudio/alsa-mixer/paths/analog-input-alc269vc-internal-mic.conf" ] ;then
                 rm -f /usr/share/pulseaudio/alsa-mixer/paths/analog-input-alc269vc-internal-mic.conf
        fi

	ln -s /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-internal-mic-0boost.conf /usr/share/pulseaudio/alsa-mixer/paths/analog-input-alc269vc-internal-mic.conf
	ln -s /usr/share/pulseaudio/alsa-mixer/paths/analog-input-mic.conf /usr/share/pulseaudio/alsa-mixer/paths/analog-input-alc269vc-mic.conf
fi

#check C73N
if [[ `dmidecode |grep -c "C73N"` != "0" ]] ;then
	if [ -f "/usr/share/pulseaudio/alsa-mixer/paths/analog-input-alc269vc-internal-mic.conf" ] ;then
		rm -f /usr/share/pulseaudio/alsa-mixer/paths/analog-input-alc269vc-internal-mic.conf
		ln -s /usr/share/pulseaudio/alsa-mixer/paths/analog-input-hda-internal-mic-0boost.conf /usr/share/pulseaudio/alsa-mixer/paths/analog-input-alc269vc-internal-mic.conf
	fi
fi

#check mavis
if [[ `aplay -l |grep -c "sofhdadsp"` != "0" && `amixer contents |grep -c "Bass Speaker Playback"` != "0" ]] ;then
	echo "Mavis"
	sed -i "/SectionDevice.\"Headphones1\"/,+36d" /usr/share/alsa/ucm2/sof-hda-dsp/HiFi.conf
	sed -i "/If.monomic/,+51d" /usr/share/alsa/ucm2/sof-hda-dsp/HiFi.conf
fi

echo "Success"
