[950SBE/951SBE, Realtek ALC298, Speaker, Internal] No sound on internal speakers, very very quiet on headphones

Bug #1851518 reported by Martin S
56
This bug affects 10 people
Affects Status Importance Assigned to Milestone
Linux
New
Undecided
Unassigned
linux (Ubuntu)
Undecided
Unassigned

Bug Description

I've been googling this issue for 10's of hours and tried many things.

Relase of Ubuntu: 19.10

Expected outcome: Music plays on the internal speakers and headphones.

Actual outcome: I can barely hear audio using headphones with volume turned up to 150%. Absolutely nothing comes out of the speakers. (The speakers sound great under Windows 10.)

Complete alsa-info output is attached, but here are some snippets:

!!DMI Information
!!---------------

Manufacturer: SAMSUNG ELECTRONICS CO., LTD.
Product Name: 950SBE/951SBE
Product Version: P06RES
Firmware Version: P06RES.075.190529.SP
Board Vendor: SAMSUNG ELECTRONICS CO., LTD.
Board Name: NP950SBE-K01US

!!Kernel Information
!!------------------

Kernel release: 5.3.0-19-generic
Operating System: GNU/Linux
Architecture: x86_64
Processor: x86_64
SMP Enabled: Yes

!!ALSA Version
!!------------

Driver version: k5.3.0-19-generic
Library version: 1.1.9
Utilities version: 1.1.9

!!Loaded ALSA modules
!!-------------------

snd_hda_intel

!!Sound Servers on this system
!!----------------------------

Pulseaudio:
      Installed - Yes (/usr/bin/pulseaudio)
      Running - Yes

!!Soundcards recognised by ALSA
!!-----------------------------

 0 [PCH ]: HDA-Intel - HDA Intel PCH
                      HDA Intel PCH at 0x604b118000 irq 177

!!PCI Soundcards installed in the system
!!--------------------------------------

00:1f.3 Multimedia audio controller: Intel Corporation Cannon Point-LP High Definition Audio Controller (rev 11)

!!Advanced information - PCI Vendor/Device/Subsystem ID's
!!-------------------------------------------------------

00:1f.3 0401: 8086:9dc8 (rev 11)
        DeviceName: Onboard - Sound

!!HDA-Intel Codec information
!!---------------------------
--startcollapse--

Codec: Realtek ALC298
Address: 0
AFG Function Id: 0x1 (unsol 1)
Vendor Id: 0x10ec0298
Subsystem Id: 0x144dc812
Revision Id: 0x100103
No Modem Function Group found
Default PCM:
    rates [0x60]: 44100 48000
    bits [0xe]: 16 20 24
    formats [0x1]: PCM
Default Amp-In caps: N/A
Default Amp-Out caps: N/A
State of AFG node 0x01:
  Power states: D0 D1 D2 D3 D3cold CLKSTOP EPSS
  Power: setting=D0, actual=D0
GPIO: io=8, o=0, i=0, unsolicited=1, wake=0
  IO[0]: enable=0, dir=0, wake=0, sticky=0, data=0, unsol=0
  IO[1]: enable=0, dir=0, wake=0, sticky=0, data=0, unsol=0
  IO[2]: enable=0, dir=0, wake=0, sticky=0, data=0, unsol=0
  IO[3]: enable=0, dir=0, wake=0, sticky=0, data=0, unsol=0
  IO[4]: enable=0, dir=0, wake=0, sticky=0, data=0, unsol=0
  IO[5]: enable=0, dir=0, wake=0, sticky=0, data=0, unsol=0
  IO[6]: enable=0, dir=0, wake=0, sticky=0, data=0, unsol=0
  IO[7]: enable=0, dir=0, wake=0, sticky=0, data=0, unsol=0
Node 0x02 [Audio Output] wcaps 0x41d: Stereo Amp-Out
  Control: name="Headphone Playback Volume", index=0, device=0
    ControlAmp: chs=3, dir=Out, idx=0, ofs=0
  Device: name="ALC298 Analog", type="Audio", device=0
  Amp-Out caps: ofs=0x7f, nsteps=0x7f, stepsize=0x01, mute=0
  Amp-Out vals: [0x00 0x00]
  Converter: stream=1, channel=0
  PCM:
    rates [0x60]: 44100 48000
    bits [0xe]: 16 20 24
    formats [0x1]: PCM
  Power states: D0 D1 D2 D3 EPSS
  Power: setting=D0, actual=D0
Node 0x03 [Audio Output] wcaps 0x41d: Stereo Amp-Out
  Control: name="Speaker Playback Volume", index=0, device=0
    ControlAmp: chs=3, dir=Out, idx=0, ofs=0
  Amp-Out caps: ofs=0x7f, nsteps=0x7f, stepsize=0x01, mute=0
  Amp-Out vals: [0x7f 0x7f]
  Converter: stream=1, channel=0

ProblemType: Bug
DistroRelease: Ubuntu 19.10
Package: alsa-base 1.0.25+dfsg-0ubuntu5
ProcVersionSignature: Ubuntu 5.3.0-19.20-generic 5.3.1
Uname: Linux 5.3.0-19-generic x86_64
ApportVersion: 2.20.11-0ubuntu8.2
Architecture: amd64
AudioDevicesInUse:
 USER PID ACCESS COMMAND
 /dev/snd/controlC0: martin 1383 F.... pulseaudio
