Audio: S/PDIF output went missing after plugging out headphones

Hello everyone.

I was using a soundbar with my PC through an optical cable and decided to try using headphones (connected via 3.5 mm Jack). After a day or so I removed the headphones. Now, I only see line out and headphones options in the audio panel, but no digital out - so I can’t get any sound.

I didn’t do any updates or upgrades for a while. The first time I tried the headphones, I was able to return to using the soundbar after removing the headphone’s cable (I was trying line out at the back vs headphone out front of the case).

How can I get the digital out option back?

Nixos version: 24.05
Desktop: KDE Plasma 5.27
Kernel: 6.6.22 (64-bit)

dmesg | grep -i audio
[    1.663745] usb 5-1: SerialNumber: Creative Live! Cam Sync 1080p V2 Audio
[    2.822919] snd_hda_intel 0000:2d:00.1: Handle vga_switcheroo audio client
[    2.848175] snd_hda_codec_realtek hdaudioC1D0: ALCS1200A: SKU not ready 0x00000000
[    2.848631] snd_hda_codec_realtek hdaudioC1D0: autoconfig for ALCS1200A: line_outs=3 (0x14/0x15/0x16/0x0/0x0) type:line
[    2.848634] snd_hda_codec_realtek hdaudioC1D0:    speaker_outs=0 (0x0/0x0/0x0/0x0/0x0)
[    2.848636] snd_hda_codec_realtek hdaudioC1D0:    hp_outs=1 (0x1b/0x0/0x0/0x0/0x0)
[    2.848637] snd_hda_codec_realtek hdaudioC1D0:    mono: mono_out=0x0
[    2.848638] snd_hda_codec_realtek hdaudioC1D0:    dig-out=0x1e/0x0
[    2.848639] snd_hda_codec_realtek hdaudioC1D0:    inputs:
[    2.848641] snd_hda_codec_realtek hdaudioC1D0:      Front Mic=0x19
[    2.848642] snd_hda_codec_realtek hdaudioC1D0:      Rear Mic=0x18
[    2.848643] snd_hda_codec_realtek hdaudioC1D0:      Line=0x1a
[    2.909302] input: HD-Audio Generic Front Mic as /devices/pci0000:00/0000:00:08.1/0000:2f:00.4/sound/card1/input13
[    2.909356] input: HD-Audio Generic Rear Mic as /devices/pci0000:00/0000:00:08.1/0000:2f:00.4/sound/card1/input14
[    2.909444] input: HD-Audio Generic Line as /devices/pci0000:00/0000:00:08.1/0000:2f:00.4/sound/card1/input15
[    2.909552] input: HD-Audio Generic Line Out Front as /devices/pci0000:00/0000:00:08.1/0000:2f:00.4/sound/card1/input16
[    2.961303] input: HD-Audio Generic Line Out Surround as /devices/pci0000:00/0000:00:08.1/0000:2f:00.4/sound/card1/input17
[    2.961364] input: HD-Audio Generic Line Out CLFE as /devices/pci0000:00/0000:00:08.1/0000:2f:00.4/sound/card1/input18
[    2.961433] input: HD-Audio Generic Front Headphone as /devices/pci0000:00/0000:00:08.1/0000:2f:00.4/sound/card1/input19
[    4.308402] usbcore: registered new interface driver snd-usb-audio

Please LMK what additional info I should post, if any. Thanks in advance!

The issue continues to persist. I’ve been using Bluetooth connection in the meanwhile, which sometimes doesn’t work (like right now, which is why I’m down in this rabbit hole again). After working through the issue with the nixos custom gpt, I still can’t resolve the issue. I’ll try to post as much relevant information as I can.

Here’s the output from systemctl status pipewire.service journalctl -xe | grep pipewire:

Warning: The unit file, source configuration file or drop-ins of pipewire.service changed on disk. Run 'systemctl daemon-reload' to reload units.
○ pipewire.service
     Loaded: masked (Reason: Unit pipewire.service is masked.)
     Active: inactive (dead)
May 24 14:22:40 jakePillar pipewire[1870]: mod.jackdbus-detect: Failed to receive jackdbus reply: org.freedesktop.DBus.Error.ServiceUnknown: The name org.jackaudio.service was not provided by any .service files
May 24 14:35:47 jakePillar sudo[3157]:   erolca : TTY=pts/0 ; PWD=/home/erolca ; USER=root ; COMMAND=/run/current-system/sw/bin/systemctl unmask pipewire.service
May 24 14:36:05 jakePillar sudo[3163]:   erolca : TTY=pts/0 ; PWD=/home/erolca ; USER=root ; COMMAND=/run/current-system/sw/bin/systemctl enable pipewire.service

alsamixer shows spdif output as enabled but pavucontrol doesn’t list it in the devices menu.

I tried sudo systemctl unmask pipewire.service which received Failed to unmask unit: File /etc/systemd/system/pipewire.service: Read-only file system.

Here’s the sound-related part from my configuration.nix:

sound.enable = true;
  hardware.pulseaudio.enable = false;
  security.rtkit.enable = true;
  services.pipewire = {
    enable = true;
    alsa.enable = true;
    alsa.support32Bit = true;
    pulse.enable = true;
    # If you want to use JACK applications, uncomment this
    jack.enable = true;

    # use the example session manager (no others are packaged yet so this is enabled by default,
    # no need to redefine it in your config for now)
    #media-session.enable = true;
  };

I hope someone who knows what they are doing can help me here.