bayasdev / envycontrol

Easy GPU switching for Nvidia Optimus laptops under Linux
https://bayas.dev/envycontrol
MIT License
1.12k stars 55 forks source link

[BUG] Hybrid Mode disables hdmi audio #171

Open salvirosales99 opened 2 weeks ago

salvirosales99 commented 2 weeks ago

Describe the bug When I switch from default to hybrid and reboot,the hdmi output device dissapears.Using sudo envycontrol --reset and rebooting,makes the device back again

To Reproduce Steps to reproduce the behavior:

  1. Run sudo envycontrol -s hybrid
  2. Reboot
  3. Go to audio device
  4. The audio device dissapears

Expected behavior After reboot,it should show the HDMI audio device

System Information:

bayasdev commented 2 weeks ago

@salvirosales99 I think the problem is in the udev rules, if you go to /lib/udev/rules.d/80-nvidia-pm.rules and comment the line that removes the audio devices, rebuild your initramfs and reboot, does the problem go away?

salvirosales99 commented 2 weeks ago

@salvirosales99 I think the problem is in the udev rules, if you go to /lib/udev/rules.d/80-nvidia-pm.rules and comment the line that removes the audio devices, rebuild your initramfs and reboot, does the problem go away?

Excuse me,how do I know about that? I'll drop what 80-nvidia-pm.rules has: `# Automatically generated by EnvyControl

Remove NVIDIA USB xHCI Host Controller devices, if present

ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x0c0330", ATTR{remove}="1"

Remove NVIDIA USB Type-C UCSI devices, if present

ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x0c8000", ATTR{remove}="1"

Remove NVIDIA Audio devices, if present

ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x040300", ATTR{remove}="1"

Enable runtime PM for NVIDIA VGA/3D controller devices on driver bind

ACTION=="bind", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x030000", TEST=="power/control", ATTR{power/control}="auto" ACTION=="bind", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x030200", TEST=="power/control", ATTR{power/control}="auto"

Disable runtime PM for NVIDIA VGA/3D controller devices on driver unbind

ACTION=="unbind", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x030000", TEST=="power/control", ATTR{power/control}="on" ACTION=="unbind", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x030200", TEST=="power/control", ATTR{power/control}="on"

`

bayasdev commented 2 weeks ago

Please remove these lines

# Remove NVIDIA Audio devices, if present
ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x040300", ATTR{remove}="1"
salvirosales99 commented 2 weeks ago

Now the HDMI audio is back

bayasdev commented 2 weeks ago

Now the HDMI audio is back

Amazing, could you check if RTD3 is working when HDMI is not connected?

salvirosales99 commented 2 weeks ago

Now the HDMI audio is back

Amazing, could you check if RTD3 is working when HDMI is not connected?

You mean something like this: $ cat /proc/driver/nvidia/gpus/0000\:01\:00.0/power Runtime D3 status: Enabled (fine-grained) Video Memory: Active

GPU Hardware Support: Video Memory Self Refresh: Supported Video Memory Off: Supported