CurrentDesktop: ubuntu:GNOME
Date: Wed Nov 6 06:20:08 2019
InstallationDate: Installed on 2019-11-03 (3 days ago)
InstallationMedia: Ubuntu 19.10 "Eoan Ermine" - Release amd64 (20191017)
PackageArchitecture: all
ProcEnviron:
 TERM=xterm-256color
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: alsa-driver
Symptom: audio
Symptom_AlsaPlaybackTest: ALSA playback test through plughw:PCH failed
Symptom_Card: Built-in Audio - HDA Intel PCH
Symptom_DevicesInUse:
 USER PID ACCESS COMMAND
 /dev/snd/controlC0: martin 1383 F.... pulseaudio
Symptom_Jack: Speaker, Internal
Symptom_Type: No sound at all
Title: [950SBE/951SBE, Realtek ALC298, Speaker, Internal] No sound at all
UpgradeStatus: No upgrade log present (probably fresh install)
dmi.bios.date: 05/29/2019
dmi.bios.vendor: American Megatrends Inc.
dmi.bios.version: P06RES.075.190529.SP
dmi.board.asset.tag: No Asset Tag
dmi.board.name: NP950SBE-K01US
dmi.board.vendor: SAMSUNG ELECTRONICS CO., LTD.
dmi.board.version: SGL9849A0Q-C01-G003-S0001+10.0.17763
dmi.chassis.asset.tag: No Asset Tag
dmi.chassis.type: 31
dmi.chassis.vendor: SAMSUNG ELECTRONICS CO., LTD.
dmi.chassis.version: N/A
dmi.modalias: dmi:bvnAmericanMegatrendsInc.:bvrP06RES.075.190529.SP:bd05/29/2019:svnSAMSUNGELECTRONICSCO.,LTD.:pn950SBE/951SBE:pvrP06RES:rvnSAMSUNGELECTRONICSCO.,LTD.:rnNP950SBE-K01US:rvrSGL9849A0Q-C01-G003-S0001+10.0.17763:cvnSAMSUNGELECTRONICSCO.,LTD.:ct31:cvrN/A:
dmi.product.family: Notebook 9 Series
dmi.product.name: 950SBE/951SBE
dmi.product.sku: SCAI-A5A5-A5A5-A5A5-PRES
dmi.product.version: P06RES
dmi.sys.vendor: SAMSUNG ELECTRONICS CO., LTD.
mtime.conffile..etc.modprobe.d.alsa-base.conf: 2019-11-05T23:13:55.854413

Revision history for this message
Martin S (martins4321) wrote :
Revision history for this message
Filipe Garrett (wowbaggerbr) wrote :

I have a very similar issue with another Samsung laptop: https://bugs.launchpad.net/ubuntu/+source/alsa-driver/+bug/1850702

Revision history for this message
Hui Wang (hui.wang) wrote :

Please collect an alsa-info.txt with coeff dumped:

sudo su
echo 1 > /sys/module/snd_hda_codec/parameters/dump_coef
then run alsa-info and upload the log.

thx.

Revision history for this message
Martin S (martins4321) wrote :

In the last few days, I've tried a few more things (incl. re-installing alsa, pulseaudio multiple times), but still have the same issue: headphones are extremely quiet, and nothing coming out of the internal speakers. The alsa-info with coefficients is attached.

Thanks for looking.

Revision history for this message
Hui Wang (hui.wang) wrote :

I will find a machine wit alc298 next week, and compare the coeff with your machine.

thx.

Revision history for this message
Martin S (martins4321) wrote :

Made a little progress: headphones work with
/etc/modprobe.d/alsa-base.conf:
options snd-hda-intel model=mono-speakers

Volume is loud and clear, in stereo!

alsa-info.sh output is attached with coefficients. Headphones were not plugged in at that time to keep the diffs to a minimum.

Revision history for this message
Hui Wang (hui.wang) wrote :

Please test:
options snd-hda-intel model=headset-mode-no-hp-mic

Revision history for this message
Martin S (martins4321) wrote :

Using options snd-hda-intel model=headset-mode-no-hp-mic

Result:
Headphones: very very quiet
Internal speakers: Nothing

Alsa-info is attached.

Thank you.

Revision history for this message
Hui Wang (hui.wang) wrote :

Please remove the model=xxxx or keep model=headset-mode-no-hp-mic

When headphone is very very quiet, please run:
sudo hda-verb /dev/snd/hwC0D0 0x20 SET_COEF_INDEX 0x8e
sudo hda-verb /dev/snd/hwC0D0 0x20 SET_PROC_COEF 0x20
//check if headphone can output sound normally?

sudo hda-verb /dev/snd/hwC0D0 0x20 SET_COEF_INDEX 0x19
sudo hda-verb /dev/snd/hwC0D0 0x20 SET_PROC_COEF 0x317
//check if headphone can output sound normally?

sudo hda-verb /dev/snd/hwC0D0 0x20 SET_COEF_INDEX 0x67
sudo hda-verb /dev/snd/hwC0D0 0x20 SET_PROC_COEF 0x1110
//check if headphone can output sound normally?

sudo hda-verb /dev/snd/hwC0D0 0x20 SET_COEF_INDEX 0x4f
sudo hda-verb /dev/snd/hwC0D0 0x20 SET_PROC_COEF 0xc429
//check if headphone can output sound normally?

Revision history for this message
Martin S (martins4321) wrote :

Hi,
I was surprised, but none of these settings helped. Mode was set originally to
options snd-hda-intel model=headset-mode-no-hp-mic

