Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Lenovo Carbon X1 Gen 7 - Audio and microphone fix - Arch Linux and kernel 5.3+ required. Updates will be made as they become necessary / available.
#!/bin/bash
## Description
# Lenovo Carbon X1 Gen 7 - Audio and microphone fix - kernel 5.3+ required.
# The script has only been tested for Arch and OpenSuse,
# Original thread: https://forums.lenovo.com/t5/Ubuntu/Guide-X1-Carbon-7th-Generation-Ubuntu-compatability/td-p/4489823
# Prereq: Install Linux 5.3 or newer
# NOTE: run this script as root and at your own risk.
firmware_version=v1.4.1
echo Copy https://github.com/thesofproject/sof/releases/download/${firmware_version}/sof-cnl-${firmware_version}.ri to /lib/firmware/intel/sof/ as sof-cnl.ri
mkdir -p /lib/firmware/intel/sof/
curl -L https://github.com/thesofproject/sof/releases/download/${firmware_version}/sof-cnl-${firmware_version}.ri -o /lib/firmware/intel/sof/sof-cnl.ri
echo Copy https://github.hamidzare.xyz/dl/sof-hda-generic.tplg to /lib/firmware/intel/sof-tplg/ as sof-hda-generic-4ch.tplg
mkdir -p /lib/firmware/intel/sof-tplg/
curl -L https://github.hamidzare.xyz/dl/sof-hda-generic.tplg -o /lib/firmware/intel/sof-tplg/sof-hda-generic-4ch.tplg
ln -s /lib/firmware/intel/sof-tplg/sof-hda-generic-4ch.tplg /lib/firmware/intel/sof-tplg/sof-hda-generic.tplg
echo creating file /etc/modprobe.d/alsa-base.conf ------
cat <<EOT >> /etc/modprobe.d/alsa-base.conf
# autoloader aliases
install sound-slot-0 /sbin/modprobe snd-card-0
install sound-slot-1 /sbin/modprobe snd-card-1
install sound-slot-2 /sbin/modprobe snd-card-2
install sound-slot-3 /sbin/modprobe snd-card-3
install sound-slot-4 /sbin/modprobe snd-card-4
install sound-slot-5 /sbin/modprobe snd-card-5
install sound-slot-6 /sbin/modprobe snd-card-6
install sound-slot-7 /sbin/modprobe snd-card-7
# Cause optional modules to be loaded above generic modules
install snd /sbin/modprobe --ignore-install snd $CMDLINE_OPTS && { /sbin/modprobe --quiet --use-blacklist snd-ioctl32 ; /sbin/modprobe --quiet --use-blacklist snd-seq ; }
#
# Workaround at bug #499695 (reverted in Ubuntu see LP #319505)
install snd-pcm /sbin/modprobe --ignore-install snd-pcm $CMDLINE_OPTS && { /sbin/modprobe --quiet --use-blacklist snd-pcm-oss ; : ; }
install snd-mixer /sbin/modprobe --ignore-install snd-mixer $CMDLINE_OPTS && { /sbin/modprobe --quiet --use-blacklist snd-mixer-oss ; : ; }
install snd-seq /sbin/modprobe --ignore-install snd-seq $CMDLINE_OPTS && { /sbin/modprobe --quiet --use-blacklist snd-seq-midi ; /sbin/modprobe --quiet --use-blacklist snd-seq-oss ; : ; }
#
install snd-rawmidi /sbin/modprobe --ignore-install snd-rawmidi $CMDLINE_OPTS && { /sbin/modprobe --quiet --use-blacklist snd-seq-midi ; : ; }
# Cause optional modules to be loaded above sound card driver modules
install snd-emu10k1 /sbin/modprobe --ignore-install snd-emu10k1 $CMDLINE_OPTS && { /sbin/modprobe --quiet --use-blacklist snd-emu10k1-synth ; }
install snd-via82xx /sbin/modprobe --ignore-install snd-via82xx $CMDLINE_OPTS && { /sbin/modprobe --quiet --use-blacklist snd-seq ; }
# Load saa7134-alsa instead of saa7134 (which gets dragged in by it anyway)
install saa7134 /sbin/modprobe --ignore-install saa7134 $CMDLINE_OPTS && { /sbin/modprobe --quiet --use-blacklist saa7134-alsa ; : ; }
# Prevent abnormal drivers from grabbing index 0
options bt87x index=-2
options cx88_alsa index=-2
options saa7134-alsa index=-2
options snd-atiixp-modem index=-2
options snd-intel8x0m index=-2
options snd-via82xx-modem index=-2
options snd-usb-audio index=-2
options snd-usb-caiaq index=-2
options snd-usb-ua101 index=-2
options snd-usb-us122l index=-2
options snd-usb-usx2y index=-2
# Ubuntu #62691, enable MPU for snd-cmipci
options snd-cmipci mpu_port=0x330 fm_port=0x388
# Keep snd-pcsp from being loaded as first soundcard
options snd-pcsp index=-2
# Keep snd-usb-audio from being loaded as first soundcard
options snd-usb-audio index=-2
EOT
echo finished creating /etc/modprobe.d/alsa_base.conf ------
echo creating file /etc/modprobe.d/blacklist.conf -------
cat <<EOT >> /etc/modprobe.d/blacklist.conf
blacklist snd_hda_intel
blacklist snd_soc_skl
EOT
echo finished creating /etc/modprobe.d/blacklist.conf -------
echo creating file /usr/share/alsa/ucm/sof-skl_hda_card/HiFi.conf -------
mkdir -p /usr/share/alsa/ucm/sof-skl_hda_card
cat <<EOT >> /usr/share/alsa/ucm/sof-skl_hda_card/HiFi.conf
# Use case Configuration for skl-hda-card
SectionVerb {
EnableSequence [
cdev "hw:sofsklhdacard"
cset "name='Master Playback Switch' on"
cset "name='Capture Switch' on"
]
DisableSequence [
cdev "hw:sofsklhdacard"
]
}
SectionDevice."Headphone" {
Comment "Headphone"
EnableSequence [
cdev "hw:sofsklhdacard"
cset "name='Headphone Playback Switch' on"
]
DisableSequence [
cdev "hw:sofsklhdacard"
cset "name='Headphone Playback Switch' off"
]
Value {
PlaybackPCM "hw:sofsklhdacard,0"
PlaybackChannels "2"
JackName "sof-skl_hda_card Headphone"
JackType "gpio"
JackSwitch "12"
JackControl "Headphone Jack"
}
}
SectionDevice."Speaker" {
Comment "Speaker"
EnableSequence [
cdev "hw:sofsklhdacard"
cset "name='Speaker Playback Switch' on"
]
DisableSequence [
cset "name='Speaker Playback Switch' off"
]
Value {
PlaybackPCM "hw:sofsklhdacard,0"
JackHWMute "Headphone"
PlaybackChannels "2"
}
}
SectionDevice."Headset" {
Comment "Headset Mic"
ConflictingDevice [
"DMIC Stereo"
]
EnableSequence [
cdev "hw:sofsklhdacard"
]
DisableSequence [
cdev "hw:sofsklhdacard"
]
Value {
CapturePCM "hw:0,0"
CaptureChannels "2"
JackControl "Mic Jack"
}
}
SectionDevice."Dmic" {
Comment "DMIC Stereo"
ConflictingDevice [
"Headset Mic"
]
EnableSequence [
cdev "hw:sofsklhdacard"
]
DisableSequence [
cdev "hw:sofsklhdacard"
]
Value {
CapturePCM "hw:0,6"
CaptureChannels "2"
}
}
SectionDevice."HDMI1" {
Comment "HDMI1/DP1 Output"
EnableSequence [
cdev "hw:sofsklhdacard"
cset "name='hif5-0 Jack Switch' on"
cset "name='Pin5-Port0 Mux' 1"
]
DisableSequence [
cdev "hw:sofsklhdacard"
cset "name='Pin5-Port0 Mux' 0"
cset "name='hif5-0 Jack Switch' off"
]
Value {
PlaybackPCM "hw:0,3"
PlaybackChannels "2"
JackControl "HDMI/DP, pcm=11 Jack"
}
}
SectionDevice."HDMI2" {
Comment "HDMI2/DP2 Output"
EnableSequence [
cdev "hw:sofsklhdacard"
cset "name='hif6-0 Jack Switch' on"
cset "name='Pin6-Port0 Mux' 2"
]
DisableSequence [
cdev "hw:sofsklhdacard"
cset "name='Pin6-Port0 Mux' 0"
cset "name='hif6-0 Jack Switch' off"
]
Value {
PlaybackPCM "hw:0,4"
PlaybackChannels "2"
JackControl "HDMI/DP, pcm=12 Jack"
}
}
SectionDevice."HDMI3" {
Comment "HDMI3/DP3 Output"
EnableSequence [
cdev "hw:sofsklhdacard"
cset "name='hif7-0 Jack Switch' on"
cset "name='Pin7-Port0 Mux' 3"
]
DisableSequence [
cdev "hw:sofsklhdacard"
cset "name='Pin7-Port0 Mux' 0"
cset "name='hif7-0 Jack Switch' off"
]
Value {
PlaybackPCM "hw:0,5"
PlaybackChannels "2"
JackControl "HDMI/DP, pcm=13 Jack"
}
}
EOT
echo finished creating /usr/share/alsa/ucm/sof-skl_hda_card/HiFi.conf -------
echo creating file /usr/share/alsa/ucm/sof-skl_hda_card/sof-skl_hda_card.conf ------
cat <<EOT >> /usr/share/alsa/ucm/sof-skl_hda_card/sof-skl_hda_card.conf
SectionUseCase."HiFi" {
File "HiFi.conf"
Comment "Play HiFi quality Music"
}
EOT
echo finished creating /usr/share/alsa/ucm/sof-skl_hda_card/sof-skl_hda_card.conf -------
echo "Reboot and run alsamixer. Use F6 to select the sound card and F4 to go to Capture, then turn all of the channels up to 100"
echo "If there is no sound card detected, ‘dmesg | grep sof’ can be used to see what went wrong"
@cdcastro

