LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 09-13-2020, 09:48 PM   #1
derekn13
Member
 
Registered: Sep 2012
Distribution: Slackware
Posts: 52

Rep: Reputation: 29
Audio on Thinkpad X1C8


I'm running Slackware current on a Thinkpad X1 Carbon Gen 8 (aka X1C8).

The only way I've been able to get the speakers + microphone working is with a 5.8 kernel and the SOF firmware. The 5.8 kernel code appears to force SOF firmware for this particular machine, so I guess there's a known issue that requires it (?). The speakers work fine with the stock 5.4 kernel, but not the microphone.

The 5.4 kernel that ships with slackware current has support for SOF, but I haven't been able to get it to work. It looks like it may require an old version of SOF that's no longer available from the SOF project's githubg repo (but that's just a guess).

Questions:

Is anyone else running Slackware on a Thinkpad X1C8? (Or X1C7, or X1 Yoga 4/5 -- all of which have very similar hardware, I think.)

Does anyone know how to get the SOF firmware running with the stock 5.4 kernel?

Are there any plans to add the SOF firmware into Slackware current?
 
Old 09-17-2020, 04:05 AM   #2
Fat_Elvis
Member
 
Registered: Oct 2016
Distribution: FreeDOS 1.2
Posts: 309

Rep: Reputation: 92
I know nothing about your particular hardware, but I was thinking about getting one of those for some time, so, thanks for the heads-up.

The newest devices sometimes need the most recent kernel, and there is no way around it. I think Slackware ships a stock kernel and stock firmware only, but you can easily compile your own based on the official Slack config files.

AlienBob's guide for building a Slackware kernel:
https://docs.slackware.com/howtos:sl...kernelbuilding
Greg Kroah-Hartman has a free book on the subject:
http://www.kroah.com/lkn/

Last edited by Fat_Elvis; 09-17-2020 at 04:08 AM.
 
Old 09-17-2020, 10:25 AM   #3
derekn13
Member
 
Registered: Sep 2012
Distribution: Slackware
Posts: 52

Original Poster
Rep: Reputation: 29
Yup, I used to always build my own kernels, but I mostly stopped doing it several years ago. Actually my previous laptop also required a custom kernel build (for the wifi in that case). I was hoping to avoid that by switching from Slackware 14.2 to Slackware current, but nope.

Just to be clear, the 5.8.7 and 5.8.9 kernels work fine on this laptop. But I also had to install the SOF firmware.

I was hoping to get the SOF firmware working with the 5.4 kernel. Then I'd be able to use the Slackware kernel, and I'd just need to install the firmware. But I haven't been able to get that working. I *think* 5.4 requires an older version of SOF, but I haven't been able to get it to work.

Maybe the best bet is to wait for the next LTS kernel (guessing 5.9 or 5.10). If it gets picked up in Slackware current, then I can try to get the SOF firmware included, too.

If you do pick up a new Thinkpad, and you have any trouble getting the audio running, feel free to ping me.
 
Old 09-17-2020, 12:45 PM   #4
Fat_Elvis
Member
 
Registered: Oct 2016
Distribution: FreeDOS 1.2
Posts: 309

Rep: Reputation: 92
Quote:
Originally Posted by derekn13 View Post
If you do pick up a new Thinkpad, and you have any trouble getting the audio running, feel free to ping me.
Will do. Thanks much.
 
Old 09-17-2020, 02:01 PM   #5
Loomx
Member
 
Registered: Sep 2012
Distribution: Slackware
Posts: 184

Rep: Reputation: Disabled
Hi derekn13,

I have been having the same issues, although I have not yet managed to get the microphone working at all.

This is an HP Elitebook 840 G6 with this hardware:
Code:
00:1f.3 Multimedia audio controller: Intel Corporation Cannon Point-LP High Definition Audio Controller (rev 11)
	Subsystem: Hewlett-Packard Company Cannon Point-LP High Definition Audio Controller
	Kernel driver in use: snd_hda_intel
	Kernel modules: snd_hda_intel, snd_soc_skl, snd_sof_pci
I have the SOF firmware installed, and am currently running the 5.8.3 kernel. Even then I only get my sound card recognised at all if I add
Code:
append="snd_intel_dspcfg.dsp_driver=1"
to the kernel boot line.

Any advice gratefully received :-)

Jonny
 
1 members found this post helpful.
Old 09-17-2020, 02:50 PM   #6
derekn13
Member
 
Registered: Sep 2012
Distribution: Slackware
Posts: 52

