pulseaudio has long startup time when nvidia hdmi/dp sound is enabled
Submitted by Tom Yan
Assigned to pul..@..op.org
Description
So I have the following cards: [tom@localhost ~]$ aplay -l **** List of PLAYBACK Hardware Devices **** card 0: STX [Xonar STX], device 0: Multichannel [Multichannel] Subdevices: 1/1 Subdevice #0: subdevice #0 card 0: STX [Xonar STX], device 1: Digital [Digital] Subdevices: 1/1 Subdevice #0: subdevice #0 card 1: NVidia [HDA NVidia], device 3: HDMI 0 [HDMI 0] Subdevices: 1/1 Subdevice #0: subdevice #0 card 1: NVidia [HDA NVidia], device 7: HDMI 1 [HDMI 1] Subdevices: 1/1 Subdevice #0: subdevice #0 card 1: NVidia [HDA NVidia], device 8: HDMI 2 [HDMI 2] Subdevices: 1/1 Subdevice #0: subdevice #0
And this is how /dev/snd/ looks like: [tom@localhost ~]$ ls -l /dev/snd/ total 0 drwxr-xr-x 2 root root 80 Jan 10 21:39 by-path crw-rw----+ 1 root audio 116, 7 Jan 10 21:39 controlC0 crw-rw----+ 1 root audio 116, 2 Jan 10 21:39 controlC1 crw-rw----+ 1 root audio 116, 6 Jan 10 21:39 hwC1D0 crw-rw----+ 1 root audio 116, 9 Jan 10 21:39 pcmC0D0c crw-rw----+ 1 root audio 116, 8 Jan 10 21:39 pcmC0D0p crw-rw----+ 1 root audio 116, 11 Jan 10 21:39 pcmC0D1c crw-rw----+ 1 root audio 116, 10 Jan 10 21:39 pcmC0D1p crw-rw----+ 1 root audio 116, 3 Jan 10 21:39 pcmC1D3p crw-rw----+ 1 root audio 116, 4 Jan 10 21:40 pcmC1D7p crw-rw----+ 1 root audio 116, 5 Jan 10 21:39 pcmC1D8p crw-rw----+ 1 root audio 116, 1 Jan 10 21:39 seq crw-rw----+ 1 root audio 116, 33 Jan 10 21:39 timer
And you can see that the pulseaudio takes much longer (5 seconds!) to start before I blacklist snd-hda-intel (so that card 1 is gone):
Jan 10 21:31:33 localhost systemd[257]: Starting Sound Service... Jan 10 21:31:33 localhost systemd[257]: Started D-Bus User Message Bus. Jan 10 21:31:39 localhost systemd[257]: Started Sound Service. Jan 10 21:31:39 localhost systemd[257]: Reached target Default. Jan 10 21:31:39 localhost systemd[257]: Startup finished in 5.830s.
Jan 10 21:32:16 localhost systemd[248]: Starting Sound Service... Jan 10 21:32:17 localhost systemd[248]: Started D-Bus User Message Bus. Jan 10 21:32:17 localhost systemd[248]: Started Sound Service. Jan 10 21:32:17 localhost systemd[248]: Reached target Default. Jan 10 21:32:17 localhost systemd[248]: Startup finished in 306ms.
(https://gist.github.com/tomty89/76e9ce98ba85121fc12d/revisions?diff=split)
And the reason seems to be somehow pulse tries to open /dev/snd/pcmC1D{0,1,9-13}p (well also /dev/snd/pcmC1D0c) which does not exist. Please see my attached logs for details.
P.S. I do NOT file this bug report because it is blocking the login shell from popping up after I entered my password in the tty, though I think that could be an issue (of systemd?) too. I file this here merely because I think pulseaudio is doing something silly for HDMI/DP sound devices. As you can see it's being random (9-13, but not >=14, 4-6 or 2, or the existing 3, 7 and 8).