This comment has been minimized.

@hamidzr

This comment has been minimized.

Copy link
Owner Author

hamidzr commented Oct 15, 2019

actually we might need to host that elsewhere, I wasn't hosting that and now it's not available.
updated.

@cdcastro

This comment has been minimized.

Copy link

cdcastro commented Oct 15, 2019

@hamidzr, I saw you changed the file link. Thank you very much.

Now i have a problem :) I'm running Ubuntu 18.04 and after run your script, I've no sound at all :(

Do you have some advice?

@hamidzr

This comment has been minimized.

Copy link
Owner Author

hamidzr commented Oct 15, 2019

I've only tested this on 64bit x86 Arch. Reversing the process should be simple but would have some manual work. just go through the steps in reverse? I'm only automating someone else's work on Arch.

@EBoisseauSierra

This comment has been minimized.

Copy link

EBoisseauSierra commented Oct 16, 2019

I've had the same issue as @cdcastro on Fedora 30 (Linux x1 5.3.6-200.fc30.x86_64): no sound card was detected at all.

$ dmesg | grep sof
[   16.888911] sof-audio-pci 0000:00:1f.3: warning: No matching ASoC machine driver found
[   16.888917] sof-audio-pci 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if 0x040380
[   16.889020] sof-audio-pci 0000:00:1f.3: use msi interrupt mode
[   16.893330] sof-audio-pci 0000:00:1f.3: bound 0000:00:02.0 (ops i915_audio_component_bind_ops [i915])
[   16.897091] sof-audio-pci 0000:00:1f.3: hda codecs found, mask 5
[   16.897092] sof-audio-pci 0000:00:1f.3: using HDA machine driver skl_hda_dsp_generic now
[   16.916602] sof-audio-pci 0000:00:1f.3: unexpected ipc interrupt raised!
[   16.916603] sof-audio-pci 0000:00:1f.3: error: no reply expected, received 0x0
[   19.982061] sof-audio-pci 0000:00:1f.3: error: load fw failed ret: -110
[   19.982086] sof-audio-pci 0000:00:1f.3: error: status = 0x0000002c panic = 0x00000000
[   19.982102] sof-audio-pci 0000:00:1f.3: error: failed to reset DSP
[   19.982103] sof-audio-pci 0000:00:1f.3: error: failed to boot DSP firmware -110
[   19.982103] sof-audio-pci 0000:00:1f.3: error: sof_probe_work failed err: -110

Screenshot from 2019-10-16 12-41-53

To revert the effect, I've found that simply deleting/commenting out /etc/modprobe.d/blacklist.conf (+ restart) does the job. Doesn't solve the mic issue, though…

@PaulVanSchayck

This comment has been minimized.

Copy link

PaulVanSchayck commented Oct 20, 2019

So.. on Ubuntu 19.10, with the 5.3.0-18-generic kernel I'm getting this after following these instructions:

$ dmesg | grep sof
[   10.067961] sof-audio-pci 0000:00:1f.3: warning: No matching ASoC machine driver found
[   10.067965] sof-audio-pci 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if 0x040380
[   10.068296] sof-audio-pci 0000:00:1f.3: use msi interrupt mode
[   10.073342] sof-audio-pci 0000:00:1f.3: No ASoC machine driver found - using nocodec
[   10.081756] sof-audio-pci 0000:00:1f.3: unexpected ipc interrupt raised!
[   10.081758] sof-audio-pci 0000:00:1f.3: error: no reply expected, received 0x0
[   10.164686] sof-audio-pci 0000:00:1f.3: Firmware info: version 1:1:0-5dd9a
[   10.164688] sof-audio-pci 0000:00:1f.3: Firmware: ABI 3:7:0 Kernel ABI 3:8:0
[   10.164932] sof-audio-pci 0000:00:1f.3: firmware boot complete
[   10.167303] sof-audio-pci 0000:00:1f.3: Direct firmware load for intel/sof-tplg/sof-cnl-nocodec.tplg failed with error -2

From reading elsewhere, I suspect that it's loading the nocodec machine driver, when it shouldn't. I don't know how to fix this.

I'm starting to suspect, from reading this SOF issue, that this stock Ubuntu 19.10 is kernel missing these two kernel options: CONFIG_SND_SOC_SOF_HDA_LINK=y and CONFIG_SND_SOC_SOF_HDA_AUDIO_CODEC=y.

$ grep CONFIG_SND_SOC_SOF_HDA config-5.3.0-18-generic 
CONFIG_SND_SOC_SOF_HDA_COMMON=m
CONFIG_SND_SOC_SOF_HDA_LINK_BASELINE=m
@hsanjuan

This comment has been minimized.

Copy link

hsanjuan commented Oct 20, 2019

Mind there is a typo here: https://gist.github.com/hamidzr/dd81e429dc86f4327ded7a2030e7d7d9#file-sof-audio-setup-carbonx1-sh-L58

Also, it should probably create the folder /usr/share/alsa/ucm/sof-skl_hda_card/

and re-running the script will append the content again to already created files which only break things.

Other than that, this works well for OpenSUSE.

@hamidzr

This comment has been minimized.

Copy link
Owner Author

hamidzr commented Oct 20, 2019

@hsanjuan

Mind there is a typo here: https://gist.github.com/hamidzr/dd81e429dc86f4327ded7a2030e7d7d9#file-sof-audio-setup-carbonx1-sh-L58

Also, it should probably create the folder /usr/share/alsa/ucm/sof-skl_hda_card/

and re-running the script will append the content again to already created files which only break things.

Other than that, this works well for OpenSUSE.

Thanks for catching those. I updated the script and also added some description.

@DesmondZhong

This comment has been minimized.

Copy link

DesmondZhong commented Nov 16, 2019

@hamidzr

I use the latest Arch and after running the script (and try the method in the forum back and forth several times), I notice there's no output of "dmesg | grep sof". It seems that the sof firmware is not loaded at all. I must have missed something. Do you have any idea of why this is happening?

Thanks!

@hamidzr

This comment has been minimized.

Copy link
Owner Author

hamidzr commented Nov 17, 2019

I have also lost the microphone with recent updates (on Arch). I haven't had a chance to look into it yet. Let me know if you find something

@DesmondZhong

This comment has been minimized.

Copy link

DesmondZhong commented Nov 18, 2019

It's good to know that it's because of recent updates. I haven't found anything related yet. I'll keep you posted if I do. Thanks!

@EBoisseauSierra

This comment has been minimized.

Copy link

EBoisseauSierra commented Nov 18, 2019

@DesmondZhong you're aware of the dedicated thread on Lenovo's forums, right?

@DesmondZhong

This comment has been minimized.

Copy link

DesmondZhong commented Nov 20, 2019

@EBoisseauSierra Yes, I mainly focused on the thread you mentioned and this thread in Archlinux forum.

@paolomainardi

This comment has been minimized.

Copy link

paolomainardi commented Dec 6, 2019

I've made some fixes:

  1. curl needs -L to follow the redirect otherwise it downloads just an html file instead of the firmware
  2. sof-hda-generic-4ch.tplg must be symlinked to sof-hda-generic.tplg
#!/bin/bash

## Description
# Lenovo Carbon X1 Gen 7 - Audio and microphone fix - kernel 5.3+ required.
# The script has only been tested for Arch and OpenSuse,
# Original thread: https://forums.lenovo.com/t5/Ubuntu/Guide-X1-Carbon-7th-Generation-Ubuntu-compatability/td-p/4489823

# Prereq: Install Linux 5.3 or newer

# NOTE: run this script as root and at your own risk.


echo Copy https://github.com/thesofproject/sof/releases/download/v1.3/sof-cnl-signed-intel.ri to /lib/firmware/intel/sof/ as sof-cnl.ri
mkdir -p /lib/firmware/intel/sof/
curl -L https://github.com/thesofproject/sof/releases/download/v1.3/sof-cnl-signed-intel.ri -o /lib/firmware/intel/sof/sof-cnl.ri

echo Copy https://github.hamidzare.xyz/dl/sof-hda-generic.tplg to /lib/firmware/intel/sof-tplg/ as sof-hda-generic-4ch.tplg
mkdir -p /lib/firmware/intel/sof-tplg/
curl -L https://github.hamidzare.xyz/dl/sof-hda-generic.tplg -o /lib/firmware/intel/sof-tplg/sof-hda-generic-4ch.tplg
ln -s /lib/firmware/intel/sof-tplg/sof-hda-generic-4ch.tplg /lib/firmware/intel/sof-tplg/sof-hda-generic.tplg

echo creating file /etc/modprobe.d/alsa-base.conf  ------

cat <<EOT >> /etc/modprobe.d/alsa-base.conf
# autoloader aliases
install sound-slot-0 /sbin/modprobe snd-card-0
install sound-slot-1 /sbin/modprobe snd-card-1
install sound-slot-2 /sbin/modprobe snd-card-2
install sound-slot-3 /sbin/modprobe snd-card-3
install sound-slot-4 /sbin/modprobe snd-card-4
install sound-slot-5 /sbin/modprobe snd-card-5
install sound-slot-6 /sbin/modprobe snd-card-6
install sound-slot-7 /sbin/modprobe snd-card-7
# Cause optional modules to be loaded above generic modules
install snd /sbin/modprobe --ignore-install snd $CMDLINE_OPTS && { /sbin/modprobe --quiet --use-blacklist snd-ioctl32 ; /sbin/modprobe --quiet --use-blacklist snd-seq ; }
#
# Workaround at bug #499695 (reverted in Ubuntu see LP #319505)
install snd-pcm /sbin/modprobe --ignore-install snd-pcm $CMDLINE_OPTS && { /sbin/modprobe --quiet --use-blacklist snd-pcm-oss ; : ; }
install snd-mixer /sbin/modprobe --ignore-install snd-mixer $CMDLINE_OPTS && { /sbin/modprobe --quiet --use-blacklist snd-mixer-oss ; : ; }
install snd-seq /sbin/modprobe --ignore-install snd-seq $CMDLINE_OPTS && { /sbin/modprobe --quiet --use-blacklist snd-seq-midi ; /sbin/modprobe --quiet --use-blacklist snd-seq-oss ; : ; }
#
install snd-rawmidi /sbin/modprobe --ignore-install snd-rawmidi $CMDLINE_OPTS && { /sbin/modprobe --quiet --use-blacklist snd-seq-midi ; : ; }
# Cause optional modules to be loaded above sound card driver modules
install snd-emu10k1 /sbin/modprobe --ignore-install snd-emu10k1 $CMDLINE_OPTS && { /sbin/modprobe --quiet --use-blacklist snd-emu10k1-synth ; }
install snd-via82xx /sbin/modprobe --ignore-install snd-via82xx $CMDLINE_OPTS && { /sbin/modprobe --quiet --use-blacklist snd-seq ; }
# Load saa7134-alsa instead of saa7134 (which gets dragged in by it anyway)
install saa7134 /sbin/modprobe --ignore-install saa7134 $CMDLINE_OPTS && { /sbin/modprobe --quiet --use-blacklist saa7134-alsa ; : ; }
# Prevent abnormal drivers from grabbing index 0
options bt87x index=-2
options cx88_alsa index=-2
options saa7134-alsa index=-2
options snd-atiixp-modem index=-2
options snd-intel8x0m index=-2
options snd-via82xx-modem index=-2
options snd-usb-audio index=-2
options snd-usb-caiaq index=-2
options snd-usb-ua101 index=-2
options snd-usb-us122l index=-2
options snd-usb-usx2y index=-2
# Ubuntu #62691, enable MPU for snd-cmipci
options snd-cmipci mpu_port=0x330 fm_port=0x388
# Keep snd-pcsp from being loaded as first soundcard
options snd-pcsp index=-2
# Keep snd-usb-audio from being loaded as first soundcard
options snd-usb-audio index=-2
EOT
 
echo finished creating  /etc/modprobe.d/alsa_base.conf  ------


echo creating file /etc/modprobe.d/blacklist.conf  -------
cat <<EOT >> /etc/modprobe.d/blacklist.conf
blacklist snd_hda_intel
blacklist snd_soc_skl
EOT
echo finished creating  /etc/modprobe.d/blacklist.conf  -------

echo creating file /usr/share/alsa/ucm/sof-skl_hda_card/HiFi.conf -------
mkdir -p /usr/share/alsa/ucm/sof-skl_hda_card
cat <<EOT >> /usr/share/alsa/ucm/sof-skl_hda_card/HiFi.conf
# Use case Configuration for skl-hda-card
SectionVerb {
 EnableSequence [
  cdev "hw:sofsklhdacard"
  cset "name='Master Playback Switch' on"
  cset "name='Capture Switch' on"
 ]
 DisableSequence [
  cdev "hw:sofsklhdacard"
 ]
}
SectionDevice."Headphone" {
 Comment "Headphone"
 EnableSequence [
  cdev "hw:sofsklhdacard"
  cset "name='Headphone Playback Switch' on"
 ]
 DisableSequence [
  cdev "hw:sofsklhdacard"
  cset "name='Headphone Playback Switch' off"
 ]
 Value {
  PlaybackPCM "hw:sofsklhdacard,0"
  PlaybackChannels "2"
  JackName "sof-skl_hda_card Headphone"
  JackType "gpio"
  JackSwitch "12"
  JackControl "Headphone Jack"
 }
}
SectionDevice."Speaker" {
 Comment "Speaker"
 EnableSequence [
  cdev "hw:sofsklhdacard"
  cset "name='Speaker Playback Switch' on"
 ]
 DisableSequence [
  cset "name='Speaker Playback Switch' off"
 ]
 Value {
  PlaybackPCM "hw:sofsklhdacard,0"
  JackHWMute "Headphone"
  PlaybackChannels "2"
 }
}
SectionDevice."Headset" {
 Comment "Headset Mic"
 ConflictingDevice [
  "DMIC Stereo"
 ]
 EnableSequence [
  cdev "hw:sofsklhdacard"
 ]
 DisableSequence [
  cdev "hw:sofsklhdacard"
 ]
 Value {
  CapturePCM "hw:0,0"
  CaptureChannels "2"
  JackControl "Mic Jack"
 }
}
SectionDevice."Dmic" {
 Comment "DMIC Stereo"
 ConflictingDevice [
  "Headset Mic"
 ]
 EnableSequence [
  cdev "hw:sofsklhdacard"
 ]
 DisableSequence [
  cdev "hw:sofsklhdacard"
 ]
 Value {
  CapturePCM "hw:0,6"
  CaptureChannels "2"
 }
}
SectionDevice."HDMI1" {
 Comment "HDMI1/DP1 Output"
 EnableSequence [
  cdev "hw:sofsklhdacard"
  cset "name='hif5-0 Jack Switch' on"
  cset "name='Pin5-Port0 Mux' 1"
 ]
 DisableSequence [
  cdev "hw:sofsklhdacard"
  cset "name='Pin5-Port0 Mux' 0"
  cset "name='hif5-0 Jack Switch' off"
 ]
 Value {
  PlaybackPCM "hw:0,3"
  PlaybackChannels "2"
  JackControl "HDMI/DP, pcm=11 Jack"
 }
}
SectionDevice."HDMI2" {
 Comment "HDMI2/DP2 Output"
 EnableSequence [
  cdev "hw:sofsklhdacard"
  cset "name='hif6-0 Jack Switch' on"
  cset "name='Pin6-Port0 Mux' 2"
 ]
 DisableSequence [
  cdev "hw:sofsklhdacard"
  cset "name='Pin6-Port0 Mux' 0"
  cset "name='hif6-0 Jack Switch' off"
 ]
 Value {
  PlaybackPCM "hw:0,4"
  PlaybackChannels "2"
  JackControl "HDMI/DP, pcm=12 Jack"
 }
}
SectionDevice."HDMI3" {
 Comment "HDMI3/DP3 Output"
 EnableSequence [
  cdev "hw:sofsklhdacard"
  cset "name='hif7-0 Jack Switch' on"
  cset "name='Pin7-Port0 Mux' 3"
 ]
 DisableSequence [
  cdev "hw:sofsklhdacard"
  cset "name='Pin7-Port0 Mux' 0"
  cset "name='hif7-0 Jack Switch' off"
 ]
 Value {
  PlaybackPCM "hw:0,5"
  PlaybackChannels "2"
  JackControl "HDMI/DP, pcm=13 Jack"
 }
}
EOT
echo finished creating  /usr/share/alsa/ucm/sof-skl_hda_card/HiFi.conf -------

echo creating file /usr/share/alsa/ucm/sof-skl_hda_card/sof-skl_hda_card.conf ------
cat <<EOT >> /usr/share/alsa/ucm/sof-skl_hda_card/sof-skl_hda_card.conf
SectionUseCase."HiFi" {
 File "HiFi.conf"
 Comment "Play HiFi quality Music"
}
EOT
echo finished creating  /usr/share/alsa/ucm/sof-skl_hda_card/sof-skl_hda_card.conf   -------


echo "Reboot and run alsamixer. Use F6 to select the sound card and F4 to go to Capture, then turn all of the channels up to 100"

echo "If there is no sound card detected, ‘dmesg | grep sof’ can be used to see what went wrong"
@hsanjuan

This comment has been minimized.

Copy link

hsanjuan commented Dec 6, 2019

You may also start using release 1.4.1 firmware.

@paolomainardi

This comment has been minimized.

Copy link

paolomainardi commented Dec 6, 2019

i cannot find the intel signed one, which i don't really know if it's needed.

@hamidzr

This comment has been minimized.

Copy link
Owner Author

hamidzr commented Dec 6, 2019

@paolomainardi thanks I'll review it and add the changes in

@hsanjuan

This comment has been minimized.

Copy link

hsanjuan commented Dec 6, 2019

@paolomainardi the ones here https://github.com/thesofproject/sof/releases are signed (even if name does not say)

@hamidzr

This comment has been minimized.

Copy link
Owner Author

hamidzr commented Dec 7, 2019

thanks @hsanjuan and @paolomainardi. I added the changes and tested it on my machine both mic and speakers work.
Arch Linux. Kernel 5.4.2

dmesg | grep sof

[    0.987352] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    1.495284] PCI-DMA: Using software bounce buffering for IO (SWIOTLB)
[    1.495287] software IO TLB: mapped [mem 0x6226a000-0x6626a000] (64MB)
[   16.262129] sof-audio-pci 0000:00:1f.3: warning: No matching ASoC machine driver found
[   16.262138] sof-audio-pci 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if 0x040380
[   16.262322] sof-audio-pci 0000:00:1f.3: use msi interrupt mode
[   16.262485] sof-audio-pci 0000:00:1f.3: bound 0000:00:02.0 (ops i915_audio_component_bind_ops [i915])
[   16.270882] sof-audio-pci 0000:00:1f.3: hda codecs found, mask 5
[   16.270884] sof-audio-pci 0000:00:1f.3: using HDA machine driver skl_hda_dsp_generic now
[   16.377914] sof-audio-pci 0000:00:1f.3: unexpected ipc interrupt raised!
[   16.377917] sof-audio-pci 0000:00:1f.3: error: no reply expected, received 0x0
[   16.480137] sof-audio-pci 0000:00:1f.3: Firmware info: version 1:1:0-fcf6c
[   16.480139] sof-audio-pci 0000:00:1f.3: Firmware: ABI 3:11:0 Kernel ABI 3:10:0
[   16.480140] sof-audio-pci 0000:00:1f.3: warn: FW ABI is more recent than kernel
[   16.480509] sof-audio-pci 0000:00:1f.3: firmware boot complete
[   16.487680] sof-audio-pci 0000:00:1f.3: Topology: ABI 3:7:0 Kernel ABI 3:10:0
[   16.487686] sof-audio-pci 0000:00:1f.3: warning: widget type 7 name iDisp3 Tx not handled
[   16.488640] sof-audio-pci 0000:00:1f.3: warning: widget type 0 name codec0_in not handled
[   16.488644] sof-audio-pci 0000:00:1f.3: warning: widget type 7 name iDisp2 Tx not handled
[   16.489555] sof-audio-pci 0000:00:1f.3: warning: widget type 0 name codec1_in not handled
[   16.489557] sof-audio-pci 0000:00:1f.3: warning: widget type 7 name iDisp1 Tx not handled
[   16.490624] sof-audio-pci 0000:00:1f.3: warning: widget type 1 name codec0_out not handled
[   16.490627] sof-audio-pci 0000:00:1f.3: warning: widget type 7 name Analog CPU Playback not handled
[   16.491549] sof-audio-pci 0000:00:1f.3: warning: widget type 1 name codec1_out not handled
[   16.491552] sof-audio-pci 0000:00:1f.3: warning: widget type 7 name Digital CPU Playback not handled
[   16.491554] sof-audio-pci 0000:00:1f.3: warning: widget type 0 name codec2_in not handled
[   16.491556] sof-audio-pci 0000:00:1f.3: warning: widget type 7 name Alt Analog CPU Playback not handled
[   16.491557] sof-audio-pci 0000:00:1f.3: warning: widget type 1 name codec2_out not handled
[   16.491559] sof-audio-pci 0000:00:1f.3: warning: widget type 0 name Analog CPU Capture not handled
[   16.492484] sof-audio-pci 0000:00:1f.3: warning: widget type 1 name iDisp1_out not handled
[   16.492487] sof-audio-pci 0000:00:1f.3: warning: widget type 0 name Digital CPU Capture not handled
[   16.493445] sof-audio-pci 0000:00:1f.3: warning: widget type 1 name iDisp2_out not handled
[   16.493449] sof-audio-pci 0000:00:1f.3: warning: widget type 0 name Alt Analog CPU Capture not handled
[   16.494418] sof-audio-pci 0000:00:1f.3: warning: widget type 1 name iDisp3_out not handled
[   16.502580] sof-audio-pci 0000:00:1f.3: ASoC: Parent card not yet available, widget card binding deferred
[   16.573601] input: sof-skl_hda_card Mic as /devices/pci0000:00/0000:00:1f.3/skl_hda_dsp_generic/sound/card0/input15
[   16.573648] input: sof-skl_hda_card Headphone as /devices/pci0000:00/0000:00:1f.3/skl_hda_dsp_generic/sound/card0/input16
[   16.573688] input: sof-skl_hda_card HDMI/DP, pcm=11 Jack as /devices/pci0000:00/0000:00:1f.3/skl_hda_dsp_generic/sound/card0/input17
[   16.573727] input: sof-skl_hda_card HDMI/DP, pcm=12 Jack as /devices/pci0000:00/0000:00:1f.3/skl_hda_dsp_generic/sound/card0/input18
[   16.573765] input: sof-skl_hda_card HDMI/DP, pcm=13 Jack as /devices/pci0000:00/0000:00:1f.3/skl_hda_dsp_generic/sound/card0/input19
[   26.799801] sof-audio-pci 0000:00:1f.3: error: no reply expected, received 0x0
[   26.897603] sof-audio-pci 0000:00:1f.3: firmware boot complete
[  349.312055] sof-audio-pci 0000:00:1f.3: error: no reply expected, received 0x0
[  349.409156] sof-audio-pci 0000:00:1f.3: firmware boot complete
@dadosch