Original Poster
Rep: Reputation: 29
First, I have no idea if this will work for anything other than a Thinkpad X1C8. (Though it makes sense there would be other similar hardware out there.)

I've had success with the 5.8.7 and 5.8.9 kernels; I haven't tried anything else.

I installed version 1.5.1 of the SOF firmware, via:

Code:
git clone -b stable-v1.5.1 https://github.com/thesofproject/sof-bin.git
There are a bunch of required symlinks -- look at the "go.sh" script.

I had to add this to the bottom of /etc/pulse/default.pa:

Code:
load-module module-alsa-sink device=hw:0,0 channels=4
load-module module-alsa-source device=hw:0,7 channels=4
To be honest, I'm not entirely sure what those lines do. Apparently the next release (14) of pulseaudio won't need any config changes.

Another tricky bit: after the first boot with the SOF firmware and drivers, you need to unmute the speakers. Run alsamixer, hit F6 and select "sof-hda-dsp", hit 'm' to unmute, and then increase the master volume to 100%. After that, you can use the regular pulseaudio volume control. Run 'alsactl store' to save the state, so you don't have to do this again.

The muting took me an embarrassing amount of time to notice, and it's not entirely obvious from the alsamixer interface, so I'll repeat: make sure you hit 'm' to unmute the sof-hda-dsp output.

I think the SOF firmware version is locked to the kernel SOF driver version. I.e., if your SOF firmware is newer than the kernel driver, things won't work. I'm not 100% sure on that, but you may want to try a more recent 5.8 kernel.

Credit to my original sources for all of this:
 
1 members found this post helpful.
Old 09-18-2020, 07:18 PM   #7
Loomx
Member
 
Registered: Sep 2012
Distribution: Slackware
Posts: 184

Rep: Reputation: Disabled
Thanks for the tips @derekn13, looks like I'll be doing some kernel compiling :-)
 
Old 09-23-2020, 04:26 AM   #8
Loomx
Member
 
Registered: Sep 2012
Distribution: Slackware
Posts: 184

Rep: Reputation: Disabled
Well, I did manage to get my microphone working :-)
For future reference, this is an HP Elitebook 840 G6.
Audio hardware is Intel Corporation Cannon Point-LP High Definition Audio Controller (rev 11).

I already had the SOF firmware installed.
I compiled a 5.8.10 kernel and made these changes to the config to get it to work:
Code:
$ diff -y --suppress-common-lines /usr/src/linux-5.8.10/{.config.old,.config}
# CONFIG_SND_SOC_INTEL_SOF_WM8804_MACH is not set	      |	CONFIG_SND_SOC_INTEL_SOF_WM8804_MACH=m
# CONFIG_SND_SOC_INTEL_KBL_RT5663_RT5514_MAX98927_MACH is not |	CONFIG_SND_SOC_INTEL_KBL_RT5663_RT5514_MAX98927_MACH=m
# CONFIG_SND_SOC_INTEL_GLK_DA7219_MAX98357A_MACH is not set   |	CONFIG_SND_SOC_INTEL_GLK_DA7219_MAX98357A_MACH=m
# CONFIG_SND_SOC_INTEL_SKL_HDA_DSP_GENERIC_MACH is not set    |	CONFIG_SND_SOC_INTEL_SKL_HDA_DSP_GENERIC_MACH=m
# CONFIG_SND_SOC_INTEL_SOF_RT5682_MACH is not set	      |	CONFIG_SND_SOC_INTEL_SOF_RT5682_MACH=m
# CONFIG_SND_SOC_INTEL_SOF_PCM512x_MACH is not set	      |	CONFIG_SND_SOC_INTEL_SOF_PCM512x_MACH=m
# CONFIG_SND_SOC_INTEL_CML_LP_DA7219_MAX98357A_MACH is not se |	CONFIG_SND_SOC_INTEL_CML_LP_DA7219_MAX98357A_MACH=m
# CONFIG_SND_SOC_INTEL_SOF_CML_RT1011_RT5682_MACH is not set  |	CONFIG_SND_SOC_INTEL_SOF_CML_RT1011_RT5682_MACH=m
# CONFIG_SND_SOC_INTEL_EHL_RT5660_MACH is not set	      |	CONFIG_SND_SOC_INTEL_SOF_DA7219_MAX98373_MACH=m
							      >	CONFIG_SND_SOC_INTEL_EHL_RT5660_MACH=m
# CONFIG_SND_SOC_SOF_JASPERLAKE_SUPPORT is not set	      |	CONFIG_SND_SOC_SOF_JASPERLAKE_SUPPORT=y
							      >	CONFIG_SND_SOC_SOF_JASPERLAKE=m
