# No way of getting sound with the ALC294 from the Asus Zenbook 13



## giocitta (Nov 12, 2020)

In my ZenBook 13 laptop, I installed from scratch, a few days ago, FreeBSD-12.2. Everything (and above all, wifi and touchpad) does work as expected, but sound. I managed to get it from the internal speakers and from the headphones: no success! While performing all required tests, everything seems OK, but - anywhere - no sound. A similar problem, caused by a bug in the ALC294 driver, appeared in the past for some Linux distributions but was corrected with a new patched kernel. I'm now, simply, asking: are FreeBSD-12.2 developers trying to find a solution, possibly easily applicable by medium-level FreeBSD users? Many thanks for who will clear the actual situation.


----------



## SirDice (Nov 12, 2020)

This uses the snd_hda(4) driver? That driver is very flexible because manufactures can implement it in various different ways. So sometimes you need to play around with the pin settings to make it work for your specific situation. Read the man page, it's explained in detail there.


----------



## George (Nov 12, 2020)

There is a one year old proposed patch for alc294 in PR 210138.

A snippet of it...


```
else if (id == HDA_CODEC_ALC294 && subid == ASUS_UX331_SUBVENDOR) {
+        switch (nid) {
+        case 25:
+            config = 0x01a1103c;
+            break;
+        case 33:
+            patch = "as=1 seq=15";
+            break;
+        }
```


----------



## SirDice (Nov 12, 2020)

Elazar said:


> There is a one year old proposed patch for alc294 in PR 210138.


That doesn't look like the correct PR. This one is a four year old issue with security/maia.


----------



## George (Nov 12, 2020)

Sorry. PR 242802 "[snd:hda] fix no sound on headphones of Asus UX331UAL (ALC294)"


----------



## giocitta (Nov 12, 2020)

Too difficult to understand and apply. Simpler instructions would be very appreciated!


----------



## giocitta (Nov 12, 2020)

Elazar said:


> Sorry. PR 242802 "[snd:hda] fix no sound on headphones of Asus UX331UAL (ALC294)"


Sorry to verify my bits of knowledge. My ASUS ZenBook is a UX333FN. If I well understood, I should modify the two files (hdaa_patches.c and hdac.h) as suggested, and then rebuild/reinstall my kernel. I proceeded, but again no sound. What did I miss? Thanks for your help.


----------



## SirDice (Nov 13, 2020)

```
BUGS
     Some Hardware/OEM vendors tend to screw up	BIOS settings or use custom
     unusual CODEC wiring that create problems to the driver.  This may	result
     in	missing	pcm devices, or	a state	where the snd_hda driver seems to at-
     tach and work, but	no sound is played.  Some cases	can be solved by tun-
     ing loader.conf variables.	 But before trying to fix problem that way,
     make sure that there really is a problem and that the PCM audio device in
     use really	corresponds to the expected audio connector.
```
From snd_hda(4).

I would suggest doing a verbose boot and taking a look at the pin assignments. You may need to adjust those for your system.


----------



## giocitta (Nov 13, 2020)

Thanks, SirDice. I perfectly understand what you have written. I'll search to resolve according to your suggestions.


----------



## giocitta (Nov 15, 2020)

Hi, I couldn't resolve because - due to my absolute incompetence in audio problems - I don't understand which are my pin assignments, and eventually how to adjust those for my system. I hope that some pious souls will justify me and be pious (and patient!) enough to guide me in the necessary steps.

     In verbose 4 boot, I find this in dmesg:

hdac0: <Intel Cannon Lake HDA Controller> mem 0xb4318000-0xb431bfff,0xb4100000-0xb41fffff at device 31.3 on pci0

hdacc0: <Realtek ALC294 HDA CODEC> at cad 0 on hdac0
hdaa0: <Realtek ALC294 Audio Function Group> at nid 1 on hdacc0
pcm0: <Realtek ALC294 (Internal Analog)> at nid 23 and 18 on hdaa0
pcm1: <Realtek ALC294 (Right Analog Headphones)> at nid 33 on hdaa0
hdacc1: <Intel Kaby Lake HDA CODEC> at cad 2 on hdac0
hdaa1: <Intel Kaby Lake Audio Function Group> at nid 1 on hdacc1
pcm2: <Intel Kaby Lake (HDMI/DP 8ch)> at nid 3 on hdaa1

     $ dmesg | grep pcm
