Description of problem:
ThinkPad P50 has built-in speakers (via Intel 100 Series/C230 Series Chipset Family HD Audio Controller), an HDMI port and a miniDP (both via NVIDIA GM107 High Definition Audio Controller [GeForce 940MX]).
When I plug 1 screen with speakers to HDMI (or miniDP), I can switch sound output (using pavucontrol or Gnome Control Center) without problem. The NVIDIA output has only "HDMI 4" profile active (others are marked as unplugged) and it works.
When I connect 2 external displays (HDMI + miniDP, both with speakers), there are 2 active profiles ("HDMI 4" for the first screen and "HDMI 5" for the later connected screen). When I switch to NVIDIA, "HDMI 4" is selected and sound comes from the first screen. When I try to switch to "HDMI 5" (pavucontrol - Configuration tab), sound is redirected to built-in speakers.
I found a workaround (for Pavucontrol) - when I switch the output to built-in, then switch profile of NVIDIA to "HDMI 5" and then the output to NVIDIA, sound is routed to the second screen.
And it is even more complicated: Once the "HDMI 5" is selected and working, I can freely switch between "HDMI 4" and "HDMI 5". But after I switch back to built-in and then back to NVIDIA with "HDMI 4" profile selected, the problem is back.
Similar problem occurs in Gnome Control Center, but I have not found a workaround there.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Have a Lenovo P50 (or other notebook with 2 HDMI/DP outputs?)
2. Log-in to Gnome
3. Start Pavucontrol
4. Connect 2 external screens with speakers (2 active HDMI profiles should appear for the external output in the Configuration tab)
5. Play some long sound
6. Select the external output for palying application (Pavucontrol - Playback) - the first profile should be used (HDMI 4 in my case)
7. Select the second available profile at Pavucontrol - Configuration (HDMI 5 in my case)
Sound is routed (and output switched) to built-in speakers.
Sound should be routed to the second external screen.
Looks similar to bz489049