How to force analog output and disable s/pdif?

Questions about codecs, DVD playback, web plugins...
Forum rules
Before you post please read how to get help
Bronze Globe
Level 3
Level 3
Posts: 112
Joined: Wed Dec 14, 2016 1:27 am

How to force analog output and disable s/pdif?

Post by Bronze Globe »

Something is wonky, and my computer keeps thinking I'm using S/PDIF, instead of analog output. Totally wrong. Sometimes fidgeting with the plug, unplugging, replugging, may work, but not always. I'd like it to be forced to use the headphones setting instead, and never S/PDIF, so my speakers work, instead of sitting silent. Please tell me a way to do that.

Code: Select all

inxi -Fxxxrz
System:    Kernel: 5.4.0-42-generic x86_64 bits: 64 compiler: gcc v: 9.3.0 Desktop: Cinnamon 4.6.7 info: mate-panel 
           wm: muffin 4.6.3 dm: LightDM 1.30.0 Distro: Linux Mint 20 Ulyana base: Ubuntu 20.04 focal 
Machine:   Type: Desktop System: Gateway product: W3653 v: 700 serial: <filter> 
           Mobo: ELITE model: 945GCT-M3 v: 3.1 serial: <filter> BIOS: 945GCT-M3 v: 1.10 date: 12/24/2007 
CPU:       Topology: Dual Core model: Intel Celeron E1200 bits: 64 type: MCP arch: Core Merom rev: D L2 cache: 512 KiB 
           flags: lm nx pae sse sse2 sse3 ssse3 bogomips: 6399 
           Speed: 1600 MHz min/max: 1200/1600 MHz Core speeds (MHz): 1: 1597 2: 1594 
Graphics:  Device-1: Intel 82945G/GZ Integrated Graphics vendor: Elite Systems driver: i915 v: kernel bus ID: 00:02.0 
           chip ID: 8086:2772 
           Display: x11 server: X.Org 1.20.8 driver: intel unloaded: fbdev,modesetting,vesa resolution: 1440x900~60Hz 
           OpenGL: renderer: Mesa DRI Intel 945G v: 1.4 Mesa 20.0.8 direct render: Yes 
Audio:     Device-1: Intel NM10/ICH7 Family High Definition Audio vendor: Elite Systems driver: snd_hda_intel v: kernel 
           bus ID: 00:1b.0 chip ID: 8086:27d8 
           Sound Server: ALSA v: k5.4.0-42-generic 
Network:   Device-1: Realtek RTL-8100/8101L/8139 PCI Fast Ethernet Adapter driver: 8139too v: 0.9.28 port: ec00 
           bus ID: 01:02.0 chip ID: 10ec:8139 
           IF: enp1s2 state: up speed: 100 Mbps duplex: full mac: <filter> 
           Device-2: Realtek RTL-8100/8101L/8139 PCI Fast Ethernet Adapter vendor: Elite Systems driver: 8139too v: 0.9.28 
           port: ea00 bus ID: 01:05.0 chip ID: 10ec:8139 
           IF: enp1s5 state: down mac: <filter> 
Drives:    Local Storage: total: 633.46 GiB used: 169.89 GiB (26.8%) 
           ID-1: /dev/sda vendor: Seagate model: ST3160023A size: 149.05 GiB speed: <unknown> serial: <filter> rev: 8.01 
           scheme: MBR 
           ID-2: /dev/sdb vendor: Western Digital model: WD3200AAJS-22B4A0 size: 298.09 GiB speed: <unknown> serial: <filter> 
           rev: 3A01 scheme: MBR 
           ID-3: /dev/sdc model: SSD7EP7011-080-IGT-3 size: 74.53 GiB speed: <unknown> serial: <filter> rev: 1104 scheme: MBR 
           ID-4: /dev/sdd model: SSD7EP7011-120-IGT-2 size: 111.79 GiB speed: <unknown> serial: <filter> rev: 1104 scheme: MBR 
Partition: ID-1: / size: 145.71 GiB used: 60.82 GiB (41.7%) fs: ext4 dev: /dev/sda1 
           ID-2: swap-1 size: 37.25 GiB used: 0 KiB (0.0%) fs: swap dev: /dev/sdb6 
Sensors:   System Temperatures: cpu: 66.0 C mobo: N/A 
           Fan Speeds (RPM): N/A 