# CONFIG_SND_SOC_PCM512x_I2C is not set			      |	CONFIG_SND_SOC_PCM512x=m
							      >	CONFIG_SND_SOC_PCM512x_I2C=m
							      >	CONFIG_SND_SOC_RT1011=m
							      >	CONFIG_SND_SOC_RT1015=m
							      >	CONFIG_SND_SOC_RT5514=m
							      >	CONFIG_SND_SOC_RT5514_SPI=m
# CONFIG_SND_SOC_WM8804_I2C is not set			      |	CONFIG_SND_SOC_WM8804=m
							      >	CONFIG_SND_SOC_WM8804_I2C=m
I also found that the speakers were muted as mentioned, although running `alsactl store' wasn't enough to unsure they were unmuted after a reboot, so I ended up appending `alsactl restore' to the /etc/rc.d/rc.local script.

Also, I didn't need to make any changes to the stock /etc/pulse/default.pa file, it worked regardless of whether I added the "load module..." lines or not.

Thanks @derekn13 for your advice, most appreciated!
 
1 members found this post helpful.
Old 01-06-2021, 06:03 PM   #9
H1p8r10n
Member
 
Registered: Feb 2016
Location: on the border of milky way
Distribution: Slackware
Posts: 159

Rep: Reputation: Disabled
Hi,

Created a Slackware package for SOF firmware : http://download.zenwalk.org/x86_64/c..._64-210103.txz

Enjoy
JP
 
4 members found this post helpful.
Old 01-10-2021, 11:27 AM   #10
richarson
Member
 
Registered: Dec 2020
Location: Argentina
Distribution: Fedora 38 KDE
Posts: 112

Rep: Reputation: Disabled
Hi all,

I was in a similar situation with a Lenovo IdeaPad 5 (see e.g. here or here) and the recommendations in this thread were very useful to me, so thanks everybody!

But with the last few kernels (5.10.3 - 5.10.5) I had several problems, the most important being I couldn't put my notebook to sleep (it'd come back up immediately) and hibernation locked it up hard. And the mic never worked.

Yesterday I upgraded my kernel to 5.10.6 and I commented out "options snd_intel_dspcfg dsp_driver=1" from my /etc/modprobe.d/snd_intel_dspcfg.conf, and also commented out these 2 lines from /etc/pulse/default.pa:

load-module module-alsa-source device=hw:0,0 channels=2
load-module module-alsa-sink device=hw:0,0 channels=2

The only thing I kept was my self-created sof-firmware-1.6.1 package (I should have posted it in this thread, sorry for that. It's here if you want to check it out)

This was to make a fresh start of debugging sound and stability issues on my system but to my great surprise everithing works!
Sleep, hibernate, the internal speakers, HDMI audio, even the mic!

Sometimes I see some ugly names in the GUI (like "sof-hdmi-audio" or some such instead of "HDMI audio output") but that's no biggie.


Anyway, I though I should let you guys know in case you can go back to using Slackware's defaults.

Cheers!
 
2 members found this post helpful.
Old 01-10-2021, 11:37 AM   #11
H1p8r10n
Member
 
Registered: Feb 2016
Location: on the border of milky way
Distribution: Slackware
Posts: 159

Rep: Reputation: Disabled
Great packaging.

I wouldn't be surprised if Pat or Robby add this package in Slackware in the following days...

jp
 
1 members found this post helpful.
Old 01-10-2021, 07:01 PM   #12
Loomx
Member
 
Registered: Sep 2012
Distribution: Slackware
Posts: 184

Rep: Reputation: Disabled
@richarson: great job with the SlackBuild, thanks for that :-)
I made a few changes, then had to make a few more as I must have broken it. Anyway I tried to simplify some of the variables; here are the diffs if you are interested:

sof-firmware.SlackBuild.diff
Code:
--- sof-firmware.SlackBuild.orig	2021-01-11 13:44:30.652992305 +1300
+++ sof-firmware.SlackBuild	2021-01-11 13:52:10.762970270 +1300
@@ -23,9 +23,7 @@
 #  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 PRGNAM="sof-firmware"
-SRCNAM="faa5bdc276651f3f8b7c77612fff770bd778987b"
-VERSION=${VERSION:-1.6.1}
-SRCVER="v1.6"
+VERSION=${VERSION:-v1.6.1}
 BUILD=${BUILD:-1}
 #TAG=${TAG:-_SBo}
 TAG=${TAG:-_RJB}
