Comment 51 for bug 1648183

Revision history for this message
Robert Joynt (robertjjoynt) wrote :

Hi Folks. I've found another issue with the Realtek ALC295 codec in Linux and I have a fix for this too (see #17 in this thread for my initial fix).

When I boot into Windows first and then into Linux, there are two problems:

1. The internal speakers don't work (headphones are okay).
2. The internal microphone doesn't respond.

To fix the problem, I can do the following:

Install alsa-tools if not installed:

sudo apt install alsa-tools

Create and save a script in /usr/local/bin:

#!/bin/bash
# Fix for no sound from internal speakers when rebooting from Windows
hda-verb /dev/snd/hwC0D0 0x20 SET_COEF_INDEX 0x10
hda-verb /dev/snd/hwC0D0 0x20 SET_PROC_COEF 0x0120
hda-verb /dev/snd/hwC0D0 0x20 SET_COEF_INDEX 0x0d
hda-verb /dev/snd/hwC0D0 0x20 SET_PROC_COEF 0xa023
# Fix for no mic and headphone jack switching when rebooting from Windows
hda-verb /dev/snd/hwC0D0 0x20 SET_COEF_INDEX 0x45
hda-verb /dev/snd/hwC0D0 0x20 SET_PROC_COEF 0x5289
hda-verb /dev/snd/hwC0D0 0x20 SET_COEF_INDEX 0x46
hda-verb /dev/snd/hwC0D0 0x20 SET_PROC_COEF 0x0004

Run the script as root in a terminal to immediately fix the problem.

To run the script on startup, use cron with the @reboot command:

sudo crontab -e

and then add line in crontab:
@reboot [full path to script]

(note that I put this cron entry before my initial fix, but I don't think it matters).

Please note that the script doesn't need to be copied or linked to /lib/systemd/system-sleep as the fix persists after a suspend/wake.

For more technical details regarding this fix, see https://bugzilla.kernel.org/show_bug.cgi?id=195457