Repos:     No active apt repos in: /etc/apt/sources.list 
           Active apt repos in: /etc/apt/sources.list.d/official-package-repositories.list 
           1: deb http://packages.linuxmint.com ulyana main upstream import backport #id:linuxmint_main
           2: deb http://archive.ubuntu.com/ubuntu focal main restricted universe multiverse
           3: deb http://archive.ubuntu.com/ubuntu focal-updates main restricted universe multiverse
           4: deb http://archive.ubuntu.com/ubuntu focal-backports main restricted universe multiverse
           5: deb http://security.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse
           6: deb http://archive.canonical.com/ubuntu/ focal partner
Info:      Processes: 230 Uptime: 18d 22h 31m Memory: 2.91 GiB used: 2.39 GiB (82.1%) Init: systemd v: 245 runlevel: 5 
           Compilers: gcc: 9.3.0 alt: 7/9 Shell: bash v: 5.0.17 running in: gnome-terminal inxi: 3.0.38 
User avatar
MrEen
Level 22
Level 22
Posts: 15169
Joined: Mon Jun 12, 2017 8:39 pm

Re: How to force analog output and disable s/pdif?

Post by MrEen »

Hi Bronze Globe,

That should be doable. Let's see the output of pacmd list-cards.
Bronze Globe
Level 3
Level 3
Posts: 112
Joined: Wed Dec 14, 2016 1:27 am

Re: How to force analog output and disable s/pdif?

Post by Bronze Globe »

I hope so. Thanks!

Code: Select all

pacmd list-cards
1 card(s) available.
    index: 0
	name: <alsa_card.pci-0000_00_1b.0>
	driver: <module-alsa-card.c>
	owner module: 7
	properties:
		alsa.card = "0"
		alsa.card_name = "HDA Intel"
		alsa.long_card_name = "HDA Intel at 0xfdff8000 irq 24"
		alsa.driver_name = "snd_hda_intel"
		device.bus_path = "pci-0000:00:1b.0"
		sysfs.path = "/devices/pci0000:00/0000:00:1b.0/sound/card0"
		device.bus = "pci"
		device.vendor.id = "8086"
		device.vendor.name = "Intel Corporation"
		device.product.id = "27d8"
		device.product.name = "NM10/ICH7 Family High Definition Audio Controller"
		device.form_factor = "internal"
		device.string = "0"
		device.description = "Built-in Audio"
		module-udev-detect.discovered = "1"
		device.icon_name = "audio-card-pci"
	profiles:
		input:analog-stereo: Analog Stereo Input (priority 65, available: unknown)
		output:analog-stereo: Analog Stereo Output (priority 6500, available: no)
		output:analog-stereo+input:analog-stereo: Analog Stereo Duplex (priority 6565, available: no)
		output:iec958-stereo: Digital Stereo (IEC958) Output (priority 5500, available: unknown)
		output:iec958-stereo+input:analog-stereo: Digital Stereo (IEC958) Output + Analog Stereo Input (priority 5565, available: unknown)
		off: Off (priority 0, available: unknown)
	active profile: <output:iec958-stereo+input:analog-stereo>
	sinks:
		alsa_output.pci-0000_00_1b.0.iec958-stereo/#4302: Built-in Audio Digital Stereo (IEC958)
	sources:
		alsa_input.pci-0000_00_1b.0.analog-stereo/#4923: Built-in Audio Analog Stereo
		alsa_output.pci-0000_00_1b.0.iec958-stereo.monitor/#4926: Monitor of Built-in Audio Digital Stereo (IEC958)
	ports:
		analog-input-front-mic: Front Microphone (priority 8500, latency offset 0 usec, available: yes)
			properties:
				device.icon_name = "audio-input-microphone"
		analog-input-rear-mic: Rear Microphone (priority 8200, latency offset 0 usec, available: no)
			properties:
				device.icon_name = "audio-input-microphone"
		analog-input-linein: Line In (priority 8100, latency offset 0 usec, available: no)
			properties:
				
		analog-output-lineout: Line Out (priority 9000, latency offset 0 usec, available: no)
			properties:
				
		analog-output-headphones: Headphones (priority 9900, latency offset 0 usec, available: no)
			properties:
				device.icon_name = "audio-headphones"
		iec958-stereo-output: Digital Output (S/PDIF) (priority 0, latency offset 0 usec, available: unknown)
			properties:
				