This comment has been minimized.

Copy link

dadosch commented Dec 7, 2019

does the mic work properly or does the sound recorded sound "like in slow-motion"? Also, is 4.0 / 4.1 sound detected (or only 2.0 stereo)? @hamidzr

@paolomainardi

This comment has been minimized.

Copy link

paolomainardi commented Dec 7, 2019

They work both but just bottom stereo speaker gets detected.

@paolomainardi

This comment has been minimized.

Copy link

paolomainardi commented Dec 7, 2019

Anyway just to add all the info, I’m testing it on Ubuntu 18.04 LTS with the standard 5.3 kernel.

@MfCrizz

This comment has been minimized.

Copy link

MfCrizz commented Dec 8, 2019

Thank you, the script and sound is working on Linux Mint 19.2 with kernel 5.3.0-24.

@paolomainardi

This comment has been minimized.

Copy link

paolomainardi commented Dec 9, 2019

Upgraded to 1.4.1 and everything is working fine, now is there a way to configure also the other speakers as well ? RIght now i can see just the 2 bottom ones.

@yunjae2

This comment has been minimized.

Copy link

yunjae2 commented Dec 10, 2019

Speaker and mic works properly on 19.10 with 5.3 kernel.

@yunjae2

This comment has been minimized.

Copy link

