WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: [Solved] Sound on ThinkPad T440p  (Read 9161 times)

Offline MikeLockmoore

  • Hero Member
  • *****
  • Posts: 525
  • Good software needn't be big!
[Solved] Sound on ThinkPad T440p
« on: June 04, 2023, 11:39:44 PM »
Hello!  It's been a very a very long time, but I'm the guy that started the "Topside" version of FLWM about 12 years ago, and posted some other FLTK apps like Fluff.  Very recently I decided to try to get back into using TC and maybe even updating my apps and hopefully doing more.

I now have a ThinkPad T440p that's about ten years old but has a nice i7 CPU with lots of RAM.  I started by installing 32-bit TC 14 on it, but I wanted to run TinyCorePure64, so set it  up as a dual boot with 64 and 32 bit versions and have 64-bit the default.  I confirmed with uname I'm running the 64-bit kernel. There's a variety of issues, but a deal-breaker right now is sound.  I have tried to follow the guide posted by @Rich, but I don't get too far before having some issues.

I've installed the recommended ALSA extensions.

In the terminal, when I enter 'alsactl init' I get:
  Found hardware: "HDA-Intel" "Realtek ALC3232" "HDA{NUMBERS}" "0X17AA" "0X220e"
  Hardware is initialized using a generic method

OK, this seems encouraging.  But then I run the suggested speaker-test command, I get
  ALSA lib confmisc.c:767(parse_card) cannot find card '0'
  {several more lines of error message}

Also I checked my Services from the Control Panel and don't see sound / ALSA listed as a service... there are four things and only dhcp is enabled (green).

Any suggestions?  Also, another re-newb question... can I copy/paste text in the default FLTK terminal? Ctrl+C or Ctrl+Shift+C is not working for copy.  I'm also having some trackpad issues so I can't middle-click on this.  Maybe if I plug in an external mouse?

Anyway, thanks to anyone who tries to help me with this!  Nice to see TC still plugging away!
--
Mike "Lockmoore"
« Last Edit: June 06, 2023, 11:56:09 PM by Rich »

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11594
Re: Sound on ThinkPad T440p
« Reply #1 on: June 05, 2023, 12:14:05 AM »
Hi MikeLockmoore
... can I copy/paste text in the default FLTK terminal? ...
Yes you can. I've never tried it with a touch pad. In fact, I disable the touch pad and only use a mouse:
Highlight the text to copy by holding down the left mouse button and dragging the mouse.
Place the mouse cursor where you want to paste the text and left click.
Center click to paste. If you have a 2 button mouse, click left and right buttons at the same time.

Offline MikeLockmoore

  • Hero Member
  • *****
  • Posts: 525
  • Good software needn't be big!
Re: Sound on ThinkPad T440p
« Reply #2 on: June 05, 2023, 12:21:47 AM »
Hi MikeLockmoore
... can I copy/paste text in the default FLTK terminal? ...
Yes you can. ... Center click to paste. If you have a 2 button mouse, click left and right buttons at the same time.

Thanks!  I'll try with an external mouse. 

Any thoughts on my ALSA sound config issue?  I need to head off to sleep very soon, but I'll check back tomorrow.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11594
Re: Sound on ThinkPad T440p
« Reply #3 on: June 05, 2023, 12:35:57 AM »
Hi MikeLockmoore
I just did a quick install of alsa on a HP G42 laptop.
I installed  alsa-config  and  alsa  in that order.
I then ran:
Code: [Select]
tc@box:~$ alsactl init
Found hardware: "HDA-Intel" "Realtek ALC270" "HDA:10ec0270,103c1444,00100100" "0x103c" "0x1444"
Hardware is initialized using a generic method
tc@box:~$ speaker-test [-Ddefault:1] -c2 -t wav -l1

speaker-test 1.2.1

Playback device is default
Stream parameters are 48000Hz, S16_LE, 2 channels
WAV file(s)
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 2048 to 16384
Period size range from 1024 to 1024
Using max buffer size 16384
Periods = 4
was set period_size = 1024
was set buffer_size = 16384
 0 - Front Left
 1 - Front Right
