Bug 45523 - IPv6/IPv4 sink/source name conflict race condition with module-zeroconf-discover
Summary: IPv6/IPv4 sink/source name conflict race condition with module-zeroconf-discover
Status: RESOLVED MOVED
Alias: None
Product: PulseAudio
Classification: Unclassified
Component: modules (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: pulseaudio-bugs
QA Contact: pulseaudio-bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-01 20:57 UTC by Tyson Whitehead
Modified: 2018-07-30 09:58 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Tyson Whitehead 2012-02-01 20:57:23 UTC
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
Comment 1 Tyson Whitehead 2012-02-04 10:48:14 UTC
BTW, I was poking around a bit more and also discovered why the IPv6 address is failing.

In order to connect to a destination on a IPv6 link local addresses you have to also indicate the interface.  Rerunning the zeroconf load-module command with the IPv6 address suffixed by "%eth0" makes it all work fine.

$ pacmd
Welcome to PulseAudio! Use "help" for usage information.
>>> load-module module-tunnel-sink server=[fe80::217:31ff:fe2a:76a7%eth0]: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

I've added a note to 40785 (Error connecting to PulseAudio server via IPv6) to this end.

Cheers!  -Tyson
Comment 2 GitLab Migration User 2018-07-30 09:58:42 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/144.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.