Bug 216023 - Speakers not working in Samsung Book2 NP950QED
Summary: Speakers not working in Samsung Book2 NP950QED
Status: NEW
Alias: None
Product: Drivers
Classification: Unclassified
Component: Sound(ALSA) (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: Jaroslav Kysela
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-05-24 22:38 UTC by Jordi Torres
Modified: 2023-06-14 22:13 UTC (History)
8 users (show)

See Also:
Kernel Version: 5.17.9
Subsystem:
Regression: No
Bisected commit-id:


Attachments
alsa-info report (50.73 KB, text/plain)
2022-05-24 22:38 UTC, Jordi Torres
Details
The RtHDDDump report from a win10 running on baremetal without headphones plugged in (854.34 KB, text/plain)
2022-05-24 22:39 UTC, Jordi Torres
Details
The list of hda verbs which make speaker work (53.89 KB, text/plain)
2022-05-24 22:40 UTC, Jordi Torres
Details
The qemu VFIO trace (1.83 MB, text/plain)
2022-05-24 22:42 UTC, Jordi Torres
Details
snd-hda-intel patch for Samsung Galaxy Book2 Pro 360 (np950qed) (54.00 KB, text/plain)
2022-05-26 15:12 UTC, Max Vohra
Details
Dmesg of startup (77.31 KB, text/plain)
2022-05-26 22:36 UTC, Jordi Torres
Details
Alsa info diff between Linux initialized hda to Windows initialized hda (18.24 KB, patch)
2022-05-28 23:02 UTC, Jordi Torres
Details | Diff

Description Jordi Torres 2022-05-24 22:38:06 UTC
Created attachment 301031 [details]
alsa-info report

I have a Samsung Galaxy Book2 Pro 360 which cannot play sound through speakers. After some research I found that is a common problem in laptops using Realtek ACL298 which miss initialization hda verbs for the speaker amplifier.

I used the know technique of extract initialization sequence from a VM with windows 10 which VFIO traces are enabled. I processed these traces using the scripts in the repository realtek-verb-tools and I got a working set of hda verbs which can make speakers working from a fully turned off state. I tried reduce the list of verbs that I attach in this report but I attempts to exclude some of the beginning verbs resulted in a non working sequence.

Even with these verbs applied, only left speaker works and right one keeps quiet so there is something not related to initialization sequence that isn't correct.

I attached the alsa-info report, the RtHDDump report, the full trace of writes from VFIO using the custom version of qemu from jcs repo and the list of verbs generated by realtek-verb-tools after discarding verbs of the end
Comment 1 Jordi Torres 2022-05-24 22:39:20 UTC
Created attachment 301032 [details]
The RtHDDDump report from a win10 running on baremetal without headphones plugged in
Comment 2 Jordi Torres 2022-05-24 22:40:32 UTC
Created attachment 301033 [details]
The list of hda verbs which make speaker work
Comment 3 Jordi Torres 2022-05-24 22:42:20 UTC
Created attachment 301034 [details]
The qemu VFIO trace
Comment 4 Max Vohra 2022-05-26 15:12:59 UTC
Created attachment 301051 [details]
snd-hda-intel patch for Samsung Galaxy Book2 Pro 360 (np950qed)

The initialization sequence you provided is somehow incomplete. I ran the trace myself against a fresh win11 install, and got a trace of commands that works for both speakers (at a hefty 3500 lines). 

I've created the attached snd-hda-intel patch file as described here: https://www.kernel.org/doc/html/latest/sound/hd-audio/notes.html

Basically, place the file in /lib/firmware/ and add the following entry to a file in /etc/modprobe.d/

    options snd-hda-intel patch=samsung-950qed
Comment 5 Jordi Torres 2022-05-26 22:36:02 UTC
> The initialization sequence you provided is somehow incomplete. I ran the
> trace myself against a fresh win11 install, and got a trace of commands that
> works for both speakers (at a hefty 3500 lines).

When I was testing the verbs, I had confusing behavious, sometimes only right speaker worked and sometimes both speakers worked until I discovered that audio gets unitialized only when is fully shutdown, rebooting it keeps sound card in the same state.

I tested the verbs that you provide using applyverbs.py and I get the same result, only left channel works. About the patch file, seems that gets ignored as there is no indication in the dmesg that patching happens or fails. I noticed that snd_hda_intel likely doesn't pass probe because the presence of DSP and DMIC making the module that actually loads being skl_hda_dsp_generic

I attach dmesg so you can see how snd_hda gets loaded
Comment 6 Jordi Torres 2022-05-26 22:36:52 UTC
Created attachment 301054 [details]
Dmesg of startup
Comment 7 Max Vohra 2022-05-27 00:26:10 UTC
I'm fairly certain that some pin configuration is off, as using this configuration after a fresh boot seems to result in overloading a component on the right channel amplifier. 

I smelled the all-too familiar smell of magic smoke coming from the right hand side when I tested the change after a power cycle, and now the right channel is significantly quieter even in windows. I'm still in the return window but I might try and open it up and see what the amplifier actually is first.
Comment 8 Jordi Torres 2022-05-28 22:59:04 UTC
After some experimentation, I got a reliable way to stay with correct codec state after run windows vm and reboot with sound working correctly under Linux. Basically I forced close qemu while was playing sound in windows vm and I reboot without pcistub taking over soundcard.

With the correct state, I proceeded to use alsa-info for get another pin config dump and then I made a patch between the output from the machine fully shutdown booting into Linux and the machine rebooted after use the vm
Comment 9 Jordi Torres 2022-05-28 23:02:08 UTC
Created attachment 301069 [details]
Alsa info diff between Linux initialized hda to Windows initialized hda
Comment 10 Pepe R. 2022-11-02 01:04:21 UTC
Sadly having the same problem here. Have tried solutions like this from 5 different forums, to no avail. Sound works if using headphones or bluetooth, but speakers won't work.

I've updated the kernel to 6.0.1, but it made no difference. Using Ubuntu 22.04.
Comment 11 Drew R. 2022-11-14 04:37:14 UTC
I'm in the same boat, tried everything, headphones work, speakers do not.  I have the Galaxy Book2 Pro (NP950XEE).
Comment 12 Drew R. 2022-11-14 21:33:11 UTC
(In reply to Max Vohra from comment #7)
> I'm fairly certain that some pin configuration is off, as using this
> configuration after a fresh boot seems to result in overloading a component
> on the right channel amplifier. 
> 
> I smelled the all-too familiar smell of magic smoke coming from the right
> hand side when I tested the change after a power cycle, and now the right
> channel is significantly quieter even in windows. I'm still in the return
> window but I might try and open it up and see what the amplifier actually is
> first.

This just happened to me!  I've been researching and trying 1,000 combination of settings for 7 days now, and using this samsung950.fw (and changing the first line to match my hardware) is the very first thing that finally gave me sound.  But I got sound on the left speaker, and loud static on the right, and smelled something (thought I was crazy).  I too am still in my return window.  What happened with you - Is the right side permanently blown or fixable?  And any clue how to fix the samsung950.fw file so this doesn't happen?  I finally felt so close after struggling with this so long, and don't know if I'm almost there or just broke this thing :(
Comment 13 Drew R. 2022-11-14 23:24:06 UTC
(In reply to Jordi Torres from comment #8)
> After some experimentation, I got a reliable way to stay with correct codec
> state after run windows vm and reboot with sound working correctly under
> Linux. Basically I forced close qemu while was playing sound in windows vm
> and I reboot without pcistub taking over soundcard.
> 
> With the correct state, I proceeded to use alsa-info for get another pin
> config dump and then I made a patch between the output from the machine
> fully shutdown booting into Linux and the machine rebooted after use the vm

So did you create a new updated list of verbs, or a new samsung950.fw file?  I used the one originally posted here.  (It seems for me, the patch file gets applied only if I use "options snd-intel-dspcfg dsp_driver=1" to force use of snd-hda-intel, and then I can reboot without it to keep the same state.  Problem is, first time the patch was applied and sound was played, the right channel produced loud static, I think i smelled light smoke, and then the right channel is now silent in linux.  In windows, the left channel is fine, and the right is super quiet (like some amp blew, but what do I know).  I'm trying to figure out if I should return the machine before my window expires, but more importantly also trying to figure out how to avoid same result on a new machine if I get one.
Comment 14 Jordi Torres 2022-11-15 01:08:54 UTC
(In reply to Drew R. from comment #13)
> (In reply to Jordi Torres from comment #8)
> > After some experimentation, I got a reliable way to stay with correct codec
> > state after run windows vm and reboot with sound working correctly under
> > Linux. Basically I forced close qemu while was playing sound in windows vm
> > and I reboot without pcistub taking over soundcard.
> > 
> > With the correct state, I proceeded to use alsa-info for get another pin
> > config dump and then I made a patch between the output from the machine
> > fully shutdown booting into Linux and the machine rebooted after use the vm
> 
> So did you create a new updated list of verbs, or a new samsung950.fw file? 
> I used the one originally posted here.  (It seems for me, the patch file
> gets applied only if I use "options snd-intel-dspcfg dsp_driver=1" to force
> use of snd-hda-intel, and then I can reboot without it to keep the same
> state.  Problem is, first time the patch was applied and sound was played,
> the right channel produced loud static, I think i smelled light smoke, and
> then the right channel is now silent in linux.  In windows, the left channel
> is fine, and the right is super quiet (like some amp blew, but what do I
> know).  I'm trying to figure out if I should return the machine before my
> window expires, but more importantly also trying to figure out how to avoid
> same result on a new machine if I get one.

The list of verbs extracted was https://bugzilla.kernel.org/attachment.cgi?id=301033 and I didn't try the samsung950.fw ones because I couldn't guess how make snd-hda-intel take over the default one. I didn't experiment weird smells or heard loud static but I noticed a slight difference in volume with the right one. The list of verbs I extracted only makes work left channel but in the similar issue on sofproject https://github.com/thesofproject/sof/issues/5993 the last answer contains a list of verbs https://pastebin.com/45ksYAXX that works well with both speakers, just it's too large.

I don't know if your amp burn problems is related to the usage of some verbs or maybe due force snd_hda_intel being used, probably your best bet is do RMA I guess
Comment 15 Drew R. 2022-11-15 07:41:51 UTC
(In reply to Jordi Torres from comment #14)
> (In reply to Drew R. from comment #13)
> > (In reply to Jordi Torres from comment #8)
> > > After some experimentation, I got a reliable way to stay with correct
> codec
> > > state after run windows vm and reboot with sound working correctly under
> > > Linux. Basically I forced close qemu while was playing sound in windows
> vm
> > > and I reboot without pcistub taking over soundcard.
> > > 
> > > With the correct state, I proceeded to use alsa-info for get another pin
> > > config dump and then I made a patch between the output from the machine
> > > fully shutdown booting into Linux and the machine rebooted after use the
> vm
> > 
> > So did you create a new updated list of verbs, or a new samsung950.fw file? 
> > I used the one originally posted here.  (It seems for me, the patch file
> > gets applied only if I use "options snd-intel-dspcfg dsp_driver=1" to force
> > use of snd-hda-intel, and then I can reboot without it to keep the same
> > state.  Problem is, first time the patch was applied and sound was played,
> > the right channel produced loud static, I think i smelled light smoke, and
> > then the right channel is now silent in linux.  In windows, the left
> channel
> > is fine, and the right is super quiet (like some amp blew, but what do I
> > know).  I'm trying to figure out if I should return the machine before my
> > window expires, but more importantly also trying to figure out how to avoid
> > same result on a new machine if I get one.
> 
> The list of verbs extracted was
> https://bugzilla.kernel.org/attachment.cgi?id=301033 and I didn't try the
> samsung950.fw ones because I couldn't guess how make snd-hda-intel take over
> the default one. I didn't experiment weird smells or heard loud static but I
> noticed a slight difference in volume with the right one. The list of verbs
> I extracted only makes work left channel but in the similar issue on
> sofproject https://github.com/thesofproject/sof/issues/5993 the last answer
> contains a list of verbs https://pastebin.com/45ksYAXX that works well with
> both speakers, just it's too large.
> 
> I don't know if your amp burn problems is related to the usage of some verbs
> or maybe due force snd_hda_intel being used, probably your best bet is do
> RMA I guess

I'm going to see if I can get a replacement tomorrow.  So on a new machine, I guess I will try the one at the link https://pastebin.com/45ksYAXX - Is that what you're using?  Is it a problem that it's too large (aside from not being elegant)?  So with these larger set of verbs, you have sound in both speakers, just slightly less in the right?  (Because now mine is virtually inaudible in the right).
Comment 16 Drew R. 2022-11-16 00:01:50 UTC
Jordi -

So I used the large set of verbs you suggested, on a new replacement machine (not sure if that was necessary or not), and it works - Thank you so much!  But while the volume was slightly less in the right the first time I ran the verbs, it seems to get less and less on the right side each time the verbs are applied.  Just curious, did you notice this as well?
Comment 17 Adam Hill 2023-04-06 18:45:23 UTC
Just to jump in here - I've got a Galaxy Book3 Pro 360 and had just about given up on getting the speakers working - however, I've also tried that long verb list and it works on my machine too... progress indeed!
Comment 18 John Q 2023-04-18 22:13:42 UTC
Can confirm this also works for the Galaxy Book 3 Pro (non-360)
Comment 19 Simon Verbois 2023-05-02 23:28:36 UTC
Hello, I did not find how to apply the last verbs file, do you have a procedure? I could test on my samsung galaxy book 3 16' 360
Thank you
Comment 20 Thomas Legay 2023-06-14 22:13:50 UTC
On debian hda-verb command is on alsa-tools

You need to run script as root.

Work for me on galaxy book 3 16' 360.

Only keyboard backlight don't work now

Note You need to log in before you can comment on or make changes to this bug.