How to enable the S/PDIF output to be permanently active

I seem to have a big issue regarding the audio and Ubuntu, but I only have it with the S/PDIF output.

It virtually always stops providing a signal through the cable when there is no audio, therefore all of my DACs (3) that I have tried have their active light turn off, and they take nearly a full second to wake up almost every time there is any silence. This would be fine if it took this time when you switch inputs or turned it on or off, but it is really tedious when it does it all the time as you don't hear notifications and it skips the beginning of tracks on spotify for example.

I doubt this is to do with my DACs as they all do the same thing, and I do not have this issue with USB.

In windows 10, my motherboard must send out a fixed signal, as the light on my DACs never indicate that the signal has been lost when nothing is playing. Because of this, I never get delays when i play music or any other audio.

This won't be a hardware issue as I have had this problem every time I've used the optical output in all LTS versions of Ubuntu going right back to 16.04. 14.04 was the last time I could use the optical output without being faced with this issue. I've also gone through 3 motherboards over the years I've had this issue and they have all been the same. I don't understand why this isn't a common issue with a simple fix.

There must be some solution that others are finding for this as Ubuntu can't have gone this many years with an unusable optical output. I just don't know what causes the issue.

Would much appreciate some advice.

Thanks.

Hi Ben,

read this:

:slight_smile:

1 Like

Hi.

I don't seem to be seeing the same post that my email notified me of regarding Qasmixer.

Interestingly, I have just found out that opening pulseaudio and leaving it running provides a continuous signal and eliminates this issue. However, if i close it without realising, I will then miss notifications and other things so I could maybe do with a way of having pulse audio running in the system tray on boot.

This will be simpler than having to run a inaudible sound file which seem to be solutions for others.

If having the sound program running fixes the issue, I could just do with one that can be set to run in the system tray on boot, so I don't have to launch it to fix the issue every time.

I don't seem to be seeing the same post that my email notified me of regarding Qasmixer.

That one has been deleted. If you are interested in 'qasmixer'
to control your audiodriver and use the S/PDIF switches:
sudo apt install qasmixer

Interestingly, I have just found out that opening pulseaudio and leaving it running provides a continuous signal and eliminates this issue.

Let me explain some things:

  1. Pulseaudio has powersave build in, the link I gave you explains how to disable that powersave.
  2. Pulseaudio is always running, opening its window doesn't change that (although it might suspend powersave temporarely, I haven't looked into that) .

However, if i close it without realising, I will then miss notifications

You lost me here. What do you mean by 'realising' in this context ? What has this to do with notifications ?

This will be simpler than having to run a inaudible sound file which seem to be solutions for others.

It is not simpler. Playing an inaudible sound is as simple as:

aplay /dev/zero

which you could place in your autostart.

But in your case it would be a better and more elegant solution to switch off powersave as described in the forementioned link. It comes down to this:

In the following two files:
~/.config/pulse/default.pa
/etc/pulse/default.pa

change the lines:
load-module module-suspend-on-idle
to
# load-module module-suspend-on-idle

If you don't know how to do that, run the following in a terminal instead:

sed -i 's|.*suspend-on-idle.*|# load-module module-suspend-on-idle|g' ~/.config/pulse/default.pa
sudo sed -i 's|.*suspend-on-idle.*|# load-module module-suspend-on-idle|g' /etc/pulse/default.pa

save and reboot.

EDIT: fixed a typo

3 Likes

Regarding closing without realising, it will take me time to remember I have a reason to leave pulse audio open - and as a result, I may sometimes close it, and as a result, miss all brief notification sounds without being aware of that being the case.

As you have explained, if pulseaudio activates a powersave mode, it must only be active when the window for pulseaudio is closed in my case.

For me, while this won't be the best choice anyway, playing a continuous sound file will be a bit annoying at times, as I do a lot of recording audio from my desktop, and even if it isn't audible, the sound waves will be visible in the recording program. I understand this would be a simple solution for some, but not for me.

I will try out those commands to make the output permanently active and let you know if this works.

Thanks for the help.

playing a continuous sound file will be a bit annoying at times, as I do a lot of recording audio from my desktop, and even if it isn't audible, the sound waves will be visible in the recording program.

aplay /dev/zero
only sends samples with the value of zero
so it won't show up in your recording program nor add anything to the signal. It has no side effects besides keeping your S/PDIF alive (if it works for you ofcourse).

b.t.w. On my multimedia system I let the route to the optical out bypass pulseaudio, sending the output of mpv and audacious directly to the optical out in either S/PDIF, DTS or AC-3.
Only in very special circumstances I switch to pulseaudio either optical or analog out.

On my home PC I have pulseaudio over both S/PDIF and analog out simultaneously.

On my recording PC I use an UMC1820 over USB

P.S. There is a tiny chance to get hiccups in your audio when using aplay. If you encounter that, use this:

aplay -c 2 -f S16_LE -r 48000 /dev/zero

This plays a MS-WAVE conform stereo 48kHz stream of absolute silence to the default output (in your case; pulseaudio)

1 Like