yunjae2 commented Dec 10, 2019

But I can see only two front speakers in the sound option.

@Tbaut

This comment has been minimized.

Copy link

Tbaut commented Dec 20, 2019

Thank you so much for the script. I did manually each step and I get the mic and audio working well on Linux Mint 19.2 using kernel 5.4.5

@Tbaut

This comment has been minimized.

Copy link

Tbaut commented Dec 20, 2019

One thing I realized is that the keyboard LED that indicated if mic or sound are muted don't work any more. (on the F2 and F4 keys). Not a hug deal though.

@kopax

This comment has been minimized.

Copy link

kopax commented Dec 22, 2019

Hi, I have a x1c7 and I want to get my microphone working. I see that there is updated snippet in the comment, which one should I take? Is the first one updated? I took the last one.

Was it safe to run on Debian buster? I did it and I have both microphone and speaker working, thanks!

They work both but just bottom stereo speaker gets detected.

@paolomainardi Does the version I have installed also include that bug ?

@ Thanks and merry xmas!

@hamidzr

This comment has been minimized.

Copy link
Owner Author

hamidzr commented Dec 23, 2019

@kopax I have included any fixes or updates people posted here. Happy holidays

@frade

This comment has been minimized.

Copy link

frade commented Dec 23, 2019

@kopax