sudo hda-verb /dev/snd/hwC0D0 0x20 SET_COEF_INDEX 0x8e
sudo hda-verb /dev/snd/hwC0D0 0x20 SET_PROC_COEF 0x20
//check if headphone can output sound normally?

Running speaker-test:
very very quiet

sudo hda-verb /dev/snd/hwC0D0 0x20 SET_COEF_INDEX 0x19
sudo hda-verb /dev/snd/hwC0D0 0x20 SET_PROC_COEF 0x317
//check if headphone can output sound normally?

same result

sudo hda-verb /dev/snd/hwC0D0 0x20 SET_COEF_INDEX 0x67
sudo hda-verb /dev/snd/hwC0D0 0x20 SET_PROC_COEF 0x1110
//check if headphone can output sound normally?

same result

sudo hda-verb /dev/snd/hwC0D0 0x20 SET_COEF_INDEX 0x4f
sudo hda-verb /dev/snd/hwC0D0 0x20 SET_PROC_COEF 0xc429
//check if headphone can output sound normally?

same result

Revision history for this message
Martin S (martins4321) wrote :

FYI: I just re-tested with model=mono-speakers, and there the headhpone output likewise does not change for any of the above settings: it works great the entire time.

Thanks,
Martin

Revision history for this message
Hui Wang (hui.wang) wrote :

Ah, please test model=dell-headset3, it should work.

And please also add options snd-hda-codec-realtek dyndbg, then boot the system without the headphone plugged.

after boot up, plug headphone, and test if it works well. If it works well, please upload the dmesg.

thx.

Revision history for this message
Hui Wang (hui.wang) wrote :

And for speaker's issue, please verify that both speaker and headphone work well under windows, then using this tool to collect a log under windows, the log is a useful reference for linux.

thx.

Revision history for this message
Martin S (martins4321) wrote :

<<<<<<<<<<<<<<<<<<<
Ah, please test model=dell-headset3, it should work.

And please also add options snd-hda-codec-realtek dyndbg, then boot the system without the headphone plugged.

after boot up, plug headphone, and test if it works well. If it works well, please upload the dmesg.
>>>>>>>>>>>>>>>>>>>>

Yes, headphones work well. dmesg output is attached.

Thank you.

Revision history for this message
Hui Wang (hui.wang) wrote :

If you have time, please run #13 on the windows10.

And If you have time, please redo the test of #10, after finishing all commands, please generate an alsa-info.txt-with-coeff, let us check if all those commands successfully executed.

Revision history for this message
Martin S (martins4321) wrote :

>>>>>>>>>>>>>>>>>>>>>
please verify that both speaker and headphone work well under windows, then using this tool to collect a log under windows, the log is a useful reference for linux.
<<<<<<<<<<<<<<<<<<<<<

Output attached; looks like this might be helpful to get the speakers to work.

Thank you,
Martin

Revision history for this message
Martin S (martins4321) wrote :

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
nd If you have time, please redo the test of #10, after finishing all commands, please generate an alsa-info.txt-with-coeff, let us check if all those commands successfully executed.
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

Option: dell-headset3
Headphone works, and does not seem to change when any of the below settings are applied. alsa-info output attached; it was generated after the last command in the sequence.

martin@martins-samsung:~$ sudo hda-verb /dev/snd/hwC0D0 0x20 SET_COEF_INDEX 0x8e
nid = 0x20, verb = 0x500, param = 0x8e
value = 0x0
martin@martins-samsung:~$ sudo hda-verb /dev/snd/hwC0D0 0x20 SET_PROC_COEF 0x20
nid = 0x20, verb = 0x400, param = 0x20
value = 0x0

>>>>>>>> NO change

martin@martins-samsung:~$ sudo hda-verb /dev/snd/hwC0D0 0x20 SET_COEF_INDEX 0x19
nid = 0x20, verb = 0x500, param = 0x19
value = 0x0
martin@martins-samsung:~$ sudo hda-verb /dev/snd/hwC0D0 0x20 SET_PROC_COEF 0x317
nid = 0x20, verb = 0x400, param = 0x317
value = 0x0

>>>>>>>> NO change

martin@martins-samsung:~$ sudo hda-verb /dev/snd/hwC0D0 0x20 SET_COEF_INDEX 0x67
nid = 0x20, verb = 0x500, param = 0x67
value = 0x0
martin@martins-samsung:~$ sudo hda-verb /dev/snd/hwC0D0 0x20 SET_PROC_COEF 0x1110
nid = 0x20, verb = 0x400, param = 0x1110
value = 0x0

>>>>>>>> NO change

martin@martins-samsung:~$ sudo hda-verb /dev/snd/hwC0D0 0x20 SET_COEF_INDEX 0x4f
nid = 0x20, verb = 0x500, param = 0x4f
value = 0x0
martin@martins-samsung:~$ sudo hda-verb /dev/snd/hwC0D0 0x20 SET_PROC_COEF 0xc429
nid = 0x20, verb = 0x400, param = 0xc429
value = 0x0

>>>>>>>> NO change

Thanks,
Martin

Revision history for this message
Martin S (martins4321) wrote :

Attachment to #17 was incorrect (forgot to turn on coefficients)

Attached is alsa-info with coefficients.

Revision history for this message
Hui Wang (hui.wang) wrote :

Please remove any modle=xxxx from alsa-base.conf

Install the testing kernel and reboot, then test headphone and speaker with the testing kernel.
https://people.canonical.com/~hwang4/samsung-test/
(to install the testing kernel, sudo dpkg -i linux-modules-xxx.deb; sudo dpkg -i linux-image-xxx.deb; sudo dpkg -i linux-modules-extra-xxxx.deb)

