IPv6/IPv4 sink/source name conflict race condition with module-zeroconf-discover
Submitted by Tyson Whitehead
Assigned to pul..@..op.org
Description
By default (at least under Debian) it seems that both IPv6 and IPv4 services are anounced by pulse when using the module-zeroconf-publish.
- eth0 IPv6 pulse@palmer: Internal Audio Analog Stereo _pulse-source._tcp local
- eth0 IPv4 pulse@palmer: Internal Audio Analog Stereo _pulse-source._tcp local
- eth0 IPv6 pulse@palmer _pulse-server._tcp local
- eth0 IPv4 pulse@palmer _pulse-server._tcp local
- eth0 IPv6 pulse@palmer: Internal Audio Analog Stereo _pulse-sink._tcp local
- eth0 IPv4 pulse@palmer: Internal Audio Analog Stereo _pulse-sink._tcp local
If I load the module-zeroconf-discover on another machine, it tries and sets the same named sinks and sources for the IPv4 and IPv6 addresses.
Jan 31 21:22:28 tux pulseaudio[776]: [pulseaudio] module-zeroconf-discover.c: Loading module-tunnel-source with arguments 'server=[fe80::217:31ff:fe2a:76a7]:4713 source=alsa_input.pci-0000_00_04.0.analog-stereo format=s16le channels=2 rate=48000 source_name=tunnel.palmer.local.alsa_input.pci-0000_00_04.0.analog-stereo channel_map=front-left,front-right'
Jan 31 21:22:28 tux pulseaudio[776]: [pulseaudio] module-zeroconf-discover.c: Loading module-tunnel-sink with arguments 'server=[fe80::217:31ff:fe2a:76a7]:4713 sink=alsa_output.pci-0000_00_04.0.analog-stereo format=s16le channels=2 rate=48000 sink_name=tunnel.palmer.local.alsa_output.pci-0000_00_04.0.analog-stereo channel_map=front-left,front-right'
Jan 31 21:22:28 tux pulseaudio[776]: [pulseaudio] module-zeroconf-discover.c: Loading module-tunnel-source with arguments 'server=[192.168.1.66]:4713 source=alsa_input.pci-0000_00_04.0.analog-stereo format=s16le channels=2 rate=48000 source_name=tunnel.palmer.local.alsa_input.pci-0000_00_04.0.analog-stereo channel_map=front-left,front-right'
Jan 31 21:22:28 tux pulseaudio[776]: [pulseaudio] module-zeroconf-discover.c: Loading module-tunnel-sink with arguments 'server=[fe80::217:31ff:fe2a:76a7]:4713 sink=alsa_output.pci-0000_00_04.0.analog-stereo format=s16le channels=2 rate=48000 sink_name=tunnel.palmer.local.alsa_output.pci-0000_00_04.0.analog-stereo channel_map=front-left,front-right'
The IPv6 ones fail (presumably) because I haven't actually setup IPv6
Jan 31 21:22:28 tux pulseaudio[776]: [pulseaudio] module-tunnel.c: Stream died.
Jan 31 21:22:28 tux pulseaudio[776]: [pulseaudio] module-tunnel.c: Stream died.
This is fine. The problem is that frequently it manages to try and start the IPv4 ones with the same names before the IPv6 ones have failed. These fail as the sink/source name is still in use at that moment (by the failing IPv6 one).
Jan 31 21:22:28 tux pulseaudio[776]: [pulseaudio] sink.c: Failed to register name tunnel.palmer.local.alsa_output.pci-0000_00_04.0.analog-stereo.
The end result is that the creation of all the remote sinks and sources fail instead of just the IPv6 ones like I would have expected.
Perhaps the code could be changed to distinguish these names (suffix them to indicate IPv4 or IPv6?) or to just wait on the IPv6 ones to either succeed or fail before trying to start the IPv4 ones.
Thanks! -Tyson