I will post my solution here, please post yours.
I've spent the past 2-3 days exclusively on the topic of configuring ALSA for my ASUS G752VY laptop - and it was not easy to find a somewhat satisfactory solution! User-friendliness looks otherwise. But I don't blame it on the ALSA developers - it is the manufacturers' fault: they don't communicate their 'jack settings' for each new laptop, as if it is some kind of state secret...
General idea
The idea of configuring ALSA on this laptop is basically this: do all what is said in the Gentoo ALSA Wiki and load the snd_hda_intel kernel module with the 'right' parameters. The whole problem lies in finding what 'right' means...
Configuration
Normally, all you would have to do to load snd_hda_intel kernel module with the 'right' parameters would be to choose the right 'model' among the following
Code: Select all
ALC66x/67x/892
==============
mario Chromebook mario model fixup
asus-mode1 ASUS
asus-mode2 ASUS
asus-mode3 ASUS
asus-mode4 ASUS
asus-mode5 ASUS
asus-mode6 ASUS
asus-mode7 ASUS
asus-mode8 ASUS
inv-dmic Inverted internal mic workaround
dell-headset-multi Headset jack, which can also be used as mic-in
https://www.mjmwired.net/kernel/Documen ... Models.txt
For ASUS G752VY, what came closest to a correct configuration was 'asus-mode5', so, as a first try, put
Code: Select all
options snd-hda-intel enable=1 index=0 enable_msi=1 model=asus-mode5/etc/modprobe.d/alsa.conf
unload and reload snd_hda_intel (with rmmod and modprobe respectively), start alsamixer (not alsamixergui, as this might be confused by an installed pulseaudio package and you don't need to start pulseaudio for all this - in fact, it is better to kill any pulse* process, until you get this right first) in an X terminal, unmute (by pressing 'M') any controls that are muted and play around to see what works and what not.
For me, even with model=asus-mode5, the alsamixer controls were not assigned correctly. For example, the headphone control in alsamixer does nothing, a speaker control controls the headphone, another speaker control seems to control (both?) speakers (or was it just the right one?) - and so on.
Other 'modes' got it even worse: after trying ALL asus-modeX 'models' (X=1,...,8 ) from the above list, I found that NONE of them provided a perfect solution:
Code: Select all
# This enables the headphones - but the subwoofer seems to be dead....
# ...and the speakers in alsamixer are certainly not correct!
# options snd-hda-intel model=asus-mode5 enable=1 index=0 enable_msi=1
# This seems to enable the subwoofer - but headphones are dead...
options snd-hda-intel model=asus-mode6 enable=1 index=0 enable_msi=1
Here are some posts that show how deep you have to dig:
The first one gives a lot of details - but is for ASUS ROG 751, not 752:
Asus G751 external mic not working. External headphones not working
What do we learn from the above? That we have to put code like the one given in the last post in a file named asus-g751-hda.fw and saved in /lib/firmware, then pass it to snd_hda_intel with
Code: Select all
options snd-hda-intel patch=asus-g751-hda.fw/etc/modprobe.d/alsa.conf
BUT - there is a caveat: the options are for ASUS ROG G751 - not G752VY... Fortunately, there is another post, with options that should fit G752VY exactly - or so claims its poster:
Sound configuration on ASUS G752VT
Now, here we have a 'workable configuration' for G752VT (hopefully not different in audio from G752VY...). Putting all this together, I created
/lib/firmware/asus-g752vy-hda.fw
with the content:
Code: Select all
[codec]
0x10ec0668 0x10431ced 0
[pincfg]
#Pin 12 is Internal Mic
0x12 0x90a60160
#Pin 14 is Internal "front" speakers
0x14 0x90170110
#Pin 15 is "Line Out" according to the manual, But Pin 15 won't let me pick that in HDA Jack Retask.
#Trying to use this as an output will have a constant tone too.
#Using this as an output breaks the front speakers working correctly with headphone detection.
0x15 0x40f000f0
#Pin 16 is the headphone jack.
0x16 0x0321403f
#Pin 18 is the external Microphone jack.
0x18 0x03a19020
#Pin 19 is nothing.
0x19 0x411111f0
#Pin 1a is the internal subwoofer. (Set the sound system to Stereo 2.1)
0x1a 0x90170151
#Pin 1b is nothing.
0x1b 0x411111f0
#Pin 1d is nothing.
0x1d 0x40c6852d
#Pin 1e is the internal SPDIF out.
0x1e 0x014b1180
#Pin 1f is nothing.
0x1f 0x411111f0
Code: Select all
cat /proc/asound/card0/codec#0 | grep IdCode: Select all
AFG Function Id: 0x1 (unsol 1)
Vendor Id: 0x10ec0668
Subsystem Id: 0x10431ced
Revision Id: 0x100003
Code: Select all
snd_hda_intel: unknown parameter 'patch' ignoredAnd what does this mean now?
After hours of searching, here is what it means:
Since I hadWhen CONFIG_SND_HDA_PATCH_LOADER=y is set, you can pass a "patch" as a firmware file for modifying the HD-audio setup before initializing the codec. This can work basically like the reconfiguration via sysfs in the above, but it does it before the first codec configuration.
(from: https://01.org/linuxgraphics/gfx-docs/d ... notes.html)
Code: Select all
grep CONFIG_SND_HDA_PATCH_LOADER /usr/src/linux/.config
# CONFIG_SND_HDA_PATCH_LOADER is not set
Why doesn't the error above give a hint? It gives you an error message and, although the solution is clear, it does not give you the slightest hint as to what you might need to do...
Here are the full details:
After recompiling the kernel withEarly Patching
When CONFIG_SND_HDA_PATCH_LOADER=y is set, you can pass a "patch" as a firmware file for modifying the HD-audio setup before initializing the codec. This can work basically like the reconfiguration via sysfs in the above, but it does it before the first codec configuration.
A patch file is a plain text file which looks like below:
The file needs to have a line [codec]. The next line should contain three numbers indicating the codec vendor-id (0x12345678 in the example), the codec subsystem-id (0xabcd1234) and the address (2) of the codec. The rest patch entries are applied to this specified codec until another codec entry is given. Passing 0 or a negative number to the first or the second value will make the check of the corresponding field be skipped. It'll be useful for really broken devices that don't initialize SSID properly.Code: Select all
[codec] 0x12345678 0xabcd1234 2 [model] auto [pincfg] 0x12 0x411111f0 [verb] 0x20 0x500 0x03 0x20 0x400 0xff [hint] jack_detect = no
The [model] line allows to change the model name of the each codec. In the example above, it will be changed to model=auto. Note that this overrides the module option.
After the [pincfg] line, the contents are parsed as the initial default pin-configurations just like user_pin_configs sysfs above. The values can be shown in user_pin_configs sysfs file, too.
Similarly, the lines after [verb] are parsed as init_verbs sysfs entries, and the lines after [hint] are parsed as hints sysfs entries, respectively.
Another example to override the codec vendor id from 0x12345678 to 0xdeadbeef is like below:
In the similar way, you can override the codec subsystem_id via [subsystem_id], the revision id via [revision_id] line. Also, the codec chip name can be rewritten via [chip_name] line.Code: Select all
[codec] 0x12345678 0xabcd1234 2 [vendor_id] 0xdeadbeef
The hd-audio driver reads the file via request_firmware(). Thus, a patch file has to be located on the appropriate firmware path, typically, /lib/firmware. For example, when you pass the option patch=hda-init.fw, the file /lib/firmware/hda-init.fw must be present.Code: Select all
[codec] 0x12345678 0xabcd1234 2 [subsystem_id] 0xffff1111 [revision_id] 0x10 [chip_name] My-own NEWS-0002
The patch module option is specific to each card instance, and you need to give one file name for each instance, separated by commas. For example, if you have two cards, one for an on-board analog and one for an HDMI video board, you may pass patch option like below:
(from: https://01.org/linuxgraphics/gfx-docs/d ... notes.html)Code: Select all
options snd-hda-intel patch=on-board-patch,hdmi-patch
Code: Select all
CONFIG_SND_HDA_PATCH_LOADER=y- Headphones work.
- Speakers work.
- Subwoofer works.
- Line-Out does not work (is it a Line-In perhaps?), but I can use the headphones jack as line-in to my external stereo set.
Enjoy!

