Ubuntu 20.04 headphones detected but no sound
I had exactly the same problem as you, except for a ASUS GL503 (but also Realtek ALC295). It drove me nuts as I tried every conceivable sound fix that I have seen for Ubuntu and derived systems. In the end, it appears it is kernel related and it mostly affects us ASUS users. There is a discussion here: https://forum.manjaro.org/t/sound-from-speakers-no-sound-from-3-5mm-jack-audio/5343/20
The easiest solution for me was to edit /etc/modprobe.d/alsa-base.conf (I think on some computers, it may be just alsa.conf) and insert this as the last line: options snd-hda-intel model=headset-mode
Then do a complete shutdown and restart.
It is possible that this change may cause you to lose the microphone in the headset, if you have one. In that case, you will probably have to try one of the other options in the link that I posted above, which will probably require you to recompile your Kernel with the applicable patch.
There is a workaround for the problem you are facing, I am having the same issue with Realtek ACL295 (Asus Rog GL503). So here is what I found as a fix.
If you want to use Headphone but are willing to sacrifice the headphone mic
Go to :
/etc/modprobe.d/alsa-base.conf
Add the following line at the end as suggested by Ben B
options snd-hda-intel model=headset-mode
Restart Your System.
If you want to use External Microphone but are willing to sacrifice the headphone (hearing) , then replace the above line with the following:
options snd-hda-intel model=headset-multi
Restart Your System.
NOTE: IN BOTH THE CASES YOUR SPEAKERS STILL WORK FINE. HOWEVER, IN THE LATTER, YOUR BUILT-IN MIC WORKS. I PREFER THE SECOND OPTION.
The first option is good, if you want to use headphone mics, external mics etc.
[UPDATE]: This morning I was completely able to fix this issue where you can now use all your headsets with microphones by replacing all the above lines with the following:
options snd_hda_intel model=dell-headset-multi
Even if your system is not a dell system, it'll still work since the setting is for Realtek ALC295 and not a particular brand in general.
Once you do this, restart your system, and try plugging in a headphone
Now it will give you an option to choose what type of device it is.
THIS IMAGE HERE
P.S -> They are visible in notification panel due to Gnome Extensions. You can go in settings and choose your preference.