ROG Strix G512LU_G512LU has ALC294 audio codec that is not very similar to ALC4080
(ALC4080 is similar to an ALC1220 but appears as an internal USB device)
2015 iMac probably has Cirrus Logic CS4206 audio codec, not very similar to ALC294
But similar issues with ALC294 audio codec on Asus laptops have been reported before:
Sound from speakers no sound from 3.5mm jack-audio - #20 by ZeroAnarchy
Audio doesn't work in internal speaker but it works on Headphones
209585 – Headphones are not being detected on ASUS ProArt StudioBook Pro 15 W500G5T
206145 – ALC294 - no sound working at all on ASUS UX534
203443 – no sound in laptop ASUS UX362FA - sending repair
201961 – Problem with Realtek ALC294 Codec with Intel HDA sound
I suggest you get ALSA information
sudo alsa-info.sh --upload
and check if anything in your data is similar to data posted for other systems