Time per period = 2.678126
tc@box:~$
and heard the phrases  Front Left  and  Front Right  from their respective speakers.

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11044
Re: Sound on ThinkPad T440p
« Reply #4 on: June 05, 2023, 01:49:22 AM »
I think the default key combo to paste in a terminal was shift-insert. Trackpads without a middle button can paste with left+right, or if using Xorg and the synaptics driver, you can configure a three-finger tap to be a middle click.

edit: have you installed the thinkpad-acpi extension? It's unlikely it affects sound, but being thinkpad-specific would be good anyway.
edit 2: you may be having the issue where HDMI output is marked as the default sound card, possibly. See "aplay -l" and "aplay -L".
« Last Edit: June 05, 2023, 01:52:27 AM by curaga »
The only barriers that can stop you are the ones you create yourself.

aus9

  • Guest
Re: Sound on ThinkPad T440p
« Reply #5 on: June 05, 2023, 04:13:42 AM »
Hi MikeLockmoore
I now use link method to disable hdmi sound to have analog if that interests you
http://forum.tinycorelinux.net/index.php/topic,26153.msg168085.html#msg168085

Offline vinceASPECT

  • Hero Member
  • *****
  • Posts: 800
Re: Sound on ThinkPad T440p
« Reply #6 on: June 05, 2023, 11:06:23 AM »
HEllo  forum,

Right. 

i  believe  Linux uses  .........Pulse Audio...... or Alsa....... or OSS.
to  create  sound.

Yes,  devices could have multiple sound parts.....INPUTS .......output(s) such as hdmi which carry's a sound signal.......

The Linux usually does some sort of scan of Device Sound capability 
.......via ALSACONF  and an APP.

Linux then lists what devices it sees and can support for you to get sound.

You choose a device and then configure THAT item to get sound from it.


THere are some small 50 cent USB soundcards which give sound to any device really......they are sold on the world wide web (mail order)

There are some APPS (abstract) for handhelds..............the app will grab a Devices SOUND....... and beam it over network to your handheld device sound OUT socket or method......

"Soundwire" (is such a FRE aPP on android)

...........intel  drivers do many embedded sound devices.

THx
C
« Last Edit: June 05, 2023, 11:14:29 AM by vinceASPECT »

Offline MikeLockmoore

  • Hero Member
  • *****
  • Posts: 525
  • Good software needn't be big!
Re: Sound on ThinkPad T440p
« Reply #7 on: June 05, 2023, 01:11:25 PM »
edit 2: you may be having the issue where HDMI output is marked as the default sound card, possibly. See "aplay -l" and "aplay -L".

Here is my aplay -l
Code: [Select]
**** List of PLAYBACK Hardware Devices ****
card 1: PCH [HDA Intel PCH], device 0: ALC3232 Analog [ALC3232 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

Here is aplay -L
Code: [Select]
default:CARD=PCH
    HDA Intel PCH, ALC3232 Analog
    Default Audio Device
sysdefault:CARD=PCH
    HDA Intel PCH, ALC3232 Analog
    Default Audio Device
front:CARD=PCH,DEV=0
    HDA Intel PCH, ALC3232 Analog
    Front speakers
surround21:CARD=PCH,DEV=0
    HDA Intel PCH, ALC3232 Analog
    2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=PCH,DEV=0
    HDA Intel PCH, ALC3232 Analog
    4.0 Surround output to Front and Rear speakers
surround41:CARD=PCH,DEV=0
    HDA Intel PCH, ALC3232 Analog
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=PCH,DEV=0
    HDA Intel PCH, ALC3232 Analog
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=PCH,DEV=0
    HDA Intel PCH, ALC3232 Analog
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=PCH,DEV=0
    HDA Intel PCH, ALC3232 Analog
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers

I now use link method to disable hdmi sound to have analog if that interests you
http://forum.tinycorelinux.net/index.php/topic,26153.msg168085.html#msg168085
Here is modinfo snd_hda_intel | grep snd:
Code: [Select]
filename:       /lib/modules/6.1.2-tinycore64/kernel.tclocal/sound/pci/hda/snd-hda-intel.ko.gz
parm:           dmic_detect:Allow DSP driver selection (bypass this driver) (0=off, 1=on) (default=1); deprecated, use snd-intel-dspcfg.dsp_driver option instead
depends:        snd-hda-core,snd-hda-codec,snd,snd-intel-dspcfg,snd-pcm

Curaga, aus9: Thanks for your suggestions. Do you see anything in the specifics above that I should try?  I don't see anything about HDMI, so I don't know if that's my issue, but maybe I'm not looking at it right.  Thanks again!

aus9

  • Guest
Re: Sound on ThinkPad T440p
« Reply #8 on: June 05, 2023, 09:48:49 PM »
Hi

lets start with your codec since my first link failed to give you card0 or index=0

https://www.kernel.org/doc/html/v4.14/sound/hd-audio/models.html
Quote
ALC22x/23x/25x/269/27x/28x/29x (and vendor-specific ALC3xxx models)
SNIP
tpt440
    Lenovo Thinkpad T440s setup
SNIp

Yes there is no 440p so finger crossed

right so delete all modprobes in bootlocal....full reboot to be sure.

post full output for (ignore capital -L at this stage)
Code: [Select]
aplay -l
if raw (no config) shows hdmi is card0 then try this bootlocal
Quote
modprobe -r  snd_hda_intel
modprobe     snd_hda_intel options  model=tpt440

2) The following info may not be accurate for your specific model
for your ids 0X17AA 0X220e
https://linux-hardware.org/?probe=154ba4022c&log=hwinfo
Quote
Vendor: pci 0x8086 "Intel Corporation"
Device: pci 0x8c20 "8 Series/C220 Series Chipset High Definition Audio Controller"
SubVendor: pci 0x17aa "Lenovo"
SubDevice: pci 0x220e "ThinkPad T440p"

