After searching for quite a while, I have come up with a solution that works well for me and might help you too:
The code is mostly taken from here.
Get the code
There exists a python script that can reactivate the headphone jack. This code is taken from ektor5 on GitHub. You need to download the script, place it somewhere where your system finds it and make it executable. You can do all this with this line:
sudo wget https://raw.githubusercontent.com/ektor5/init-headphone/master/init-headphone -O /usr/local/sbin/init-headphone && sudo chmod +x /usr/local/sbin/init-headphone
Install dependencies
The init-headphone
script needs dependencies that can be installed with:
sudo apt-get install python-smbus
Add grub flag
Also, your kernel has to be started with an additional flag enabled. You can do this by editing the file ''/etc/default/grub''. Alter this line
GRUB_CMDLINE_LINUX=""
to this
GRUB_CMDLINE_LINUX="acpi_enforce_resources=lax"
After that run
sudo update-grub
Load modules at start up
Additionally, the script needs to modules to be loaded. Namely ´i2c_dev´ and ´i2c_i801´. These can be loaded at runtime with
modprobe i2c_dev
modprobe i2c_i801
You can now test whether it works, by running ´sudo init-headphone´.
To automatically load the modules on startup, add the following lines to ''/etc/modules'':
i2c_dev
i2c_i801
Create startup script
Last of all, we want the script to run automatically, when our computer reboots or returns from suspension. To do so, place the following script in ´/etc/pm/sleep.d/´.
sudo gedit /etc/pm/sleep.d/init-headphone
Add the following lines
#!/bin/sh
if [ ! -x /usr/local/sbin/init-headphone ]; then
exit 0
fi
case $1 in
resume|thaw)
/usr/local/sbin/init-headphone
;;
esac
And don't forget to make the file executable
sudo chmod +x /etc/pm/sleep.d/init-headphone
I hope this helps, let me know if you have any problems.
cbandera
Best Answer
Okay, how this works is beyond me
I went to the ASUS website and downloaded the audio driver for my computer. This didn't change anything, except make my laptop speakers sound better.
Now, when I reboot into windows from linux, the jack doesn't work. But when I turn the computer off and on, and boot into windows, the jack works.
There it is. A complete mystery. At least I know how to make it work, now.