0

I have 3 monitors (two of them 4K TVs), every time I restart, Ubuntu randomly picks one of the monitors as the sound device. It does not matter how many times I change it; my selection is not saved permanently.

And 7 times out of 10 it picks the one connected to the DVI port.

dvdmn
  • 103
  • Are all three monitors always connected and turned on when you boot the system? – Nmath Aug 09 '21 at 18:29
  • One of them turned off time to time, but this happens even if I have all of them turned on at the boot time – dvdmn Aug 09 '21 at 19:03
  • Ubuntu will not "randomly" pick a sound device, so there is something else under the surface at work. If you are booting inconsistently with different devices attached, that inconsistency will be replicated in the devices used. If this is the problem, the solution is to be consistent, especially if you are actually using one of these displays for sound. What is your sound configuration exactly? Do you have a dedicated sound device that is always connected that is unrelated to the displays, or are you using one or more of these displays for your sound? – Nmath Aug 09 '21 at 19:17
  • I use one of the TVs (connected with HDMI) as a speaker. Your logic totally makes sense. But the weird part; Ubuntu selects the DVI output even when it is not on. – dvdmn Aug 09 '21 at 20:04
  • I can't really answer your question, but I have a similar issue which I mention in case anything is a clue. I have 2 monitors and always want to use HDMI sound device of one of them. When I resume from suspend (I rarely reboot) sometimes it's fine and resumes with the correct sound output device but sometimes the sound output device is wrong or even completely missing. I put this down (I am guessing here) to the fact that when the PC resumes, it wakes the monitors. Maybe sometimes the PC wakes a split second before one or both of the monitors wake and therefore sets the wrong sound device? – codlord Aug 09 '21 at 21:08
  • I forgot about that one, sometimes there are no sound devices after "resume" – dvdmn Aug 09 '21 at 21:19
  • I decided to go back to windows 10... I don't like windows, but not as much as ubuntu... – dvdmn Aug 23 '21 at 19:40

1 Answers1

0

If your sound output devices are consistent and always present despite the wrong one being selected you may be able to have a startup script set to the correct one via command line like:

pacmd set-default-sink SINK_INDEX_NUMBER_HERE

and this to show what sinks and index numbers they are:

pacmd list-sinks

See here for some more information.

It's what I first tried when I had sound device issues, but didn't help me when my sound device was actually missing (as per my comment above).

If you boot/resume and your monitor sound device is missing the only "fixes" I have found so far are:

  1. Go to screen display settings, disable the monitor with the sound device, click Apply and when it asks if you want to keep the changes click Revert Settings.
  2. Run a script which changes the monitor screen to the wrong mode, in my case: xrandr --output DP-1 --mode 1920x1080 then immediately changes to the right mode: xrandr --output DP-1 --mode 2560x1080

Either approach always gets me my sound device back.

codlord
  • 2,506