User avatar
MrEen
Level 22
Level 22
Posts: 15169
Joined: Mon Jun 12, 2017 8:39 pm

Re: How to force analog output and disable s/pdif?

Post by MrEen »

Ahh, this was different than I expected. The analog output option is claiming to be not available. Let me see this so I can try to determine the cause:

Code: Select all

curl https://gitlab.freedesktop.org/pulseaudio/pulseaudio/raw/master/src/utils/pa-info?inline=false | bash | nc termbin.com 9999
That will output about 5 lines with the last line containing a URL pointing to your sound setup.
Bronze Globe
Level 3
Level 3
Posts: 112
Joined: Wed Dec 14, 2016 1:27 am

Re: How to force analog output and disable s/pdif?

Post by Bronze Globe »

Code: Select all

curl https://gitlab.freedesktop.org/pulseaudio/pulseaudio/raw/master/src/utils/pa-info?inline=false | bash | nc termbin.com 9999
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  2039  100  2039    0     0   1853      0  0:00:01  0:00:01 --:--:--  1855
edit to add: had the plug only partway in at that moment, and only had sound out of one speaker anyway, here it is with the plug all the way in:

Code: Select all

curl https://gitlab.freedesktop.org/pulseaudio/pulseaudio/raw/master/src/utils/pa-info?inline=false | bash | nc termbin.com 9999
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  2039  100  2039    0     0   3775      0 --:--:-- --:--:-- --:--:--  3768
lsof: WARNING: can't stat() fuse file system /root/.cache/doc
      Output information may be incomplete.
lsof: WARNING: can't stat() fuse.gvfsd-fuse file system /root/.cache/gvfs
      Output information may be incomplete.
Last edited by Bronze Globe on Sun Oct 11, 2020 2:17 pm, edited 2 times in total.
User avatar
MrEen
Level 22
Level 22
Posts: 15169
Joined: Mon Jun 12, 2017 8:39 pm

Re: How to force analog output and disable s/pdif?

Post by MrEen »

Sooo close...

There should be one more line with a termbin.com URL on it.

If it never appears, try the command again. May need to wait some minutes if the server is busy.
Bronze Globe
Level 3
Level 3
Posts: 112
Joined: Wed Dec 14, 2016 1:27 am

Re: How to force analog output and disable s/pdif?

Post by Bronze Globe »

Sorry, added to my prior post while you were already replying.
User avatar
MrEen
Level 22
Level 22
Posts: 15169
Joined: Mon Jun 12, 2017 8:39 pm

Re: How to force analog output and disable s/pdif?

Post by MrEen »

Got it. Checking now.
User avatar
MrEen
Level 22
Level 22
Posts: 15169
Joined: Mon Jun 12, 2017 8:39 pm

Re: How to force analog output and disable s/pdif?

Post by MrEen »

Ahh dangit!

Now run this one and choose upload when it asks:

Code: Select all

wget http://www.alsa-project.org/alsa-info.sh -O alsa-info.sh && bash alsa-info.sh
Most times the first command combines it all in one. Other times it doesn't produce the second half of the output. This command gets the other half.
User avatar
MrEen
Level 22
Level 22
Posts: 15169
Joined: Mon Jun 12, 2017 8:39 pm

Re: How to force analog output and disable s/pdif?

Post by MrEen »

Okay, there's some things I haven't seen before in that output that might be having an effect.

In the terminal run alsamixer and find the Aux column and when the column is highlighted press the m key.

I'm thinking that probably won't fix this, but wanted to try that first.

The next test is to run this then reboot and see if things work properly:

Code: Select all

sudo tee /etc/modprobe.d/blacklist-realtek.conf <<<'blacklist snd_hda_codec_realtek'
If it doesn't help or makes things worse, undo it with this and another reboot:

Code: Select all

sudo rm /etc/modprobe.d/blacklist-realtek.conf
And if we're still where we started run xed admin:///etc/pulse/default.pa in the terminal and when the file opens add this to the bottom:

Code: Select all

set-card-profile alsa_card.pci-0000_00_1b.0 output:analog-stereo+input:analog-stereo
Save the file, ignore the warnings in the terminal, then reboot and test.
Bronze Globe
Level 3
Level 3
Posts: 112
Joined: Wed Dec 14, 2016 1:27 am

Re: How to force analog output and disable s/pdif?

Post by Bronze Globe »