If headphone and speaker still don't work, please run this script and retest the headphone and speaker again.

then upload the dmesg and alsa-info.txt-with-coeff

Revision history for this message
Martin S (martins4321) wrote :

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Install the testing kernel and reboot,
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

Couldn't boot after installing all 3 .deb's:

error: /boot/vmlinuz-5.3.0.23.25+samsung-test-generic has invalid signature
error: you need to load the kernel first

Press any key to continue...

Revision history for this message
Martin S (martins4321) wrote :

Hi,

1) Steps:
- Removed the option model=
- Rebooted
- turned off Secure Boot and booted with your test kernel.

Result:
No sound from speakers.
Very very quiet headphones.

2) Steps:
sudo set-coeff.sh
sudo su
echo 1 > /sys/module/snd_hda_codec/parameters/dump_coef

Result:
No sound from speakers.
Very very quiet headphones.

alsa-info is attached.

Thanks,
Martin

Revision history for this message
Martin S (martins4321) wrote :

dmesg output attached from #21, step 2)

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in alsa-driver (Ubuntu):
status: New → Confirmed
Revision history for this message
Klaus Ahrenberg (klausahrenberg) wrote :

I own model NT950SBE, same issue: No sound at headphones and speaker. I tried Ubuntu and Manjaro with latest kernels - no progress. After changing Alss-config according to post #6, haedphones are working now. Thanks.

/etc/modprobe.d/alsa-base.conf:
options snd-hda-intel model=mono-speakers

I attach my Realtek dump-file made in Windows. Hope that helps a bit to get a solution for the problem.

Revision history for this message
Terry Magnus Drever (terrymagnusdrever) wrote :

I have exactly the same problem on a Samsung Galaxy Flex Book.

Headphones are working with the following
options snd-hda-intel model=mono-speakers

Speakers do not work.

Revision history for this message
Terry Magnus Drever (terrymagnusdrever) wrote :

Attached my realtek dump.

Revision history for this message
Duke Fong (duke-c) wrote :

Same problem with Samsung Galaxy Book Flex 930QCG.

The Samsung Galaxy Chromebook and Galaxy Book Flex look very similar, the sound chip should be the same, the Chromebook is open source and also uses the Linux kernel, can we refer to the Chromebook code?

Revision history for this message
Mike Pozulp (gannon1) wrote :

Exactly the same problem with Samsung Notebook 9 Pro (np930mbe-k04us) which also has an ALC298.

Headphones are working with model=mono-speakers.

I attached my Realtek dump.

I'm also soliciting the arch forum for help (I'm running arch):

https://bbs.archlinux.org/viewtopic.php?pid=1897858

Revision history for this message
Mike Pozulp (gannon1) wrote :

I attached the Realtek dump with my headphones plugged into the jack for comparison.

Revision history for this message
ironincoder (ironincoder) wrote :

I have been trying to get ALC298 working for a while now and wanted to share my findings. This issue exist on all distros and is an ALSA problem (not pulseaudio). Verified it when found a fix for the headphone by using the kernel's early patching feature. To use this feature, write a simple patch (instructions here https://www.kernel.org/doc/html/v5.0/sound/hd-audio/notes.html):

[codec]
0x10ec0298 0x144dc169 0

[model]
auto

[verb]
0x1a 0x707 0xc5

and save it as /lib/firmware/alc298-sound-patch.fw then save:

options snd-hda-intel patch=alc298-sound-patch.fw,alc298-sound-patch.fw,alc298-sound-patch.fw,alc298-sound-patch.fw

to /etc/modprobe.d/alc298-sound-patch.conf

Then reboot the machine and try your headphones. Next speakers! unfortunately all three mixer pins in the hda codec are set to mute and I'm working like a maniac to find a way of unmuting them, hoping that would fix the speakers. Hope this helps someone.

Went from web development to system development over this issue. Some may call that progress!

Revision history for this message
ironincoder (ironincoder) wrote :

Here's the full procedure to fix the headphones.

Step 1: Do the patch above, you can skip the [model] line if you wish since I found it had no effects on anything. Please note that the subsystem id can be different for various laptops (lenovo samsung etc...) so make sure you have the correct <vendor id> <subsystem id> <codec index> for the [codec] line values. To get these three values you can use https://github.com/jeremycline/hda-analyzer which requires python2 and pygtk module to run correctly. Another way is to use `sudo alsa-info.sh` command from terminal (press n when asked to upload information) to find the values. It will create a file under tmp folder which you can open via sudo vi or nano. Inside the file is a line !!HDA-Intel Codec information under which you will find the 3 values required for early patch to work, here's mine:
...
Address: 0
AFG Function Id: 0x1 (unsol 1)
Vendor Id: 0x10ec0298
Subsystem Id: 0x144dc169
...

PS: if you experience issues with typing in firefox/chromium then add the variable mentioned at the beginning of this post and restart.

PS2: if you are a hero, then see gannon's C patch doing this same thing in a more reliable way (custom kernel).

Revision history for this message
ironincoder (ironincoder) wrote :

for got the variable for browsers fix (if it happens to you). Add `GTK_IM_MODULE=xim` to /etc/security/pam_env.conf file.

Revision history for this message
Mike Pozulp (gannon1) wrote :

ironincoder and I reported a kernel bug, https://bugzilla.kernel.org/show_bug.cgi?id=207423

Revision history for this message
Terry Magnus Drever (terrymagnusdrever) wrote :