we have a match for ids
Code: [Select]
modinfo snd_hda_intel | grep 8C20
alias:          pci:v00008086d00008C20sv*sd*bc*sc*i*

3) I do not know what effect that model setup is going to do, so I am leaving out disable card=0 assuming its hdmi
post your new aplay -l if it differs from raw one please. Then you can decide to add enable=0 or not
and test speaker-test of course
« Last Edit: June 05, 2023, 09:54:19 PM by aus9 »

aus9

  • Guest
Re: Sound on ThinkPad T440p
« Reply #9 on: June 05, 2023, 11:26:09 PM »
I forgot to mention, I was focussing on attempting to disable hdmi to give you a result for speaker-test.
but what you are focussing on is to get sound ....and I accept if my method half succeeds, lets not worry about index=0 and instead,
if you like....install pulsaudio and pavucontrol....read their info files.

pavucontrol will allow you to swap your preferred output device. Maxmise the GUI so you can see all the TABS

Offline MikeLockmoore

  • Hero Member
  • *****
  • Posts: 525
  • Good software needn't be big!
Re: Sound on ThinkPad T440p
« Reply #10 on: June 06, 2023, 12:09:31 AM »
delete all modprobes in bootlocal....full reboot to be sure.

post full output for (ignore capital -L at this stage)
Code: [Select]
aplay -l

I don't have any modprobe calls in bootlocal:
Code: [Select]
tc@box:/opt$ cat bootlocal.sh
#!/bin/sh
# put other system startup commands here
/opt/eth0.sh &
/usr/local/bin/wifi-connect &

Quote
post full output for (ignore capital -L at this stage)
Code: [Select]

aplay -l

