Sound comes from speakers only when headphones are plugged

I have the weirdest behaviour on my new laptop (Huawei matebook 16s). After installing Tumbleweed, the sound card was not recognized, I installed sof-firmware. The sound card got recognized.

The weird behaviour is, when I play anything, no sound comes out of the speaker of the laptop. When I plug the headphones, the sound starts comping out of the laptop speakers, but no sound comes out of the headphones. Once I unplug the headphones, sound stops coming out of the laptop speakers. I cannot manage to get any sound out of the headphones.
I installed kubuntu and I get the same exact weird behaviour there. I reinstalled Windows to check, everything works fine there, normal behaviour.

I tried to follow some troubleshooting but nothing worked. I got some info about the card using an ALSA script.

Manufacturer: HUAWEI
Product Name: CREFG-XX
Product Version: M1010
Firmware Version: 1.07
System SKU: C233
Board Vendor: HUAWEI
Board Name: CREFG-XX-PCB

I could not find /etc/modprobe.d/50-sound.conf file, it seems this was referred to in an old troubleshooting post.

I don’t know what to do next. Can anyone help?