Quite some investigations you did there ironincoder, don't forget to post here if you manage to get the speakers going. ;) I was actually wondering where the correct place to post and get codec issues fixed is, because this probably isn't the place? Is there a bug tracker for Alsa?

affects: alsa-driver (Ubuntu) → linux (Ubuntu)
Revision history for this message
Mike Pozulp (gannon1) wrote :

Good news! A very smart Arch user by the name of ronincoder discovered a fix for the headphone jack. I worked with ronincoder to make a kernel patch [1] and our patch made it into the 5.7 kernel release! It was also applied to the 5.4 LTS kernel. I booted both 5.7.2 and 5.4.46 and the headphone jack audio is loud and clear. :)

Does it work for you? It should if you have a Samsung Notebook 9 Pro NP930SBE-K01US or NP930MBE-K04US (ronincoder's is the former, mine is the latter). You can check your laptop model by running alsa_info.sh and looking at "Board Name". The Realtek ALC298 codec in the NP930SBE-K01US and NP930MBE-K04US identifies itself with "Subsystem Id" 0x144dc169 and 0x144dc176, respectively. If snd_hda_intel sees either of these ids it implements the fix.

What about the speakers? I reported the no-sound-on-internal-speakers issue on the kernel bugzilla [2]. Linux sound maintainer Jaroslav Kysela speculates that there may be some amplifiers connected to the HDA codec which are not initialized by the BIOS, and are thus not active in Linux. He suggests dumping the codec communication for the Windows driver using QEMU. We could then parse the dump and replay the communication in Linux using Early Patching [3] or writing another kernel patch. It's been a month since Jaroslav made this suggestion and I've made some progress but I still don't have a good dump. Please join the discussion on the kernel bugzilla if you'd like to help me. ^^

[1] For reference, our patch made it into Linus' tree as commit 14425f1f521f (ALSA: hda/realtek: Add quirk for Samsung Notebook).
[2] https://bugzilla.kernel.org/show_bug.cgi?id=207423
[3] https://www.kernel.org/doc/html/v4.17/sound/hd-audio/notes.html#early-patching

1 comments hidden view all 130 comments
Revision history for this message
PowerKiKi (adrien-crivelli) wrote :

I just installed a fresh Xubuntu 20.04 (Linux 5.4.0-42-generic) on my brand new Samsung Galaxy Book Ion NT950XCJ-X716A. And of course I do experience the issues described here: very low volume on headphones and no sound on speakers.

In pavucontrol, under "Output devices", I see 3 HDMI outputs, and the last one is "Speaker + Headphones". I would have expected to see something like "Built-in Audio Analog Stereo", but it's not there. Under "Configuration", I would also expect something related to built-in, but the only profiles available are "Play HiFi quality Music" and "Off".

From reading this thread it seems that a (partial?) fix is on the way. Is there a way for me try that patch already ?

And is there anything else I can do to help fix the remaining issues ? I am not sure what log are useful and how to get them ?

Revision history for this message
jhubuntu20 (jhubuntu20) wrote :

I have the same computer and issue as PowerKiKi... the new Samsung Ion running ubuntu 20.04.

I have found that I can make the headset jack work temporarily if I issue this command :

sudo hda-verb /dev/snd/hwC0D0 0x1a SET_PIN_WIDGET_CONTROL 0x5

But it only lasts until the sound subsystem goes to sleep (i.e. no sound to play or changing sound sources). Is there some way to make this last without having to constantly reissue the command?

I have found no viable way to make the speakers work. One forum I read said it might be related to the AKG Smart Amp in these new Samsung devices, but I have no way to prove or disprove that.

Revision history for this message
PowerKiKi (adrien-crivelli) wrote :

I can confirm that after installing the package `alsa-tools`, then the following command will restore sound on headphones instantaneously:

sudo hda-verb /dev/snd/hwC0D0 0x1a SET_PIN_WIDGET_CONTROL 0x5

In the meantime I did try a newer kernel, linux-headers-5.7.0-050700_5.7.0-050700.202006082127, but without success. I'll give 5.8.1 a try too...

Revision history for this message
PowerKiKi (adrien-crivelli) wrote :

linux-headers-5.8.1-050801_5.8.1-050801.202008111432 and booting with secure boot disabled will not anything. Still no sound, and the command workaround still works.

On a side note, the built-in mic does work as expected. So I use bluetooth headphones for listening and built-in mic for speaking.

PS: John, did you find a way to get the keyboard backlight working ? and are you running on intel or nvidia gpu (in my case nvidia gpu will always freeze the whole computer after ~10-30 minutes of desktop usage) ?

tags: added: patch
50 comments hidden view all 130 comments
Revision history for this message
PowerKiKi (adrien-crivelli) wrote :

This new script also works for me, thanks.

However, with both versions of the script sound will stop working after ~30 seconds of inactivity. So it is not "sticky" in my case. An easy workaround is to play an audio file on infinite loop with volume down to zero. This will keep the speakers enabled forever without any side-effect.

I can live with that for a while.

Revision history for this message
jhubuntu20 (jhubuntu20) wrote :

@PowerKiKi

That is very odd, mine lasts for hours and hours.....

I wouldn't think ubuntu and xbuntu would be that different with regard to audio hardware mgmt, but one guess off the top of my head is that before I found this thread I turned off power mgmt for snd_hda_intel to try to get the headphone verb to be sticky. Obviously this will increase power usage some, but I have not noticed any difference in battery life. If you want to try it, here are the steps I tried (it can be reversed easily if it doesn't help)...

1) Go to folder

    /sys/module/snd_hda_intel/parameters/

2) modify 2 files

    sudo gedit power_save

         change 1 to 0

    sudo gedit power_save_controller

         change Y to N

3) If you still have an alsa-base file (Mike had me delete mine with his patch), you can add these lines too...

    sudo gedit /etc/modprobe.d/alsa-base.conf

         Add

         options snd-hda-intel power_save=0
  options snd-hda-intel power_save_controller=N

Revision history for this message
ironincoder (ironincoder) wrote :

I got a chance to get the pro 9 back for a brief moment and run the CORB script from @John, but that 0x20 block did not do it for this sub-model (0x144dc169).

Revision history for this message
jhubuntu20 (jhubuntu20) wrote :

@ironincoder

I highlighted the 0x20 block just to explain how the data is structured. You need to run the full script (TO912.sh) with all 358 verbs to hear sound.

Revision history for this message
Kacper Michajłow (kasper93) wrote :

I tested your script on my 930SBE. It sort of worked, I indeed got output on speakers, but the quality was terrible, sound was metallic and tiny. Generally looks like we are setting AMP coefficients and those vary between models. I will set up and dump verbs for my machine when I get some free time.

Revision history for this message
Kacper Michajłow (kasper93) wrote :

Also an idea for understanding what specific verbs are responsible for. In Samsung Settings thingy there is a audio profile selection, we could diff verbs set between those profiles.

Revision history for this message
jhubuntu20 (jhubuntu20) wrote :

@kasper93

That is good to know. Makes sense that the CORB values might differ somewhat. The ION has the AKG smart amp and dolby what not, so my CORB sequence is likely tuned for that combination of items. It actually sounds really good for a laptop. I think there may already be a fix out there for the metallic sound issue. I never had it on my system, but remember reading about it on other setups. If nothing else, we know the procedure recommend by Mike works and you could just capture the CORB values (with a decent amount of effort) on each different system. I am not sure what the samsung settings thingy is, but that sounds like it could be very helpful.

Revision history for this message
Kacper Michajłow (kasper93) wrote :

@jhubuntu20

> The ION has the AKG smart amp and dolby what not

Same here actually, I believe Samsung used the same hardware.

> I think there may already be a fix out there for the metallic sound issue

Yeah, my bad. I did quick test and start typing response, sorry. It is PulseAudio that mess up my audio. When I bypass PA, sound is perfect. I compared it to Windows. Windows is a lot louder like 35% is already loud, on Linux it is ~75%. But it is perfectly fine. As for quality, this would need proper testing, if everything is on par. Also those are laptop speakers, so it doesn't matter much, one wouldn't listen to music and expect quality output on those tiny speakers :)

> I am not sure what the samsung settings thingy is

I meant Samsung Setting application (Fn+F1), there are 4 audio profiles to select and I believe they adjust amp/dac parameters when switching them, but that's not that important.

Revision history for this message
Kacper Michajłow (kasper93) wrote :

Just for reference to fix my remaining audio issues I did:

1. Compiled latest PulseAudio (https://gitlab.freedesktop.org/pulseaudio/pulseaudio)
2. Copied latest ucm2 configs to /usr/share/local (https://github.com/alsa-project/alsa-ucm-conf)
3. Enabled SOF driver
    echo "options snd_intel_dspcfg dsp_driver=3" > /etc/modprobe.d/sof-options.conf

Works like charm now. Good work, it must have took so quality time to extract and minimize number of verbs needed.

Revision history for this message
Kacper Michajłow (kasper93) wrote :

duh, in step 2 /usr/share/alsa of course.

Revision history for this message
jhubuntu20 (jhubuntu20) wrote :

@kasper93

That is great news, sounds like the same fix will work for multiple models then!

Revision history for this message
Duke Fong (duke-c) wrote :

@kasper93

I still have the metallic sound issue, after did 3 steps you list in #99. (No problem without pulseaudio.)

It must be that a certain detail has not been handled properly. Do you know what it is?

I have to put this line in /etc/modprobe.d/alsa-base.conf, without it, the sound card driver refuses to install:

options snd-hda-intel dmic_detect=0

By the way, my laptop's id and model are not in the patch. I added a line to sound/pci/hda/patch_realtek.c by myself:

SND_PCI_QUIRK(0x144d, 0xc188, "Samsung Galaxy Flex Book (NT930QCGI-PS5)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),

Revision history for this message
jhubuntu20 (jhubuntu20) wrote :

@PowerKiKi

PowerKiKi, I had to reload my pc for another project, and after reloading I found that same lack of stickiness... Not wanting to go backwards, I felt I had to chase down the full fix. This should fix your issue (caused by pulse) if you want to skip the background audio file...I also improved the Daemon script to ensure later execution and added a second daemon to run the script on suspend/restore. With this setup I have not had to manually run the script in a week or so. Its like sound just works normally now...

Fresh Install Setup Steps

 sudo apt-get install alsa-tools
 Rename alsa-base to bkup /etc/modprobe.d/alsa-base.conf
 placed TO912.sh script with verbs and set as 777 +x
 create and placed $ sudo chmod 664 /etc/systemd/system/ionsound.service

  [Unit]
  Description=Custom Sound

  [Service]
  Type=idle
  ExecStart=/home/ion420/Hoff/Linux_Files/Ion_Audio/TO912.sh

  [Install]
  WantedBy=multi-user.target

 create and placed $ sudo chmod 664 /etc/systemd/system/ionsoundsleep.service

  [Unit]
  Description=Custom Sound Sleep Fix

  [Service]
  Type=idle
  ExecStart=/home/ion420/Hoff/Linux_Files/Ion_Audio/TO912.sh

  [Install]
  WantedBy=suspend.target

 activate
  sudo systemctl daemon-reload
  sudo systemctl enable ionsound.service
  sudo systemctl enable ionsoundsleep.service

 turn off pulse idle
  sudo gedit /etc/pulse/default.pa
  Add comments to ### load-module module-suspend-on-idle

 verify script runs at boot and sound works ..

Revision history for this message
Kacper Michajłow (kasper93) wrote :

@duke-c

> It must be that a certain detail has not been handled properly. Do you know what it is?

Nothing specific that I can think off, I'm running 5.8 kernel so there might be that, depending what you are running.

> I have to put this line in /etc/modprobe.d/alsa-base.conf, without it, the sound card driver refuses to install:

Again might be kernel version difference. There were a lot of related changes in few previous versions. I remember with certain version it didn't work at all and dmic_detect forced fallback.

Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :

This issue should be fixed after 5.4.0-49.53.

Changed in linux (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
jhubuntu20 (jhubuntu20) wrote :

@kaihengfeng

Can you describe what fix was implemented? I updated to kernel 5.4.0-52-generic in Ubuntu 20.04 and it is not fixed. I still must run the script. Also, something has regressed with the latest updates because now I have to manually run "pulseaudio --start" after booting to get it all to work. Prior to running this command PulseAudio Volume Control just stays stuck on establishing connection. It did not do this before the last batch of pulse and alsa updates....

Revision history for this message
Mike (draamses) wrote :

@PowerKiKi
@terrymagnusdrever
@gannon1

I have the same problem on my Galaxy Book Flex 2020 (system id 0x144dc189).
The new kernel helped the earphone work, but there is still no sound from the speakers, even when I am trying the verbs and daemon suggested here. I assume these work for the ION, but not on the FLEX.
Is there any way to make the speakers work?
This is my RtHDDump.txt:
https://pastebin.com/m3xaE2DU

Revision history for this message
jhubuntu20 (jhubuntu20) wrote :

@draamses

I am surprised to hear it doesn't work, at least manually, on the flex. I obviously don't work for samsung and don't know the hardware internal details, but there is nothing in the script that is known to be explicitly model specific. I am also just running a standard ubuntu kernel now with none of the previously discussed kernel modifications, and the headphone jack and the speakers work with the script. It used to work automatically with the deamon before the last pulse and alsa update in ubuntu, but now I have an issue with pulse starting properly at boot. It is a real mystery why the flex is different given that the flex and ion were released at the same time, that both appear to have the same alc 298 sound devices, and that the script works on the always (released a few years earlier). Possibly there are two separate issues on the flex and both have to be resolved. Do you have pavucontrol installed and if so, do you see "sof-hda-dsp speaker + headphones" in the list of output devices? If not, you may also need to run "pulseaudio --start" before running the script. Also, have you completed the step to turn off the auto idle for pulse? If not, if you run the script before you have sound playing, then pulse will break the sound when it puts the sound card to sleep. To turn off the pulse power saving just run "sudo gedit /etc/pulse/default.pa" and comment out (add the ###) the line that reads "load-module module-suspend-on-idle". And reboot of course. You can easily revert if needed but just removing the ###.

Revision history for this message
jhubuntu20 (jhubuntu20) wrote :

Just FYI for anyone interested, The daemon is now working again. Looks like the last update of systemd caused the issue. Through another forum I found I was able to fix it by just running "sudo apt reinstall systemd" (which also fixed the broken battery indicator).

Revision history for this message
Mike (draamses) wrote :

Yeah, thanks a lot, it actually does work on the FLEX :)
I misread post #90 and tried only the verbs listed instead of the entire script.
Using the full attached script it works fine now, on MInt 20 (Kernel 5.4.0-52)
I tried the same verbs on the latest Manjaro, slightly newer Kernel 5.4.72. It works there too, however the sound is quite metallic.
Any way to fix the metallic sound?
When will this fix be implemented in linux out of the box, rather than having to perform all of these steps to get the speakers to work?

Revision history for this message
Mike (draamses) wrote :

Re: Metallic sound
Forgot to mention - it seems to happen only on the speakers, not on the headphones.

Revision history for this message
Mike (draamses) wrote :

One possibly important finding:
The metallic sound happens with Chrome but not with Firefox, running the same youtube video.
I googled and found that chrome is using ALSA, while FF is using Pulseaudio. Maybe that's the issue.
Got no idea how to solve this tho.

Revision history for this message
Mike (draamses) wrote :

PLease disregard my last comment (#112). It happens in FF too, but on other websites.

Revision history for this message
Mike (draamses) wrote :

Re: Metallic audio

Upgraded the kernel from 5.4.0-52 to 5.4.72 as I have on Manjaro.
Result: Metallic audio.

Booted again with 5.4.0-52
Result: Clean audio

Conclusion: quite likely a kernel issue.
How can we get this reported and fixed?

Revision history for this message
Mike (draamses) wrote :

Decided to do more trial and error tests.
I tried multiple amd64 kerels from https://kernel.ubuntu.com/~kernel-ppa/mainline/
It seems that all kernels I tried produce metallic audio, I believe you can easily reproduce this by trying them.
Even the 5.4.52-050452.202007160732 kernel produced metallic sound, while the official Mint 5.4.0-52 kernel produces clean audio.
Official Mint kernel 5.8.0-28 also produces clean audio.

Any thoughts?

Revision history for this message
Mike (draamses) wrote :

To answer my own question - I suppose the ubuntu kernels are more optimized and have multiple fixes and drivers that the mainline/upstream kernels do not and that's why I get the metallic audio...
I wonder what was fixed in Ubuntu's kernel to make this issue go away.

Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :
Revision history for this message
Mike (draamses) wrote :

Yes, it is.
For some reason linux loads snd_hda_intel instead of snd_soc_skl_hda_dsp ALSA module and this causes the metallic audio.
How can I get it to load snd_soc_skl_hda_dsp ALSA module?

Revision history for this message
jhubuntu20 (jhubuntu20) wrote :

@kaihengfeng

Yes, my model is included :

SND_PCI_QUIRK(0x144d, 0xc18a, "Samsung Galaxy Book Ion (NP930XCJ-K01US)", ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET),

However, the quirk called "ALC298_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET" is just the fix for the headphone jack only. So yes, that fix is now implemented, but what about fixing the actual speakers. Now that we have a sequence of verbs that enables speaker sound, can someone add those to another quirk so sound on the speakers works out of the box too?

Revision history for this message
jhubuntu20 (jhubuntu20) wrote :

@draamses

I never encountered the metallic sound on my ion, so I am probably not much help on that one. I do recall reading about it when I was researching the speaker issue, so I do agree it is a separate issue. If you google around a bit, it seems like there was a separate fix for metallic sound already identified.

Revision history for this message
Mike (draamses) wrote :

@jhubuntu20

I am pretty sure this is caused by snd_hda_intel being loaded instead of snd_soc_skl_hda_dsp
When I tested ubuntu kernel, the sound was clean and they all ladded snd_soc_skl_hda_dsp, however any mainline kernel produced metallic sound and those load snd_hda_intel
I have created a tutorial for Manjaro that may help people with other distors and similar laptops. It is largely based on your efforts, so thank you for that. :)
https://forum.manjaro.org/t/guide-how-to-set-up-the-audio-card-in-samsung-galaxy-book/37090

Revision history for this message
jhubuntu20 (jhubuntu20) wrote :

@draamses

I am glad to hear it works on the flex. Thanks for the kind words, but Mike Pozulp deserves most of the credit. He seems to have disappeared here, but he had the key process for how to do it. For what its worth, I don't recognize snd_soc_skl_hda_dsp (of course I am not using Manjaro). On my ion with standard ubuntu 20.04 it was never metallic. From "lspci -nnv" on my system :

00:1f.3 Multimedia audio controller [0401]: Intel Corporation Device [8086:02c8]
 DeviceName: Onboard - Sound
 Subsystem: Samsung Electronics Co Ltd Device [144d:c18a]
 Flags: bus master, fast devsel, latency 32, IRQ 166
 Memory at 6023118000 (64-bit, non-prefetchable) [size=16K]
 Memory at 6023000000 (64-bit, non-prefetchable) [size=1M]
 Capabilities: <access denied>
 Kernel driver in use: sof-audio-pci
 Kernel modules: snd_hda_intel, snd_sof_pci

Revision history for this message
Mike (draamses) wrote :

Yes, if you check alsa-info (here is my output: http://alsa-project.org/db/?f=608b0585907cc0f959ebc2528e771f5260685382), you will find it:
!!Loaded ALSA modules
!!-------------------

snd_soc_skl_hda_dsp

snd_soc_skl_hda_dsp ALSAA module basically loads snd_sof_pci and that's why you don't have metallic audio...
Even if you launch alsamixer and press F6 you will see sof-hda-dsp and not HDA Intel PCH that those with metallic audio see.
You can easily get metallic audio by switching to a mainline kernel instead of ubuntu's.

Revision history for this message
Mike (draamses) wrote :

And to fix that metallic sound with the mainline kernel, you will probably need to perform steps 4 & 5 from my guide (https://forum.manjaro.org/t/guide-how-to-set-up-the-audio-card-in-samsung-galaxy-book/37090) and then reboot.

Revision history for this message
Mike (draamses) wrote :

Oh, one last thing, to hear the mettalic audio, simply launch a youtube video in Chrome (not Firefox)

Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :

Kailang, do you know how to power up the AMP?

Revision history for this message
Kailiang Yang (kailang) wrote :

I don't know.
This is none Realtek AMP.

Revision history for this message
Kacper Michajłow (kasper93) wrote :

I will ping you guys also here, since it seems to be more popular bug report. I've send a patch for speaker amp. You can find it here https://bugzilla.kernel.org/show_bug.cgi?id=207423#c40 and test if you'd like.

Revision history for this message
Aurélien (titou829) wrote :

Hi,

I have a Samsung galaxy book and encounter the same problem with my ALC298 sound card. I tried everything you did but it didn't work with mine. In fact I even cannot hear something with the earphones.
I also tried to check the verbs used under windows (throught qemu) and it seems they are quite different. Unfortunately even when i try to set these verbs it doesn't work...
I tried to send to you an email @gannon1 / @Mike pozulp but I'm not sure you received it.

If someone can help me trying to solve this problem it would be so good!
Thanks a lot

Revision history for this message
PowerKiKi (adrien-crivelli) wrote :

Aurélien, first thing to do is probably `sudo alsa-info --upload` to get and upload all your details. Then, we might compare it to mine: http://alsa-project.org/db/?f=f13c46c58bba7ed21035e65230899b18419cd337

Displaying first 40 and last 40 comments. View all 130 comments or add a comment.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.