The darn thing is just working, at the moment. :?

I'll try the steps outlined when it returns to acting up again. Sorry to stall things here. Thank you for your help.
Bronze Globe
Level 3
Level 3
Posts: 112
Joined: Wed Dec 14, 2016 1:27 am

Re: How to force analog output and disable s/pdif?

Post by Bronze Globe »

Started acting up again, and so I tried the first two steps. Muting aux doesn't seem to have helped. sudo tee /etc/modprobe.d/blacklist-realtek.conf <<<'blacklist snd_hda_codec_realtek' may be working, or at least hasn't hurt things. With how finicky it is, I'm not totally sure it wouldn't just be working right now anyway, so I hesitate to call it fixed just yet. If not I'll continue to the next steps. Thank you again.
User avatar
MrEen
Level 22
Level 22
Posts: 15169
Joined: Mon Jun 12, 2017 8:39 pm

Re: How to force analog output and disable s/pdif?

Post by MrEen »

I have a suspicion this may have fixed the issue. We have forced the use of the generic parser by doing that, so it's probably reporting everything as available as it should.

We can wait until it's well tested before calling it solved though.
Bronze Globe
Level 3
Level 3
Posts: 112
Joined: Wed Dec 14, 2016 1:27 am

Re: How to force analog output and disable s/pdif?

Post by Bronze Globe »

I'm afraid it was a fluke, and it's being a putz again, so I've taken the step of undoing the blacklist file with sudo rm /etc/modprobe.d/blacklist-realtek.conf and rebooting. I've also added set-card-profile alsa_card.pci-0000_00_1b.0 output:analog-stereo+input:analog-stereo at the end of the file after running xed admin:///etc/pulse/default.pa as suggested, and rebooted.

It is functional at present. It was working for a few days anyway, apparently, and it's hard to tell with this iffy jack if it wouldn't just be detected despite the issue at the moment. :(
Bronze Globe
Level 3
Level 3
Posts: 112
Joined: Wed Dec 14, 2016 1:27 am

Re: How to force analog output and disable s/pdif?

Post by Bronze Globe »

I am unhappy to report that it's still not cooperating. :(
It is still flicking the analog output off willy-nilly.
User avatar
MrEen
Level 22
Level 22
Posts: 15169
Joined: Mon Jun 12, 2017 8:39 pm

Re: How to force analog output and disable s/pdif?

Post by MrEen »

Let's see this output again please:

Code: Select all

curl https://gitlab.freedesktop.org/pulseaudio/pulseaudio/raw/master/src/utils/pa-info?inline=false | bash | nc termbin.com 9999
Bronze Globe
Level 3
Level 3
Posts: 112
Joined: Wed Dec 14, 2016 1:27 am

Re: How to force analog output and disable s/pdif?

Post by Bronze Globe »

Code: Select all

curl https://gitlab.freedesktop.org/pulseaudio/pulseaudio/raw/master/src/utils/pa-info?inline=false | bash | nc termbin.com 9999
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  2039  100  2039    0     0    869      0  0:00:02  0:00:02 --:--:--   869
User avatar
MrEen
Level 22
Level 22
Posts: 15169
Joined: Mon Jun 12, 2017 8:39 pm

Re: How to force analog output and disable s/pdif?

Post by MrEen »

For some reason, not your fault, that one broke.

Try it once more please.
Bronze Globe
Level 3
Level 3
Posts: 112
Joined: Wed Dec 14, 2016 1:27 am

Re: How to force analog output and disable s/pdif?

Post by Bronze Globe »

I have done it a couple more times, once when sound was back on the analog for a moment, and another when it was down again.

Code: Select all

curl https://gitlab.freedesktop.org/pulseaudio/pulseaudio/raw/master/src/utils/pa-info?inline=false | bash | nc termbin.com 9999
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  2039  100  2039    0     0   1159      0  0:00:01  0:00:01 --:--:--  1159

Code: Select all

curl https://gitlab.freedesktop.org/pulseaudio/pulseaudio/raw/master/src/utils/pa-info?inline=false | bash | nc termbin.com 9999
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  2039  100  2039    0     0    656      0  0:00:03  0:00:03 --:--:--   656
Last edited by MrEen on Sun Oct 11, 2020 2:09 pm, edited 1 time in total.
Post Reply

Return to “Sound, Multimedia, & Codecs”