This comment has been minimized.

Copy link

kopax commented Dec 23, 2019

Thanls all for the quick reply, I confirm it is OK, is this the expected startup logs?

Dec 23 10:56:55 dka kernel: [   41.183136] sof-audio-pci 0000:00:1f.3: error: no reply expected, received 0x0
Dec 23 10:56:55 dka kernel: [   41.277948] sof-audio-pci 0000:00:1f.3: firmware boot complete
@ulises-castro

This comment has been minimized.

Copy link

ulises-castro commented Dec 23, 2019

Thanks all man, it's works in Pop os 19.10 (Ubuntu 19.10).

@tjkopena

This comment has been minimized.

Copy link

tjkopena commented Jan 1, 2020

Running this script fixed the mic, speakers (bass and regular), and headphones on my Lenovo Carbon X1 7th (Fedora 31 5.5.0-0.rc4.git0.1.vanilla.knurd.1.fc31.x86, pulseaudio 13.0-97-gcdcb, alsa-lib-1.2.1.2-4.fc31).

I had previously not gotten mic+speakers to work following the linked manual instructions some time ago. Installing the packages in this RH bug report enabled them briefly, but a subsequent regular dnf upgrade broke everything again, this time including headphones. Issue did not seem to be simply that PulseAudio reverted. Running this script restored all functionality.