pcm0: <Realtek ALC294 (Internal Analog)> at nid 23 and 18 on hdaa0
pcm1: <Realtek ALC294 (Right Analog Headphones)> at nid 33 on hdaa0
pcm2: <Intel Kaby Lake (HDMI/DP 8ch)> at nid 3 on hdaa1

Well, where are the pin assignments I should take into account, and how to adjust them for my system? Thanks in advance!


----------



## tingo (Nov 15, 2020)

If you do a verbose boot and paste the dmesg output somewhere (pastebin?) with a link to it in this thread it is much easier for people to help you. ("Somewhere" because it is too large to be put here on the forums).


----------



## giocitta (Nov 16, 2020)

Hi tingo, thanks for your help (and for the kind underlying reproach!). I hope I have not made any mistakes. 









						DMESG.txt - Pastebin.com
					

Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.




					pastebin.com
				











						SNDSTAT.txt - Pastebin.com
					

Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.




					pastebin.com
				











						PCM - Pastebin.com
					

Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.




					pastebin.com


----------



## tingo (Nov 16, 2020)

You managed to get the files on pastebin - good. Now, as I wrote, the interesting details about pins and connections for the sound card only shows up in dmesg if you do a verbose boot...


----------



## giocitta (Nov 19, 2020)

Hi everyone, I have studied for a long time following the wise advice of SirDice and Tingo, and I have learned many things that I did not know (not needing them either with Windows or with Gentoo - with which latest OS the configuration is also perfect for the audio). However I can't get any sound out and before I quit, at least on laptops, FreeBSD (I would be sorry because it's a really interesting and trauma-resistant OS), I want to try asking the experts for further help.

My ASUS ZenBook 13 has:
--- Realtek ALC294 HDA CODEC at cad 0 on controller hdac0 (hdacc0) and Realtek ALC294 Audio Function Group at nid 1 on hdacc0:
--- Intel Kaby Lake HDA CODEC at cad 2 on controller hdac0 (hdacc1) and Intel Kaby Lake Audio Function Group at nid 1 on hdacc1.

hdacc0 manages the internal speaker (and microphone?) and the Headphones; hdacc1, the HDMI connection.
I attach below what I find in dmesg thanks to the verbose boot.









						BIOS values - Pastebin.com
					

Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.




					pastebin.com
				




--- pcm0 (default) is Realtek ALC294 (Analog 2.0+HP/2.0) at nid 23 and 18 on hdaa0;
--- pcm1 is Realtek ALC294 (Right Analog Headphones) at nid 33 on hdaa0.
--- pcm2: is Intel Kaby Lake (HDMI/DP 8ch) at nid 3 on hdaa1

Well, if I put ***dev.hdaa.0.init_clear="0"*** in device.hints, I expect the default configuration values set up by the BIOS to be accepted. By selecting pcm0 as the default, no sound is reproduced. 
If, on the other hand, I put ***hint.hdaa.0.nid23.config="as=1 seq=0"*** and ***hint.hdaa.0.nid33.config="as=1 seq=15"***, I still don't get any sound.

I find NumGPIO=4, NumGPo=0, GPIWake=0, GPIUnsol=1. But, to tell the truth, this doesn't seem influential to me. And here I stop because I can't go further (but I think it is an initial good position for an 85 years old newbie).

Can any of the audio experts suggest to me what to do (if possible studying any more!) to config my sound output? Thanks a lot!


----------



## claudfernandes (Nov 19, 2020)

I also have the same problem, I will also refer the link here if need more logs or information about this issue. this also one of the reasons I stop using freebsd...









						Realtek ALC294 Mic, Internal no sound. Could some help me with snd_hda setup in /boot/device.hints
					

Some background. I am new using FreeBSD, this audio issue I had before with Manjaro and was also reported occuring in other linux distros, but later Kernel was patched.  No sound comes from the internal speaker, I can only hear sound if I connect headphones via port USB C and add this on   cat...




					forums.freebsd.org
				




I will try to help you with the tests too


----------



## giocitta (Nov 21, 2020)

Well, after many days of experimenting (but alas, I'm just a doctor and not a developer!), I made the decision to give up and go back to Gentoo. I hope that in the future the snd_hda driver problem will be solved with the proper patches, as done for Linux, so that I can return to using FreeBSD (14.0?) in what is one of the most popular and modern laptops, the ASUS ZenBook. Anyhow, thanks to those who suggested or helped me.


----------