@@ -64,7 +62,7 @@
 cd $TMP
 rm -rf $PRGNAM-$VERSION
 mkdir -p $PRGNAM-${VERSION}
-tar xf $CWD/${SRCNAM}.tar.gz -C $PRGNAM-${VERSION} --strip-components=1
+tar xf $CWD/${VERSION}.tar.gz -C $PRGNAM-${VERSION} --strip-components=1
 cd $PRGNAM-${VERSION}
 chown -R root:root .
 find -L . \
@@ -74,12 +72,12 @@
   -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
 
 mkdir -p $PKG/lib/firmware/
-mv lib/firmware/intel/sof-tplg-${SRCVER} lib/firmware/intel/sof-tplg
+mv lib/firmware/intel/sof-tplg-${VERSION} lib/firmware/intel/sof-tplg
 cp -a lib/firmware/intel/ $PKG/lib/firmware/
 
 (cd $PKG/lib/firmware/intel/sof
-for i in ${SRCVER}/intel-signed/*.ri ${SRCVER}/*.ri; do
-    f=${i%%-$SRCVER.ri}
+for i in ${VERSION}/intel-signed/*.ri ${VERSION}/*.ri; do
+    f=${i%%-$VERSION.ri}
     f=${f##*/}
     ln -s $i $f.ri
 done
@@ -90,8 +88,8 @@
 
 mkdir -p debug
 cd debug
-for i in ../${SRCVER}/*.ldc; do
-    f=${i%%-$SRCVER.ldc}
+for i in ../${VERSION}/*.ldc; do
+    f=${i%%-$VERSION.ldc}
     f=${f##*/}
     ln -s $i $f.ldc
 done
sof-firmware.info.diff
Code:
--- sof-firmware.info.orig	2021-01-11 13:45:10.261990408 +1300
+++ sof-firmware.info	2021-01-11 13:50:05.182976284 +1300
@@ -1,7 +1,7 @@
 PRGNAM="sof-firmware"
 VERSION="1.6.1"
 HOMEPAGE="https://www.sofproject.org/"
-DOWNLOAD="https://github.com/thesofproject/sof-bin/archive/faa5bdc276651f3f8b7c77612fff770bd778987b.tar.gz"
+DOWNLOAD="https://github.com/thesofproject/sof-bin/archive/v1.6.1.tar.gz"
 MD5SUM="5c5c7f87bc43a2386f6714c7220560b8"
 DOWNLOAD_x86_64=""
 MD5SUM_x86_64=""
@H1p8r10n: I agree, it would be great if this was added (or to SBo)
 
1 members found this post helpful.
Old 01-10-2021, 10:16 PM   #13
richarson
Member
 
Registered: Dec 2020
Location: Argentina
Distribution: Fedora 38 KDE
Posts: 112

Rep: Reputation: Disabled
Quote:
Originally Posted by Loomx View Post
@richarson: great job with the SlackBuild, thanks for that :-)
I made a few changes, then had to make a few more as I must have broken it. Anyway I tried to simplify some of the variables; here are the diffs if you are interested:
Cool mods, Loomx! I'll see to apply them in my repo, thanks

I never thought of downloading with the tag, it really simplifies the script.
 
Old 01-17-2021, 11:53 AM   #14
richarson
Member
 
Registered: Dec 2020
Location: Argentina
Distribution: Fedora 38 KDE
Posts: 112

Rep: Reputation: Disabled
Changes uploaded to my github, if Pat o Robby won't include sof-firmware in Slackware 15.0 I'll submit it to SBo.

Thanks!
 
Old 03-29-2021, 07:05 PM   #15
tux_dude
Member
 
Registered: Dec 2008
Distribution: Slackware64 Current
Posts: 277

Rep: Reputation: 41
Thanks to all here for providing this slack build. For a ThankPad P1, only the firmware was required to get audio working.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ThinkPad audio jack control joboy Linux - Hardware 0 09-02-2011 03:59 AM
Dead audio on Ubuntu 10.1 install on Lenovo Thinkpad R60 Jeff Damm Linux - Laptop and Netbook 2 12-29-2010 02:51 AM
IBM thinkpad 600e type 2645 Fedora 10 no audio cessaro Linux - Newbie 7 09-27-2009 01:54 PM
how to play audio on thinkpad? dublin212 Linux - Hardware 1 04-14-2004 08:07 PM
audio problem with Thinkpad T30 / SUSE 9 ruprecht Linux - Hardware 0 11-25-2003 05:34 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 03:30 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration