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

Bug #1851518 reported by Martin S
66
This bug affects 12 people
Affects Status Importance Assigned to Milestone
Linux
New
Undecided
Unassigned
linux (Ubuntu)
Fix Released
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 152 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
Changed in linux (Ubuntu):
status: Confirmed → Fix Released
72 comments hidden view all 152 comments
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

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

@PowerKiKi
The to912 script needs to be re-run after the audio sleeps. I have been running it manually for two years. Yesterday, I wrote a script that runs automatically after booting. It is much more convenient now. The script snippet:

LAST=0
while true; do
    #pacmd list-sink-inputs | grep -w state | grep -q RUNNING && CUR=1 || CUR=0
    cat /proc/asound/card0/pcm0p/sub0/status | grep -q RUNNING && CUR=1 || CUR=0

    sleep 1
    [ $LAST != $CUR ] && echo "audio state: $LAST -> $CUR @ $(date)"
    if [ $LAST == 0 ] && [ $CUR == 1 ]; then
        echo "run fix_audio ..."
        ./to912_fix_audio.sh &> /dev/null
    fi
    LAST=$CUR
done

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

Thanks for the news. I've been listening to a muted mp3 for two years now :-P

I am looking forward to Ubuntu 22.04 that should bring us the patched kernel we need...

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

@PowerKiki

I'm really sorry for the delay. My computer crashed and I needed to repair it.. I just finished...
After a year I reinstalled the latest kernel but the problem seems to persist.
Here is the result of the alsa-info.sh:
http://alsa-project.org/db/?f=08a95ec89e5a0a02f38d7183cf9b2078fadff751

Do you have any clues?

Revision history for this message
Drew R. (drew-rosoff) wrote :

FYI - I have the NP950XEE (GalaxyBook2 Pro w/ Intel ARC graphics), have been struggling with the same problem and trying to fix for days now. I have perfect sound in headphones, no sound on speakers. I've implemented every fix discussed here, and haven't seen one single effect. I'm running 22.04. I tried upgrading kernels to 5.17 and 6.0 also, no effect. No matter what I try, headphones work, speakers not (and no metallic sound on headphones). Can anyone give any help/guidance, I'm stuck.

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

It's been a while. Since then I upgraded to Xubuntu 22.04 (not fresh install), and I am running kernel 5.15.0, which is supposed to contains my patch according to tags on https://github.com/torvalds/linux/commit/8bcea6cb2cbc1f749e574954569323dec5e2920e.

So I expect the issue to be solved, but unfortunately it is still not solved. I still use the manual script that runs a few hundreds `sudo hda-verb ...` to enable sound on my speakers.

I am afraid I cannot offer much guidance, neither to Aurélien, nor to Drew R. :-/

Revision history for this message
Drew R. (drew-rosoff) wrote :

Understood. I'd be super happy however if I could just get a manual script to work at least, and then I could call it a day...anything to just get any sound. But I've had no luck with that method, it seems to have no effect. (Assuming we are talking about the TO912.sh script. I tried to go down the whole road of setting up QEMU to record my own verbs, in case they're different, but couldn't get QEMU to compile. I have a windows partition, with latest drivers, and sound works in windows.

Revision history for this message
jhubuntu20 (jhubuntu20) wrote :

Hi Drew,

Since creating the TO912.sh script I have also upgraded to a GalaxyBook2 Pro (NP930XED) running 22.04 and the script was required (i.e. the latest kernels don't automatically fix issue), but the script continues to work fine for me on both headphones are speakers. Personally I would recommend upgrading from the 5.15 kernel because it doesn't work fully with the intel grpahics (im running 6.0.6-060006-generic now), but that is unrelated. Here are the full steps I did again that work for me ... I still have not figured out how to make the screen brightness control functional on the book 2 pro, but also a different story...

- placed TO912.sh script and set as 777 +x
- Create daemon for boot

  sudo gedit /etc/systemd/system/ionsound.service

                Add text in file
           [Unit]
           Description=Custom Sound

           [Service]
           Type=idle
          ExecStart={enter your path to script}/TO912.sh

          [Install]
           WantedBy=multi-user.target

  sudo chmod 664 /etc/systemd/system/ionsound.service

- Create daemon for sleep exit

  sudo gedit /etc/systemd/system/ionsoundsleep.service

                Add text in file
           [Unit]
           Description=Custom Sound Sleep Fix

           [Service]
           Type=idle
          ExecStart={enter your path to script}/TO912.sh

          [Install]
           WantedBy=suspend.target

  sudo chmod 664 /etc/systemd/system/ionsoundsleep.service

- Activate daemons

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

Note, I left the names as Ion because I was too lazy to change, but nothing in here is ion specific and this does work on your model. You can change naming if you like as long as you change it everywhere...

For the kernel part, if you haven't already discovered the mainline tool for kernel mgmt then I would highly recommend trying it....

        sudo add-apt-repository ppa:cappelikan/ppa -y
 sudo apt install mainline -y
 Launch mainline GUI and pick kernel to install

Revision history for this message
Drew R. (drew-rosoff) wrote :

Hi jhubuntu20,

First, hopefully I can do you a solid and tell you how I fixed my brightness control at least (cause mine is a Galaxy Book2 Pro also, but with the ARC graphics).  What worked for me was:

    -Created /etc/modprobe.d/i915.conf with
        options i915 enable_dpcd_backlight=3
    - Regenerated the initramfs:
        sudo update-initramfs -u -k all

Hope that helps, unless you already tried.

On my side, I am running kernel 6.0.0-1006-oem (which I got from the linux-oem-22.04b package, as opposed to the mainline tool, which i may try though). I tried that in hopes it would help, in addition to many other things (disabling windows fast boot on my other drive, disabling secure boot and fast bios, setting probe_mask=1, iommu=off, and others).  Also tried playing with hdajackretask, because I'd be happy with retasking / giving up my working headphone jack for the speakers, but haven't figured that out.

Also, when I tried your TO912.sh script (the first thing I tried actually), I was doing it following the instructions  here -- https://forum.manjaro.org/t/howto-set-up-the-audio-card-in-samsung-galaxy-book/37090
This includes also blacklisting snd-hda-intel, removing alsa-conf, plus more.  Should I not be doing that?  (I've tried both ways though).

The problem is I just don't have the right mental model for what's going on, so trying everything too blindly... but I'm trying to understand more.  Most things have no effect (i.e., headphones work, speakers don't).  However, the one tweak that has made the most effect is:

    options snd-intel-dspcfg dsp_driver=##

    - When I set this to "3", or leave the setting out (i.e., as it was on fresh install), alsamixer shows "sof-hda-dsp" for "Card" and "Realtek ALC298" for "Chip".  When I use hdajackretask, it hangs completely when applying the retasking (and I've stopped pulseaudio, etc.), and the machine will hang on next shutdown.
    - But if I set it to "1", alsamixer then shows "HDA Intel PCH" for "Card", and still "Realtek..." for chip.  I can use hdajackretask without it hanging up.  And when I plug in headphones, I see a new "Headset or Headphone" GUI popup.  But my mic doesn't look like it's working. (Also, I need to not blacklist snd-hda-intel for this config to work, otherwise I only have "Dummy Output")

Do you happen to know which of those situations seems "more right"?  I fear that there's more than one problem going on at once, and I wonder which setting (3 vs 1) I should use as I experiment with the other possibilities (your script, etc.)

Lastly, I notice if I look in alsa-info, its reporting "line_outs=1", but "speaker_outs=0" in almost all configurations, and its not binding either line_out or speaker to anything in "/devices" (though it is binding the HDMIs, headphone, and sometimes the Mic).  I checked my older laptop, however, which has speaker sound, and it reports the same (though its running a 4.xx kernel and the ALC256).

I don't know if any of this gives any clues, and I apologize for my posts length and poor formatting.. I'm just trying to make sense of all this.

Revision history for this message
jhubuntu20 (jhubuntu20) wrote :
Download full text (3.5 KiB)

Thanks, I had tried a couple of things on the brightness, but it doesn't really bother me that much and I kind of forgot about it. I will try your approach.

So full disclaimer, I am usually an Angular architect and not a linux admin so try at your own risk, etc., etc., but here are my thoughts on your post... Back when I created the original script, the Ion and ubuntu 20.04 had several sound related issues. I had found fixes for the headphone jack and a few other issues initially, and then Mike Pozulp gave me a wonderful conceptual process and some key pointers for how to use qemu to get the verbs for the speakers. The process in that blog is the old, more complicated process. Fast forward to the galaxy book 2 and ubuntu 22.04, and on this laptop I didn't have to do most of the same steps because several of the issues were fixed in the base ubuntu version. So in general I would say you shouldn't need to do any of the hda retasking or alsmixer steps on your new laptop. In fact it was so easy on this laptop I didn't even install alsamixer or the other sound tools I had installed before to work on the ion. Here is the full entirety of everything I did on a fresh 22.04 install on the book 2 pro to get to working sound... perhaps one of these steps is the key...

1) Install pavucontrol. I don't think this was actually necessary, but I wanted the tool available just in case.

    sudo apt install pavucontrol

2) Install alsa-tools. This is absolutely required because it installs the hda verb utility. If you try to run the script without the verb tool then it won't work, but I would assume you would have seen the errors.

    sudo apt-get install alsa-tools

3) Kill the default alsa-base. Don't substitute or replace, just make sure this file is no longer present. I recommend rename instead of delete in case you ever want to back. This is likely the step your missing. Don't substitute a new file.

    Go into folder and just rename this file so it is not present

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

4) Place the TO912.sh script and be sure to chmod the permissions to 777 and make it executable with +x

5) Create the two daemon files, making sure you did the chmod 664 step and making sure the paths to the TO912 script are updated.

6) Activate the daemons. be sure to do the reload before enabling.

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

7) Turn off suspend on idle. This should not be needed to make it run, but keeps the change working through standby mode after it starts working

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

8) Reboot and verify

That's it, should be every thing you need to do from a fresh 22.04 to get full sound on headphones and speakers. I never actually tried running the TO script on this unit before doing these steps, so I can't say for sure if that works before removing alsa-base, but I have had to reload this laptop 3 times for other reasons and this process worked every time.

If it helps here is my output from sudo lspci -v | grep -i audio. you should seem someth...

Read more...

Revision history for this message
Drew R. (drew-rosoff) wrote :

Ok... So, I had previously done those steps 1 through 8. On top of those however, since I had followed the instructions from that link (https://forum.manjaro.org/t/howto-set-up-the-audio-card-in-samsung-galaxy-book/37090), I had also added on top:
    options snd slots=snd_soc_skl_hda_dsp
    blacklist snd_hda_intel
as well as (for good measure, or in desperation rather):
    options snd-hda-intel model=alc298-samsung-headphone
    options snd-hda-intel model=alc298-spk-volume

So, I just removed those extras, to be sure I'm exactly as you. Also, to be sure the TO912.sh script is being called by those services, I put a 'touch' command at the end of the script, so it creates a file so I'm sure it ran. Still no go... but I am determined. I assume there is only one version of that TO912 script, right?

As far as your lspci output, thank you for that. It really helps to have something to compare it to.
My output was (changing the grep a little for more info):

     00:1f.3 Multimedia audio controller: Intel Corporation Alder Lake PCH-P High Definition Audio Controller (rev 01)
 Kernel driver in use: snd_hda_intel
 Kernel modules: snd_hda_intel, snd_sof_pci_intel_tgl

So that is different than yours, but that's when I had "dsp_driver=1". I took that option back out, to be 100% in line, and now it's the same as your output ("sof-audio-pci-intel-tgl"). (And, taking that dsp_driver=1 out also restores the microphone working) - But, still no go. This was all on kernel 6.0, but I also tried 5.17, same result (rebooting between all tests).

This is really strange, since we both have book2 pros. My only difference is the dedicated Arc graphics model (which I only got because I wanted 32gb ram). It comes with an HDMI port, does yours? (Part of me wonders if that plays a role in this).

In the beginning, I too went down the QEMU route. It seemed extreme, but hopefully full proof if I could get through it (since its gonna mimic whatever windows does). But, at least in the blog post I followed, it had me download a custom qemu build, which then wouldn't compile, and I got stuck in the rabbit hole of trying to figure out its compilation errors (maybe it was an old build).

Revision history for this message
jhubuntu20 (jhubuntu20) wrote :
Download full text (4.1 KiB)

That is odd. If its an option, you might consider a fresh install of 22.04 and then just the few steps. Its possible something else was changed or didn't reset fully as expected, but I know a full reload can be a ton of work and disruption. I don't know which script version they had in the blog, but attached is the very final one that I am using now that works. If you go the qemu route, I will warn you ahead of time it is not that simple even after you get the custom compile done because you have to catch the right sub part of the flow and it never seemed to be a single verb, only a combination in sequence that worked. i.e. even if you record all the verbs that make it work in windows then just playing them all back doesn't work because windows leaves it in an off condition and turns back on when needed. Anyway, it took a lot of trials to find a subset that worked consistently. Yes, mine has an hdmi, but just the intel graphics. Perhaps that could be involved, but I don't have access to the 15" laptop to try. Here is my output from pacmd list-cards. If there is any other output that would help you then let me know...

1 card(s) available.
    index: 0
 name: <alsa_card.pci-0000_00_1f.3-platform-skl_hda_dsp_generic>
 driver: <module-alsa-card.c>
 owner module: 21
 properties:
  alsa.card = "0"
  alsa.card_name = "sof-hda-dsp"
  alsa.long_card_name = "SAMSUNGELECTRONICSCO.LTD.-930XED-P07RGE-NP930XED_KB2US"
  alsa.driver_name = "snd_soc_skl_hda_dsp"
  device.bus_path = "pci-0000:00:1f.3-platform-skl_hda_dsp_generic"
  sysfs.path = "/devices/pci0000:00/0000:00:1f.3/skl_hda_dsp_generic/sound/card0"
  device.bus = "pci"
  device.vendor.id = "8086"
  device.vendor.name = "Intel Corporation"
  device.product.id = "51c8"
  device.string = "0"
  device.description = "sof-hda-dsp"
  module-udev-detect.discovered = "1"
  device.icon_name = "audio-card-pci"
 profiles:
  HiFi: Play HiFi quality Music (priority 40768, available: unknown)
  off: Off (priority 0, available: unknown)
 active profile: <HiFi>
 sinks:
  alsa_output.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFi__hw_sofhdadsp_5__sink/#1: sof-hda-dsp HDMI / DisplayPort 3 Output
  alsa_output.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFi__hw_sofhdadsp_4__sink/#2: sof-hda-dsp HDMI / DisplayPort 2 Output
  alsa_output.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFi__hw_sofhdadsp_3__sink/#3: sof-hda-dsp HDMI / DisplayPort 1 Output
  alsa_output.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFi__hw_sofhdadsp__sink/#4: sof-hda-dsp Speaker + Headphones
 sources:
  alsa_output.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFi__hw_sofhdadsp_5__sink.monitor/#1: Monitor of sof-hda-dsp HDMI / DisplayPort 3 Output
  alsa_output.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFi__hw_sofhdadsp_4__sink.monitor/#2: Monitor of sof-hda-dsp HDMI / DisplayPort 2 Output
  alsa_output.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFi__hw_sofhdadsp_3__sink.monitor/#3: Monitor of sof-hda-dsp HDMI / DisplayPort 1 Output
  alsa_output.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFi__hw_sofhdadsp__sink.monitor/#4: Monitor of sof-hda-dsp Speaker + Headphones
  alsa_input.pci-0000_00_1f.3-platform-sk...

Read more...

Revision history for this message
jhubuntu20 (jhubuntu20) wrote :

Latest TO912.sh

Revision history for this message
Drew R. (drew-rosoff) wrote :

Thank you for your latest script. I did a diff, crossing my fingers to find a difference, but it was only your commented out line starting pulse audio... so they're the same :/

And thanks for the pacmd output. At first when I compared yours and mine, they were the same... except my sinks, etc. were numbered starting at 0, while yours start at 1 (though the same devices were listed in the same order). But then in trying certain configurations, the outputs now show identical. (I am not positive, but I think it's when I went back to blacklisting snd-hda-intel for a moment that they became identical, so its possible that module just isn't loading for you, and maybe that's preferable).

I found the quirk 'alc298-samsung-amp' the other day, and also tried a lot of configurations with that (using "options snd-hda-intel model=alc298-samsung-amp"), but still no go. I was working on two theories: 1) There's some small difference that matters between your machine and mine, and trying to find it. Or alternatively, 2) There's no important difference between our machines, but because your machine reports as the "930XED", which is probably listed, while mine reports as the "950XEE", which probably isn't listed, there are just some quirks that are automatically getting activated for your machine but not for mine... So I was trying to find those quirks (I'd love if there was a way to 'spoof', and just make everything report that I had the "930XED" to see what happened, but don't know if thats possible).

I'm still collecting ideas, because I strangely refuse to give up. And I may start next down the whole qemu route. Two questions: 1) You say its fairly difficult, doing the subsetting during playback, cause it turns the card off shortly after turning it on... But you do hear sound at some point in the process, right? That's all I need to keep me going, just a little sound for a second ;). Also, 2) Do you happen to have a url of a good blogpost/set of instructions that you followed for that? I think the one I used pointed to an old version of the custom qemu to compile, because there were just way too many compilation problems. (I have my own windows partition, and I've downloaded the windows realtek driver, so I'd love to just use that, but I gather it has to be with a custom emulator to do the codec sniffing).

Revision history for this message
jhubuntu20 (jhubuntu20) wrote :
Download full text (3.6 KiB)

A few thoughts... Just based on my work before and the few people I helped later, in my experience Samsung reuses as much as possible in similar models and I don't think the laptops are that much different (if any) with regard to sound. So I don't think its option 1. Option 2 is a possibility and I would still consider a fresh install. I don't know about spoofing, but if you know the quirk you think is missing you can pretty easily just create a customized kernel that applies it. I did that originally on the Ion, again based on suggestions from Mike Polzup, before I actually went down the qemu path. It was needed back then just to get the headphones working on the Ion, but I believe that issue is now resolved in Ubunutu. Also, for what its worth, your brightness fix worked perfectly, so there is definitely some common aspects between these machines.

Its been a couple of years, but basically my qemu approach was
 -Install basic qemu
 -create a new windows virtual machine
 -Place a sound file on the desktop in the WM and ensure it played
 -Create the modified qemu version to get logging
 -Launch the previously verified VM
 -Play the sound, noting where in the log it was playing
 -Record the logging
 -Translate the verb formats
 -Play back sections to find some sort of sound
 -Reduce the verbs as much as possible after getting a section that made noise

I never needed to install the windows realtek driver as a separate step, the qemu vms always had working sound just with a default install of windows. It seemed like it would be easy once I got the modified qemu working, but it wasn't. Honestly if we hadn't been on covid lockdown I probably would have not had the time to finish it. I assumed, incorrectly, that if I just recorded the verbs during boot or the verbs up to the point where I heard sound on the VM it would be easy to just replay that bit and hear something, but that never really worked smoothly. I just assumed I did it wrong and it didn't work, but later in desperation I started just taking chunks and trying them and I happened to hit a working segment.
 I believe that was on Sept 12, thus the name of the script. I never really figured out why the bigger chunks didn't work.

Mike gave me the basic concept and pointed me at these two approaches for logging. He seems to have dropped away right after that, but his approach was absolutely correct. Because I didn't think it was working originally, I made both logging approaches work, but ultimately I used the bsd style approach for the final work because i found the output easier to work with as you can just copy and paste from stdout and the verbs needed less modification:

https://jcs.org/2018/11/12/vfio

https://github.com/Conmanx360/QemuHDADump/wiki/Setup-and-usage-of-the-program#start-of-content

If it helps, here are my very incomplete notes on making the modified qemu. I didn't write down what I changed in common.c, but I believe it was inline with the article...

Manual Install Qemu

 sudo apt-get build-dep qemu

 Download source https://www.qemu.org/download/#source
 tar -xvf {insert-qemu-version-here}.tar.xz
 go into folder

 modify common.c in hw/vfio (to o...

Read more...

Revision history for this message
Drew R. (drew-rosoff) wrote :

1) I am so glad the brightness fix worked for you! At least I can feel like I've accomplished something ;)

2) Thanks so much for your detailed qemu information. I think I am going to tackle that next, and it should help (especially since compiling the pre-customized qemu was giving me trouble...your method sounds better, cause I can download what should be the latest qemu, and just patch it before compiling).

So, an update: A bit of very good news and very bad news. I was gearing up to do qemu last night, but decided to try "one last thing". I came across this post here:
    https://bugzilla.kernel.org/show_bug.cgi?id=216023

In it, someone else with a 950QED had done the whole Qemu thing, and came up with a different set of verbs. Very long (3500 verbs), not cut down very well. So I decided to try them. Boom, sound! Finally (It scared the hell out of me, after all this trying and failing). But: Sound in the left speaker, in the right speaker extremely loud static. Rebooted, same thing. Then, while the static was playing, I went to write myself a note about the results, and must have waited too long, because in the meantime, I smelled something very faint coming from the computer, then the static volume starts reducing slowly bit by bit to nothing. And from that point on, no sound in the right speaker in linux. In windows, even after shutdown, very faint volume from the right (It's almost like a blew an amp or something? ..maybe there is an amplified speaker that linux is calling, that's dead, and windows is calling the unamplified one, hence the quiet sound? ...but i don't know how this stuff works. Also, in certain configurations, I can in linux only get that loud static on the right to pop in for 1sec before going quiet again (by re-running the verbs)... so that cuts against the theory that I blew something, even though windows sound is still permanently affected, very weird)

So my computer is still within the return window for a few days, but I don't wanna get a new one and just repeat the same mistake. It's possible it's not that anything blew, but just i'm still missing some weird initialization/reset verbs or something? Hence why I think I will still see what happens on qemu, on a fresh windows install (and even better that you say it will use a different generic sound driver, so i can see what happens). This whole thing has made me realize, as I boot into linux/windows,reboot, etc., that the soundcard holds state between reboots much more than I ever thought possible I.e., once the verbs are sent, they don't need to be sent again unless I launch windows, or shutdown completely. And all this seems independent of whether I do those other steps (alsa.conf, etc.) or not, it just seems about getting those magic initialization verbs.

Revision history for this message
jhubuntu20 (jhubuntu20) wrote :

Yes, thank you for the brightness fix.

If it helps, I did remember the changes to make to the common.c file for logging. In that bsd article you can ignore most of the text, but somewhere in the middleish there is a hyper link that says something like my hack. If you click on it, it shows you in git hub the changes to make to common.c. Otherwise its just the instructions I sent.

Also, I could be wrong and its just my opinion, but I don't believe there is a verb that would burn out the amp and I believe it is one smart AKG amp for the entire laptop. You could easily have a bad speaker as its a new machine, but I doubt its from the verbs. Part of the struggle I had when finding the verbs was that some sequences would turn on just one speaker and sometimes the audio was garbled, so based on that experience, I would tend to believe you just don't have the right verb set. It was a challenge to get a small set of verbs that worked very consistently. If you are going to return the laptop anyway and have not tried it yet, I would also recommend just trying a completely fresh 22.04 install and the 8 steps we discussed above (with either set of verbs). I honestly think that might work and will be simpler than qemu.

Revision history for this message
Drew R. (drew-rosoff) wrote :

Great news!!! Got the new machine. Avoided booting into windows, ever, just in case. Executed your steps 1 through 8 (except for the default.pa part... I wasn't sure if that was crucial, and figured I'd save it until it seemed needed). Boot fresh machine, no sound. Apply the verbs - The other set, from that link I sent (the one that has 3600 verbs :/ ). Sound!!! On the left, good. On the right, about 10% quieter but well beyond good enough for me. (Other people using those verbs from that thread have noticed the slight volume difference as well... the verbs aren't perfect I guess). So I was very happy.

I shutdown. Verified no sound after startup. Ran the verbs again. Sound again, but this time right speaker is 50% quieter. So, I'm going to stop running the verbs, not install it as a service as I was about to, and only run it when needed (I shutdown my machine about once a year anyway, lol). Cause I think you are 100% right... It's all just about the verbs. My old machine probably didn't have a busted speaker, I had just ran so many different verbs through, and some had stuck, that the speaker was semi-permamently reduced. And its possible that these verbs from that link also aren't perfect, and are lowering the right volume a bit each time its run. It seems that some things aren't even reset on shutdown, while others are. People on that thread imply that after a day or so, things reset, but I can't imagine how that works or what its based on, but we'll see. So I'm going to leave well enough alone, for the time being, and hope that there's activity on that thread and they get the verbs better (cause yes, qemu seems to be a whole rabbit whole, so if someone else with a similar machine already has it all set up . . .).

information type: Public → Public Security
information type: Public Security → Public
Revision history for this message
Aurélien (titou829) wrote :

Hi all,

I finally got time to work on the soundcard of the Galaxy Book 12 (SM-W720). I finally found the solution in order to get it working under linux after a lot of work on the verbs I got from qemu two years ago.
I already can have sound from a script I'll send to you this weekend.
I'm also working on an ALSA patch.
Maybe it will work for you @drew-rosoff.

And since you spoke about brightness, please note that I worked on hardware brightness driver for the AMOLED display. It still have flickering problem on very low brightness state but it works pretty well.
For the moment the brightness is managed through a script which plays with /dev/drm_aux_dp device.
I'll try to develop a driver (but it's too dependant from the i915 driver and I don't want to integrate this code into the i915 driver..)

Revision history for this message
Drew R. (drew-rosoff) wrote :

@titou829 -

That would be great, thank you! As of now, I've used the script/verbs from this link (I think that's where I got them): https://github.com/thesofproject/linux/issues/4055 . And that managed to get my sound working, but with the right side at lower volume, and I believe ever lesser volume on the right each time I run the script. So therefore, in the meantime, I've just been afraid to shut off my computer lol, because I don't wanna have to run those verbs again and find out the hard way. So if you have a new set of verbs to send, that'd be great. I'm sure at some point, my computer will hard-crash, and I won't have a choice but to try something again.

Revision history for this message
influenist (influenist) wrote :

Hi All,

Running the xiaomi notebook x15 pro here. Which comes with 4 speakers. The front firing sound bad, like 25% and downward do not make any sound. Anyone can help me out where to start?

hdajackretask does not work / save upon reboot. Kinda struggeling with this one here...

http://alsa-project.org/db/?f=e4477f3727b1df458e1647d10a48cba2f94b2112

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

Hi All,

I'm sorry i didn't found time to send my work but now it's done.
Please find the ALC298 python scripts and the brightness management of the Samsung galaxy book 12 on my github: https://github.com/Teetoow/SamsungGalaxyBook12

I'm not sure it will solve problem for other ALC298 soundcards but it works fine for me.

Sound difference between the windows driver and the linux one comes from software remixing (in particular to take into account the internal speaker response). You will find better results by using easyeffets.

I would be very interested in a solution to get this internal speaker response without costing materials, but i don't know how to do that.

The brightness has some flickering problems at low brightness. I'm not sure that it comes from the brightness management itself. I will check that in a near future.

Revision history for this message
Marius Acniz (mayaru) wrote :

Hi Eurelien,

any chance you might write a simplet step by step toturial how to apply your patch?
Thanks a lot.

Marius

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

Other bug subscribers

Remote bug watches

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