OK... my aplay -l is
Code: [Select]
**** List of PLAYBACK Hardware Devices ****
card 1: PCH [HDA Intel PCH], device 0: ALC3232 Analog [ALC3232 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

Which is what it was before, if I'm not mistaken.

I manually tried (in terminal, not bootlocal.sh):
Code: [Select]
modprobe -r  snd_hda_intel
modprobe     snd_hda_intel options  model=tpt440

But I was not able to get any sound from speaker-test and got the same kind of errors I had before.

The really weird thing is there seems to be no card0...
I dug around a bit in my sys/ filesystem.  i have these:

/sys/module/snd/                                  /sys/module/snd_hda_intel/
/sys/module/snd_ctl_led/                       /sys/module/snd_hwdep/
/sys/module/snd_hda_codec/                /sys/module/snd_intel_dspcfg/
/sys/module/snd_hda_codec_generic/    /sys/module/snd_pcm/
/sys/module/snd_hda_codec_realtek/     /sys/module/snd_timer/
/sys/module/snd_hda_core/

I tried to look around, but I don't see anything that is claiming to be card0.  I do see a rat's nest of symlinks that recurse in a crazy way.   ???

Not getting much further with ALSA, I'm afraid!  Thanks for the links... maybe I can get some more clues from them.

I forgot to mention, I was focussing on attempting to disable hdmi to give you a result for speaker-test.
but what you are focussing on is to get sound ....and I accept if my method half succeeds, lets not worry about index=0 and instead,
if you like....install pulsaudio and pavucontrol....read their info files.

pavucontrol will allow you to swap your preferred output device. Maxmise the GUI so you can see all the TABS

I suppose I can try PulseAudio tomorrow or the next day!
--
Mike

aus9

  • Guest
Re: Sound on ThinkPad T440p
« Reply #11 on: June 06, 2023, 01:22:36 AM »
Hi
no card0? the hardware data submitter had such so weird!

I have a new link for you to study and curaga hinted at solution too
Quote
have you installed the thinkpad-acpi extension? It's unlikely it affects sound, but being thinkpad-specific would be good anyway.
For the moment I think its safe to have this in your boot list if curaga agrees?
to be rude....it NOW must be installed to have relevance below solution to try

2) Do this all by commands---we can sort it out later scripts/boot list and other configs later
so remove all sound packages (except thinkpad) and media players from your boot list please

Read link
https://github.com/xbelanch/Arch4T440P/blob/main/arch_4_t440p_installation.md

Notice that they are loading alsa-utils alsa-plugins alsa-lib pavucontrol
so we will do the same but in a different order due to dependencies
Code: [Select]
tce-load -i  alsa-config alsa-plugins pavucontrol
When you look at our deps...alsa-config contains alsa-utils
alsa-plugins has deps including alsa & libasound plus others
 pavucontrol has dep of pulseaudio

Next  we become root for these comands
Code: [Select]
sudo su
modprobe -r  snd_hda_intel
modprobe     snd_hda_intel options enable=0,1 index=0
modprobe -r snd
modprobe snd options slots=snd_hda_intel, thinkpad_acpi
modprobe -r thinkpad_acpi
modprobe  thinkpad_acpi thinkpad_acpi index=1

Warning I have never done a parameter for snd kernel module so not sure if it works without a removal and modprobe

next run
Code: [Select]
aplay -l
as hinted by curaga, its possible if you had that thinkpad module loaded, it was stealing card0 slot

do we have card0?
« Last Edit: June 06, 2023, 01:25:46 AM by aus9 »

Offline MikeLockmoore

  • Hero Member
  • *****
  • Posts: 525
  • Good software needn't be big!
Re: Sound on ThinkPad T440p
« Reply #12 on: June 06, 2023, 11:00:42 PM »
Hi
no card0? the hardware data submitter had such so weird!

I have a new link for you to study and curaga hinted at solution too
...
Code: [Select]
tce-load -i  alsa-config alsa-plugins pavucontrol
...

Next  we become root for these comands
Code: [Select]
sudo su
modprobe -r  snd_hda_intel
modprobe     snd_hda_intel options enable=0,1 index=0
modprobe -r snd
modprobe snd options slots=snd_hda_intel, thinkpad_acpi
modprobe -r thinkpad_acpi
modprobe  thinkpad_acpi thinkpad_acpi index=1

...

Code: [Select]
aplay -l
...
do we have card0?

YES!  There were a few issues in the modprobe commands (see below), but at the end of it, I have a card0 and I could run the 'speaker-test [-Ddefault:1] -c2 -t wav -l1' test and hear sound! Thanks! 

Now, I need to figure out what was necessary in these commands to make it work.  Pulling in PulseAudio or maybe just some of the modprobe commands are needed to sort out the device drivers, or perhaps almost all of it.  I'll study the link you included to understand things a bit better. 