Thanks!

@akvadrako

This comment has been minimized.

Copy link

akvadrako commented Jan 2, 2020

I've followed these instructions on Ubuntu and my speakers + mic almost work. The only problem is pitch is too high. Should I adjust the sample rate somewhere?

@cdysthe

This comment has been minimized.

Copy link

cdysthe commented Jan 2, 2020

The script fixed my audio problems on Ubuntu 19.10. One question, the devices have very long names like "sof-skl_hda_card Speaker + Headphones". Is there a way to get the names shorter and more readable? I use an output switcher and the names are so long that all they are cut off and look the same.

@Markuzcha

This comment has been minimized.

Copy link

Markuzcha commented Jan 8, 2020

Thank you for the script. It works pretty well for my X1Y4 in Manjaro (Gnome, non-free drivers), except for one issue I am having big trouble with.
I also would like to propose to change the "cat <<EOT >>" lines to "cat <<EOT >", so the script can be repeatedly executed.

Here's my issue I hope somebody can help me with:
When I use my headphones connected to the audio jack and hear audio with certain sounds like male (i.e. deep) voices or sudden deep sounds in general (volume set to 30-100%) it causes annoying click (or crackling, popping) sounds at the beginning and the end of each of the sounds. The best example to reproduce is the beginning of this test video: https://youtu.be/2ZrWHtvSog4 (Youtube: "1-Minute Audio Test for Stereo Speakers & Headphones").
Even with the internal speakers the click sound is hearable, but it is much lower and doesn't bother.

Before I executed this script the click sounds were even worse and occured also during volume changes, they got even summarized when I played several videos at the same time in YouTube for instance.
I tried in a Live USB stick for Windows 10 (using WinToUSB) if the hardware was okay and I was glad to see that the click sound there was hardly hearable so it didn't bother.

I'm pretty sure I'm not the only one having this issue.
Any help is appreciated. If you need further HW info please ask.

@sagi

This comment has been minimized.

Copy link

sagi commented Jan 8, 2020

The script works out of the box for Ubuntu 19.10 with kernel 5.3.0-26-generic.

For posterity, here's the script I used:

#!/bin/bash

## Description
# Lenovo Carbon X1 Gen 7 - Audio and microphone fix - kernel 5.3+ required.
# The script has only been tested for Arch and OpenSuse,
# Original thread: https://forums.lenovo.com/t5/Ubuntu/Guide-X1-Carbon-7th-Generation-Ubuntu-compatability/td-p/4489823

# Prereq: Install Linux 5.3 or newer

# NOTE: run this script as root and at your own risk.

firmware_version=v1.4.1

echo Copy https://github.com/thesofproject/sof/releases/download/${firmware_version}/sof-cnl-${firmware_version}.ri to /lib/firmware/intel/sof/ as sof-cnl.ri
mkdir -p /lib/firmware/intel/sof/
curl -L https://github.com/thesofproject/sof/releases/download/${firmware_version}/sof-cnl-${firmware_version}.ri -o /lib/firmware/intel/sof/sof-cnl.ri

echo Copy https://github.hamidzare.xyz/dl/sof-hda-generic.tplg to /lib/firmware/intel/sof-tplg/ as sof-hda-generic-4ch.tplg
mkdir -p /lib/firmware/intel/sof-tplg/
curl -L https://github.hamidzare.xyz/dl/sof-hda-generic.tplg -o /lib/firmware/intel/sof-tplg/sof-hda-generic-4ch.tplg
ln -s /lib/firmware/intel/sof-tplg/sof-hda-generic-4ch.tplg /lib/firmware/intel/sof-tplg/sof-hda-generic.tplg

echo creating file /etc/modprobe.d/alsa-base.conf  ------

cat <<EOT >> /etc/modprobe.d/alsa-base.conf
# autoloader aliases
install sound-slot-0 /sbin/modprobe snd-card-0
install sound-slot-1 /sbin/modprobe snd-card-1
install sound-slot-2 /sbin/modprobe snd-card-2
install sound-slot-3 /sbin/modprobe snd-card-3
install sound-slot-4 /sbin/modprobe snd-card-4
install sound-slot-5 /sbin/modprobe snd-card-5
install sound-slot-6 /sbin/modprobe snd-card-6
install sound-slot-7 /sbin/modprobe snd-card-7
# Cause optional modules to be loaded above generic modules
install snd /sbin/modprobe --ignore-install snd $CMDLINE_OPTS && { /sbin/modprobe --quiet --use-blacklist snd-ioctl32 ; /sbin/modprobe --quiet --use-blacklist snd-seq ; }
#
# Workaround at bug #499695 (reverted in Ubuntu see LP #319505)
install snd-pcm /sbin/modprobe --ignore-install snd-pcm $CMDLINE_OPTS && { /sbin/modprobe --quiet --use-blacklist snd-pcm-oss ; : ; }
install snd-mixer /sbin/modprobe --ignore-install snd-mixer $CMDLINE_OPTS && { /sbin/modprobe --quiet --use-blacklist snd-mixer-oss ; : ; }
install snd-seq /sbin/modprobe --ignore-install snd-seq $CMDLINE_OPTS && { /sbin/modprobe --quiet --use-blacklist snd-seq-midi ; /sbin/modprobe --quiet --use-blacklist snd-seq-oss ; : ; }
#
install snd-rawmidi /sbin/modprobe --ignore-install snd-rawmidi $CMDLINE_OPTS && { /sbin/modprobe --quiet --use-blacklist snd-seq-midi ; : ; }
# Cause optional modules to be loaded above sound card driver modules
install snd-emu10k1 /sbin/modprobe --ignore-install snd-emu10k1 $CMDLINE_OPTS && { /sbin/modprobe --quiet --use-blacklist snd-emu10k1-synth ; }
install snd-via82xx /sbin/modprobe --ignore-install snd-via82xx $CMDLINE_OPTS && { /sbin/modprobe --quiet --use-blacklist snd-seq ; }
# Load saa7134-alsa instead of saa7134 (which gets dragged in by it anyway)
install saa7134 /sbin/modprobe --ignore-install saa7134 $CMDLINE_OPTS && { /sbin/modprobe --quiet --use-blacklist saa7134-alsa ; : ; }
# Prevent abnormal drivers from grabbing index 0
options bt87x index=-2
options cx88_alsa index=-2
options saa7134-alsa index=-2
options snd-atiixp-modem index=-2
options snd-intel8x0m index=-2
options snd-via82xx-modem index=-2
options snd-usb-audio index=-2
options snd-usb-caiaq index=-2
options snd-usb-ua101 index=-2
options snd-usb-us122l index=-2
options snd-usb-usx2y index=-2
# Ubuntu #62691, enable MPU for snd-cmipci
options snd-cmipci mpu_port=0x330 fm_port=0x388
# Keep snd-pcsp from being loaded as first soundcard
options snd-pcsp index=-2
# Keep snd-usb-audio from being loaded as first soundcard
options snd-usb-audio index=-2
EOT
 
echo finished creating  /etc/modprobe.d/alsa_base.conf  ------


echo creating file /etc/modprobe.d/blacklist.conf  -------
cat <<EOT >> /etc/modprobe.d/blacklist.conf
blacklist snd_hda_intel
blacklist snd_soc_skl
EOT
echo finished creating  /etc/modprobe.d/blacklist.conf  -------

echo creating file /usr/share/alsa/ucm/sof-skl_hda_card/HiFi.conf -------
mkdir -p /usr/share/alsa/ucm/sof-skl_hda_card
cat <<EOT >> /usr/share/alsa/ucm/sof-skl_hda_card/HiFi.conf
# Use case Configuration for skl-hda-card
SectionVerb {
 EnableSequence [
  cdev "hw:sofsklhdacard"
  cset "name='Master Playback Switch' on"
  cset "name='Capture Switch' on"
 ]
 DisableSequence [
  cdev "hw:sofsklhdacard"
 ]
}
SectionDevice."Headphone" {
 Comment "Headphone"
 EnableSequence [
  cdev "hw:sofsklhdacard"
  cset "name='Headphone Playback Switch' on"
 ]
 DisableSequence [
  cdev "hw:sofsklhdacard"
  cset "name='Headphone Playback Switch' off"
 ]
 Value {
  PlaybackPCM "hw:sofsklhdacard,0"
  PlaybackChannels "2"
  JackName "sof-skl_hda_card Headphone"
  JackType "gpio"
  JackSwitch "12"
  JackControl "Headphone Jack"
 }
}
SectionDevice."Speaker" {
 Comment "Speaker"
 EnableSequence [
  cdev "hw:sofsklhdacard"
  cset "name='Speaker Playback Switch' on"
 ]
 DisableSequence [
  cset "name='Speaker Playback Switch' off"
 ]
 Value {
  PlaybackPCM "hw:sofsklhdacard,0"
  JackHWMute "Headphone"
  PlaybackChannels "2"
 }
}
SectionDevice."Headset" {
 Comment "Headset Mic"
 ConflictingDevice [
  "DMIC Stereo"
 ]
 EnableSequence [
  cdev "hw:sofsklhdacard"
 ]
 DisableSequence [
  cdev "hw:sofsklhdacard"
 ]
 Value {
  CapturePCM "hw:0,0"
  CaptureChannels "2"
  JackControl "Mic Jack"
 }
}
SectionDevice."Dmic" {
 Comment "DMIC Stereo"
 ConflictingDevice [
  "Headset Mic"
 ]
 EnableSequence [
  cdev "hw:sofsklhdacard"
 ]
 DisableSequence [
  cdev "hw:sofsklhdacard"
 ]
 Value {
  CapturePCM "hw:0,6"
  CaptureChannels "2"
 }
}
SectionDevice."HDMI1" {
 Comment "HDMI1/DP1 Output"
 EnableSequence [
  cdev "hw:sofsklhdacard"
  cset "name='hif5-0 Jack Switch' on"
  cset "name='Pin5-Port0 Mux' 1"
 ]
 DisableSequence [
  cdev "hw:sofsklhdacard"
  cset "name='Pin5-Port0 Mux' 0"
  cset "name='hif5-0 Jack Switch' off"
 ]
 Value {
  PlaybackPCM "hw:0,3"
  PlaybackChannels "2"
  JackControl "HDMI/DP, pcm=11 Jack"
 }
}
SectionDevice."HDMI2" {
 Comment "HDMI2/DP2 Output"
 EnableSequence [
  cdev "hw:sofsklhdacard"
  cset "name='hif6-0 Jack Switch' on"
  cset "name='Pin6-Port0 Mux' 2"
 ]
 DisableSequence [
  cdev "hw:sofsklhdacard"
  cset "name='Pin6-Port0 Mux' 0"
  cset "name='hif6-0 Jack Switch' off"
 ]
 Value {
  PlaybackPCM "hw:0,4"
  PlaybackChannels "2"
  JackControl "HDMI/DP, pcm=12 Jack"
 }
}
SectionDevice."HDMI3" {
 Comment "HDMI3/DP3 Output"
 EnableSequence [
  cdev "hw:sofsklhdacard"
  cset "name='hif7-0 Jack Switch' on"
  cset "name='Pin7-Port0 Mux' 3"
 ]
 DisableSequence [
  cdev "hw:sofsklhdacard"
  cset "name='Pin7-Port0 Mux' 0"
  cset "name='hif7-0 Jack Switch' off"
 ]
 Value {
  PlaybackPCM "hw:0,5"
  PlaybackChannels "2"
  JackControl "HDMI/DP, pcm=13 Jack"
 }
}
EOT
echo finished creating  /usr/share/alsa/ucm/sof-skl_hda_card/HiFi.conf -------

echo creating file /usr/share/alsa/ucm/sof-skl_hda_card/sof-skl_hda_card.conf ------
cat <<EOT >> /usr/share/alsa/ucm/sof-skl_hda_card/sof-skl_hda_card.conf
SectionUseCase."HiFi" {
 File "HiFi.conf"
 Comment "Play HiFi quality Music"
}
EOT
echo finished creating  /usr/share/alsa/ucm/sof-skl_hda_card/sof-skl_hda_card.conf   -------


echo "Reboot and run alsamixer. Use F6 to select the sound card and F4 to go to Capture, then turn all of the channels up to 100"

echo "If there is no sound card detected, ‘dmesg | grep sof’ can be used to see what went wrong"
@haogroot

This comment has been minimized.

Copy link

haogroot commented Jan 11, 2020

Thank you! This script is working. I am using Ubuntu 19.10 with kernel 5.3.0-26-generic.

But after rebooting, I have to switch output device to Speaker Cannon Point-LP High Definition Audio Controller. (after reboot, default is HDMI3/DP3 Output)
Also the microphone sound is too low, but I use alsamixer to adjust and all is good for me now.

@ulises-castro

This comment has been minimized.

Copy link

ulises-castro commented Jan 11, 2020

Same for me, always when i disconnect via Bluetooth "HDMI3/DP4 Output" it was selected and i have to change manually to speaks output.
Also when connect to Bluetooth device i have to select to speaks and then select the Bluetooth device again and then it can works.

Also my microphone sound is too low..

My computer: Lenovo Carbon x1 Gen 7, i7 u10710
O.S = Pop os 19.10 (Based on Ubuntu 19.10)

@paulocosta-gmu

This comment has been minimized.

Copy link

paulocosta-gmu commented Jan 11, 2020

Thank you. This has been a major drawback of an otherwise awesome notebook.
I do have the same configuration and issues of ulises-castro and others above. Pop_OS 19.10, gen 7, 16gb, and have been getting this after a boot:

  • default speaker is "HDMI3/DP4 Output" regardless of what default sink I set in /etc/pulse/defaults.pa
  • very low microphone sound
  • same bluetooth issues
    I tried to edit various settings, all to no avail.
    No big deal, since I can manually fix in alsamixer, but somewhat still a minor annoyance.
    Any hints would be quite welcomed!
@rwlove

This comment has been minimized.

Copy link

rwlove commented Jan 11, 2020

Does anyone have all 4 audio channels working? On my system (Ubuntu 19.10) the script only enables the bottom two speakers and not the top ones (near the hinges).

@paulocosta-gmu

This comment has been minimized.

Copy link

paulocosta-gmu commented Jan 11, 2020

Thanks for reminding, rwlove. I did forget to mention that, in addition to the issues above, I only get two speakers working.

@hsanjuan

This comment has been minimized.

Copy link

hsanjuan commented Jan 12, 2020

hey all,

FYI:

  • Latest version of alsa (1.2.1.2) include the necessary UCM files https://github.com/alsa-project/alsa-ucm-conf/tree/master/ucm2/sof-hda-dsp (which I think include fixes over what was originally provided).
  • The 5.4.x kernel releases have been giving me lots of trouble with SOF v1.4.1. 5.5.0-rc5 works a little bit better. Mics works and 4 speakers produce sound. HDMI seems to not work (dissapeared from lists).
  • 5.5.x renames sof-skl_hda_card to sof-hda-dsp which means it won't pick up the UCM in this script anymore and things will break if using the new kernels but not the newer alsa ucm files.
@d-rowe

This comment has been minimized.

Copy link

d-rowe commented Jan 12, 2020

Working great on Manjaro (5.4.6). Thanks @hamidzr!

@drejohnson

This comment has been minimized.

Copy link

drejohnson commented Jan 17, 2020

Just tried this on a fresh Manjaro (5.4.12) install configured with Architect and now no soundcard detected

@hamidzr

This comment has been minimized.

Copy link
Owner Author

hamidzr commented Jan 17, 2020

Just tried this on a fresh Manjaro (5.4.12) install configured with Architect and now no soundcard detected

To reverse the effect you can probably just remove the two lines that the script adds from /etc/modprobe.d/blacklist.conf to reverse the effect. If that doesn't work the steps should be easily reversible following the script.

@zaggash

This comment has been minimized.

Copy link

zaggash commented Jan 17, 2020

I agree, just did the manjaro update today and now the sound card is not recognized anymore.
It worked very well before the update.

@zaggash

This comment has been minimized.

Copy link

zaggash commented Jan 17, 2020

~ >>> sudo dmesg| grep sof                                                                                                                                                                                                                 
[sudo] password for alexxx: 
[    1.593383] PCI-DMA: Using software bounce buffering for IO (SWIOTLB)
[    1.593385] software IO TLB: mapped [mem 0x61701000-0x65701000] (64MB)
[    9.988150] uvcvideo 1-8:1.2: Entity type for entity Microsoft Extended Controls Uni was not initialized!
[   10.562029] sof-audio-pci 0000:00:1f.3: warning: No matching ASoC machine driver found
[   10.562037] sof-audio-pci 0000:00:1f.3: DSP detected with PCI class/subclass/prog-if 0x040380
[   10.562203] sof-audio-pci 0000:00:1f.3: use msi interrupt mode
[   10.562930] sof-audio-pci 0000:00:1f.3: bound 0000:00:02.0 (ops i915_audio_component_bind_ops [i915])
[   10.572047] sof-audio-pci 0000:00:1f.3: hda codecs found, mask 5
[   10.572048] sof-audio-pci 0000:00:1f.3: using HDA machine driver skl_hda_dsp_generic now
[   10.623377] sof-audio-pci 0000:00:1f.3: unexpected ipc interrupt raised!
[   10.623379] sof-audio-pci 0000:00:1f.3: error: no reply expected, received 0x0
[   10.709346] sof-audio-pci 0000:00:1f.3: Firmware info: version 1:1:0-fcf6c
[   10.709347] sof-audio-pci 0000:00:1f.3: Firmware: ABI 3:11:0 Kernel ABI 3:10:0
[   10.709348] sof-audio-pci 0000:00:1f.3: warn: FW ABI is more recent than kernel
[   10.709589] sof-audio-pci 0000:00:1f.3: firmware boot complete
[   10.712815] sof-audio-pci 0000:00:1f.3: Topology: ABI 3:7:0 Kernel ABI 3:10:0
[   10.712818] sof-audio-pci 0000:00:1f.3: warning: widget type 7 name iDisp3 Tx not handled
[   10.713412] sof-audio-pci 0000:00:1f.3: warning: widget type 0 name codec0_in not handled
[   10.713413] sof-audio-pci 0000:00:1f.3: warning: widget type 7 name iDisp2 Tx not handled
[   10.713984] sof-audio-pci 0000:00:1f.3: warning: widget type 0 name codec1_in not handled
[   10.713985] sof-audio-pci 0000:00:1f.3: warning: widget type 7 name iDisp1 Tx not handled
[   10.714614] sof-audio-pci 0000:00:1f.3: warning: widget type 1 name codec0_out not handled
[   10.714616] sof-audio-pci 0000:00:1f.3: warning: widget type 7 name Analog CPU Playback not handled
[   10.715244] sof-audio-pci 0000:00:1f.3: warning: widget type 1 name codec1_out not handled
[   10.715245] sof-audio-pci 0000:00:1f.3: warning: widget type 7 name Digital CPU Playback not handled
[   10.715246] sof-audio-pci 0000:00:1f.3: warning: widget type 0 name codec2_in not handled
[   10.715247] sof-audio-pci 0000:00:1f.3: warning: widget type 7 name Alt Analog CPU Playback not handled
[   10.715248] sof-audio-pci 0000:00:1f.3: warning: widget type 1 name codec2_out not handled
[   10.715249] sof-audio-pci 0000:00:1f.3: warning: widget type 0 name Analog CPU Capture not handled
[   10.715843] sof-audio-pci 0000:00:1f.3: warning: widget type 1 name iDisp1_out not handled
[   10.715844] sof-audio-pci 0000:00:1f.3: warning: widget type 0 name Digital CPU Capture not handled
[   10.716465] sof-audio-pci 0000:00:1f.3: warning: widget type 1 name iDisp2_out not handled
[   10.716466] sof-audio-pci 0000:00:1f.3: warning: widget type 0 name Alt Analog CPU Capture not handled
[   10.717188] sof-audio-pci 0000:00:1f.3: warning: widget type 1 name iDisp3_out not handled
[   10.726252] sof-audio-pci 0000:00:1f.3: ASoC: Parent card not yet available, widget card binding deferred
[   10.779445] skl_hda_dsp_generic skl_hda_dsp_generic: ASoC: sof-skl_hda_card late_probe() failed: -22

@zaggash

This comment has been minimized.

Copy link

zaggash commented Jan 17, 2020

Reverting to kernel 5.4.6 fixed the issue :

$ /var/cache/pacman/pkg
$ sudo pacman -U  linux54-5.4.6-2-x86_64.pkg.tar.xz linux54-headers-5.4.6-2-x86_64.pkg.tar.xz

The latest 5.4.12 introduce an incompatibility with the sof driver I guess.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.