Audio issue that comes and go

All the basic stuff on the Zorin 18 Pro is running as intended aside from the Audio which continues to be an issue. When I switch Zorin on the speakers function correctly for a while and then for cause I cannot seem to locate, the sound becomes tinny and barely perceptible. When I reboot Zorin all works fine again until it doesn't. When the audio works through the speakers and I then I switch to headphones and back to speakers, the audio stops working. I also run Nvidia but not sure if that can somehow interfere with the settings. I have also checked the Volume Control app but still not luck. Please help!

How are Your Audio Devices connected? Cable, Bluetooth, Wifi? And could You post the Output of the Command sudo lshw -C multimedia with all Devices conneted please?

They are an integral part of the laptop.

  *-multimedia              
       description: Audio device
       product: NVIDIA Corporation
       vendor: NVIDIA Corporation
       physical id: 0.1
       bus info: pci@0000:01:00.1
       logical name: card0
       logical name: /dev/snd/controlC0
       logical name: /dev/snd/hwC0D0
       logical name: /dev/snd/pcmC0D3p
       logical name: /dev/snd/pcmC0D7p
       logical name: /dev/snd/pcmC0D8p
       logical name: /dev/snd/pcmC0D9p
       version: a1
       width: 32 bits
       clock: 33MHz
       capabilities: pm msi pciexpress bus_master cap_list
       configuration: driver=snd_hda_intel latency=0
       resources: irq:17 memory:60080000-60083fff
  *-usb:0
       description: Video
       product: Integrated Camera
       vendor: Chicony Electronics Co.,Ltd.
       physical id: 8
       bus info: usb@3:8
       version: 11.08
       serial: 0001
       capabilities: usb-2.01
       configuration: driver=uvcvideo maxpower=500mA speed=480Mbit/s
  *-multimedia
       description: Multimedia audio controller
       product: Intel Corporation
       vendor: Intel Corporation
       physical id: 1f.3
       bus info: pci@0000:00:1f.3
       logical name: card1
       logical name: /dev/snd/controlC1
       logical name: /dev/snd/hwC1D0
       logical name: /dev/snd/hwC1D2
       logical name: /dev/snd/pcmC1D0c
       logical name: /dev/snd/pcmC1D0p
       logical name: /dev/snd/pcmC1D31p
       logical name: /dev/snd/pcmC1D3p
       logical name: /dev/snd/pcmC1D4p
       logical name: /dev/snd/pcmC1D5p
       logical name: /dev/snd/pcmC1D6c
       logical name: /dev/snd/pcmC1D7c
       version: 01
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi bus_master cap_list
       configuration: driver=sof-audio-pci-intel-tgl latency=32
       resources: iomemory:620-61f iomemory:620-61f irq:204 memory:6203190000-6203193fff memory:6203000000-62030fffff

I have just turned Zorin off and on again and the audio is working as normal and now I am watching out for the trigger. I have also checked the Nvidia settings and changed them to the tested version (instead of the default one). So let's see what happens.

PS. That did not work at the audio has reverted to the initial almost inaudible issue.

What is the brand/model of your computer? Maybe it is easier to find solutions for the specific hardware.

It's a Lenovo Yoga Pro 9 14IRP8

Maybe something from here can help you? You could try the solution of comment 15.

There seems to be a patch but for many users it seem not to help.

Maybe You could take a Look at this:

The issue is not that the sound is not working. The issue is that the sound works fine and the suddenly stops working. I will keep looking and report back when I find an answer. There is also the issue with Bluetooth. Every time I switch off on the laptop I have to manually reconnect everything. But I'll leave this for another day.

The issue seems to be with Nvidia which takes priority over Speaker-sof-hda-dsp.
Let me recreate the steps: switched on and there was no sound, went into the sound settings and saw that the output device was HDA NVidia Pro (there is also Pro 7 / Pro 8 / Pro 9) - when I changed the settings to use "Speakers-sof-hda-dsp" the inbuilt speakers started working again. So there seems to be some override caused by NVidia which kicks in at some point and seems to cause the issue.
Just found a reference: [SOLVED] Odd audio error - output directed to HDMI nVidia - #4 by AberSteve

After trying all kind of solution I have narrowed down the issue to the following: when first booting into Zorin the audio works as intended. After about 10 / 20 minutes it switches to the headphone jack and I cannot find a way to switch it back to the main speakers (even when switching the port to speakers).
The output device in Sound has not changed (Speakers-sof-hda-dsp)
If I go into Pulse Audio and switch the port from Headphone to Speakers the audio output continues via Speakers (although I cannot longer hear anything when I remove the headphone jack). It seems to be some kind of software configuration bug rather than hardware related.
Anyone else with ideas on how to solve this please let me know.

So, the Sound switches automatically to the Headphone Jack?

When I reboot Zorin it works as intended. I am currently running a movie in the background and the sound uses the correct speakers without any issue. I am now trying to establish if the change to the audio jack is triggered automatically after a set amount of time has elapsed, or when I open some different software. I'll get back to you on this.

So, the glitch does not happen automatically but it is triggered by stopping the audio for a few minutes and then reactivating it. When the audio reactivates it switches to the headphone jack although the output is still shown correctly in the sound setting and Pulse Audio. The only way to reset it is to speakers is to reboot.

Can you open a terminal session and type:

alsamixer

Post a screenshot and that may reveal something to us.

I forgot something to ask: Does Your System run in Wayland or X11? You can check that with the Terminal Command echo $XDG_SESSION_TYPE

When it runs in Wayland, I would suggest to try it with switching to X11/Xorg. to do that, go to the Login Screen. Click there on Your Profile so that the Password Field appears. When it is appeared, You should see a Gear Icon in the bottom right Corner. Click on it and choose the Option ''Zorin Desktop on Xorg'' and then log in.