Log of the commands and responses:
Code: [Select]
tc@box:~$ tce-load -i alsa-config alsa-plugins pavucontrol
libpci.tcz: OK
pciutils.tcz: OK
alsa-config.tcz: OK
alsa-plugins.tcz not found!
tc@box:~$ tce-load -i alsa-config alsa-plugins pavucontrol
alsa-config is already installed!
ncursesw.tcz: OK
alsa.tcz: OK
alsa-plugins.tcz: OK
libsigc++.tcz: OK
glibmm.tcz: OK
cairomm.tcz: OK
pangomm.tcz: OK
atkmm.tcz: OK
gtkmm.tcz: OK
libavahi.tcz: OK
libltdl.tcz: OK
libogg.tcz: OK
speex.tcz: OK
speexdsp.tcz: OK
libvorbis.tcz: OK
flac.tcz: OK
libsndfile.tcz: OK
libpulseaudio.tcz: OK
pulseaudio.tcz: OK
libcanberra.tcz: OK
pavucontrol.tcz: OK

tc@box:~$ sudo su
root@box:/home/tc# modprobe -r snd_hda_intel
root@box:/home/tc# modprobe snd_hda_intel options enable=0,1 index=0
root@box:/home/tc# modprobe -r snd
modprobe: can't unload module 'snd': Resource temporarily unavailable
root@box:/home/tc# modprobe snd options slots=snd_hda_intel, thinkpad_acpi
root@box:/home/tc# modprobe -r thinkpad_acpi
root@box:/home/tc# modprobe thinkpad_acpi thinkpad_acpi index=1
modprobe: can't load module thinkpad_acpi (kernel.tclocal/drivers/platform/x86/thinkpad_acpi.ko.gz): unknown symbol in module, or unknown parameter
root@box:/home/tc# modprobe -r thinkpad_acpi
root@box:/home/tc# modprobe thinkpad_acpi thinkpad_acpi index=1
modprobe: can't load module thinkpad_acpi (kernel.tclocal/drivers/platform/x86/thinkpad_acpi.ko.gz): unknown symbol in module, or unknown parameter

root@box:/home/tc# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: ALC3232 Analog [ALC3232 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: PCH [HDA Intel PCH], device 0: ALC3232 Analog [ALC3232 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

root@box:/home/tc# speaker-test [-Ddefault:1] -c2 -t wav -l1

speaker-test 1.2.1

Playback device is default
Stream parameters are 48000Hz, S16_LE, 2 channels
WAV file(s)
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 2048 to 16384
Period size range from 1024 to 1024
Using max buffer size 16384
Periods = 4
was set period_size = 1024
was set buffer_size = 16384
 0 - Front Left
 1 - Front Right
Time per period = 2.685371

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11594
Re: Sound on ThinkPad T440p
« Reply #13 on: June 06, 2023, 11:40:15 PM »
Hi MikeLockmoore
...
Code: [Select]
root@box:/home/tc# modprobe thinkpad_acpi thinkpad_acpi index=1
modprobe: can't load module thinkpad_acpi (kernel.tclocal/drivers/platform/x86/thinkpad_acpi.ko.gz): unknown symbol in module, or unknown parameter
...
I suspect that may be a typo. I think it should probably be:
Code: [Select]
root@box:/home/tc# modprobe thinkpad_acpi index=1

Offline MikeLockmoore

  • Hero Member
  • *****
  • Posts: 525
  • Good software needn't be big!
Re: Sound on ThinkPad T440p
« Reply #14 on: June 06, 2023, 11:51:59 PM »
Hi MikeLockmoore
...
I suspect that may be a typo. I think it should probably be:
Code: [Select]
root@box:/home/tc# modprobe thinkpad_acpi index=1

Ahh, that makes more sense, especially now that I've skimmed the linked blog for an Arch install on a T440p.  The typo must not be fatal, but perhaps setting that correctly will help with other machine-specific things, so I'll update and set it correctly in my bootlocal.sh script. 

Before this last change, I put the other modprobe commands in my bootlocal.sh script and re-installed alsa-config.tcz, alsa-plugins.tcz, pulseaudio.tcz, and pavucontrol.tcz and set those to be loaded onboot.  I'm able to reboot now and have sound working!  Speaker-test works and I can play Youtube vids in FireFox and hear their audio.  The PulseAudio VU Control app allowed me to change the volume.

So, overall, I think my issue is solved!  Thanks @Rich, @aus9, @curaga, and @vinceASPECT to jumping in to help me!

Can I edit the title of the thread to show SOLVED?  I don't see a way to edit that (so far).