Created attachment 296525 [details] ALSA info No sound at all whereas all controls and settings seem to work without hiccups. Turns out a GPIO pin needs to be set. Found this out using hda-analyzer python script. Now I execute this script on start-up to make it work: /usr/bin/hda-verb /dev/snd/hwC0D0 0x01 SET_GPIO_MASK 0x04 /usr/bin/hda-verb /dev/snd/hwC0D0 0x01 SET_GPIO_DIRECTION 0x04 /usr/bin/hda-verb /dev/snd/hwC0D0 0x01 SET_GPIO_DATA 0x04 The strange thing is, when I close applications using sound, the system goes mute within a minute or so and I have to run hda-analyzer to toggle the 'enable' settings of this GPIO pin. For now I run the gnome settings widget at startup, displaying the sound settings and running the hda-verb commands above. This seems enough to leave the sound on.
Try to pass model=alc256-asus-aio option to snd-hda-intel module. Either boot with snd_hda_intel.model=alc256-asus-aio boot option or create a file (e.g. /etc/modprobe.d/hda.conf) containing options snd-hda-intel model=alc256-asus-aio If this works, we can put a static quirk entry for your device, too.
(In reply to Takashi Iwai from comment #1) > Try to pass model=alc256-asus-aio option to snd-hda-intel module. > Either boot with snd_hda_intel.model=alc256-asus-aio boot option or > create a file (e.g. /etc/modprobe.d/hda.conf) containing > > options snd-hda-intel model=alc256-asus-aio > > If this works, we can put a static quirk entry for your device, too. Unfortunately this doesn't work
Strange. Give alsa-info.sh output again after applying the option.
Created attachment 296593 [details] ALSA info with option: alc256-asus-aio
Behaviour is still the same: I have to manually toggle the GPIO switch and keep a sound stream open, like gnome sound settings. Otherwise sound is gone after I close the settings and open it again.
The proc content in comment 4 shows the GPIO[2] is set, which corresponds to 0x04. Do you mean that this wasn't set automatically? Then please give alsa-info.sh output before your manual tweaks.
Created attachment 296599 [details] ALSA info, cold boot, with option: alc256-asus-aio Added the alsa_info.txt after a cold boot, with no tweaks, but the model parameter.
Seems that the GPIO pin is properly set with this model, but appearenly it is muted already before the system is started and I'm able to start a sound stream.
I don't understand the comment 8. What is muted, what didn't work, and what is this GPIO supposed to do for?
Ok, let me elaborate a bit more then ;-) This GPIO pin is needed to drive the speakers (both built-in as well as headphones). Probably it switches on an amplifier? When the GPIO is set, the currently played audio will be audible, but when there is no sound stream being played, system will go silent shortly therafter, even when enabled is set active. When a new stream is started, I have to toggle the GPIO to disabled and then back to enabled again to hear sound again. With the model=alc256-asus-aio set the GPIO is set correctly, but as there was no sound to be played when the pin was set, the setup went silent already, before I could start a sound stream. Let me know if this is more clear? I can also create a video if that helps....
OK, thanks. This sounds like a unique behavior, the amp has some automatic shut down, as it seems. The current setup is either always-on statically, or bound with Master switch, so it's essentially always on. This needs a completely different way of control of GPIO unlike others.
A PoC fix patch is below. Could you give it a try?
Created attachment 296609 [details] Test fix patch
Hi Takashi, this PoC works! Toggling 'data' pin has the same effect as toggling the 'enable' pin appearently. Only thing is now that pins 'out-dir' and 'enable' are off by default. If I start hda-analyzer and set these two pins, your solution works flawless. Playing multiple streams simultaneously, closing one and the other, restarting a stream etc. Furthermore, with model=alc256-asus-aio in modprobe it doesn't work anymore.
Oh indeed, I forgot to set up the GPIO mask and dir. The revised v2 patch is below. Let me know if this works as is. And, yes, you need to pass no model option with the patch.
Created attachment 296627 [details] Revised test patch
Hi Takashi, thanx for your great job, it works perfect now! The sounds is audible from cold boot, after a restart and after suspend / standby.
Good to hear! The fix patch was now submitted to the upstream. It'll be merged to sound.git tree and will be propagated to 5.13-rc1 kernel likely in the next week.