Ticket #39 (closed defect: fixed)

Opened 5 years ago

Last modified 4 years ago

module-zeroconf-publish: invalid service name

Reported by: ZlatkO Owned by: lennart
Milestone: 0.9.7 Component: module-zeroconf-*
Keywords: Cc:

Description

I'm using pulseaudio-0.9.5, avahi-0.6.13, dbus-0.92. On startup, pulseaudio logs the following error to /var/log/syslog:

Oct 12 18:47:02 disclosure pulseaudio[2700]: module-zeroconf-publish.c: avahi_entry_group_add_service_strlst(): Invalid service name

The service name in question (s->service_name in module-zeroconf-publish.c, line 199) is, without the quotes, "Monitor Source of ALSA PCM on hw:0 (ES1371 DAC2/ADC) on disclosure". Other pulseaudio services get published fine, and can be seen in avahi-discover, avahi-browse, service-discovery-applet, etc.:

[zlatko@disclosure]:~$ avahi-browse -a -t | grep Pulse | sort
+ eth0 IPv4 disclosure                                    PulseAudio Sound Server local
+ eth0 IPv4 input_alsa_ens1371 on disclosure              PulseAudio Sound Source local
+ eth0 IPv4 input_alsa_headset on disclosure              PulseAudio Sound Source local
+ eth0 IPv4 input_alsa_nforce on disclosure               PulseAudio Sound Source local
+ eth0 IPv4 input_oss_es1371 on disclosure                PulseAudio Sound Source local
+ eth0 IPv4 input_oss_headset on disclosure               PulseAudio Sound Source local
+ eth0 IPv4 input_oss_nforce on disclosure                PulseAudio Sound Source local
+ eth0 IPv4 output_alsa_ens1371 on disclosure             PulseAudio Sound Sink local
+ eth0 IPv4 output_alsa_headset on disclosure             PulseAudio Sound Sink local
+ eth0 IPv4 output_alsa_nforce on disclosure              PulseAudio Sound Sink local
+ eth0 IPv4 output_oss_es1371 on disclosure               PulseAudio Sound Sink local
+ eth0 IPv4 output_oss_headset on disclosure              PulseAudio Sound Sink local
+ eth0 IPv4 output_oss_nforce on disclosure               PulseAudio Sound Sink local
[zlatko@disclosure]:~$ 

I use a bunch of add-autoload-{sink,source} statements instead of module-hal-discover in order to get sane sink and source names. I couldn't find a way to rename the monitor sources, however, so I couldn't experiment with changing its service name to something more simple.

Attachments

truncate_avahi_names.diff (0.6 kB) - added by geoffp 4 years ago.
Truncates avahi strings to fit into the 64 character max

Change History

Changed 5 years ago by ZlatkO

Update: the problem seems to be gone with dbus-1.0.1 and avahi-0.6.15. No more errors in /var/log/syslog, and the monitor source shows up fine.

[zlatko@disclosure]:~$ avahi-browse -a -t | grep Pulse | sort
+ eth0 IPv4 Monitor Source of ALSA PCM on hw:0 (Intel ICH5) on disclosure PulseAudio Sound Source local
+ eth0 IPv4 disclosure                                    PulseAudio Sound Server local
+ eth0 IPv4 input_alsa_headset on disclosure              PulseAudio Sound Source local
+ eth0 IPv4 input_alsa_intel on disclosure                PulseAudio Sound Source local
+ eth0 IPv4 input_oss_headset on disclosure               PulseAudio Sound Source local
+ eth0 IPv4 input_oss_intel on disclosure                 PulseAudio Sound Source local
+ eth0 IPv4 output_alsa_headset on disclosure             PulseAudio Sound Sink local
+ eth0 IPv4 output_alsa_intel on disclosure               PulseAudio Sound Sink local
+ eth0 IPv4 output_oss_headset on disclosure              PulseAudio Sound Sink local
+ eth0 IPv4 output_oss_intel on disclosure                PulseAudio Sound Sink local
+ eth0 IPv6 Monitor Source of ALSA PCM on hw:0 (Intel ICH5) on disclosure PulseAudio Sound Source local
+ eth0 IPv6 disclosure                                    PulseAudio Sound Server local
+ eth0 IPv6 input_alsa_headset on disclosure              PulseAudio Sound Source local
+ eth0 IPv6 input_alsa_intel on disclosure                PulseAudio Sound Source local
+ eth0 IPv6 input_oss_headset on disclosure               PulseAudio Sound Source local
+ eth0 IPv6 input_oss_intel on disclosure                 PulseAudio Sound Source local
+ eth0 IPv6 output_alsa_headset on disclosure             PulseAudio Sound Sink local
+ eth0 IPv6 output_alsa_intel on disclosure               PulseAudio Sound Sink local
+ eth0 IPv6 output_oss_headset on disclosure              PulseAudio Sound Sink local
+ eth0 IPv6 output_oss_intel on disclosure                PulseAudio Sound Sink local
[zlatko@disclosure]:~$ 

It still would be nice to have a way to rename/alias monitor sources as well, or even a generic sink/source renaming/aliasing mechanism, so we could have the best of both worlds (ie. HAL discovery and sane sink/source names). It's only a minor cosmetic thing, though, so feel free to close this ticket if you feel it's not worth the trouble.

Changed 5 years ago by lennart

  • status changed from new to assigned
  • type changed from defect to enhancement

Changed 5 years ago by hamfactorial

I am getting the same error, but I'm not sure how the original bug submitter was able to find the service name being attempted. Here is the output from my setup:

I: main.c: Found user 'pulse' (UID 119) and group 'pulse' (GID 449).
I: main.c: Successfully dropped root privileges.
I: alsa-util.c: Using mixer control "PCM".
I: sink.c: created 0 "alsa_output" with sample spec "s16le 2ch 44100Hz"
I: source.c: created 0 "alsa_output.monitor" with sample spec "s16le 2ch 44100Hz"
I: module-alsa-sink.c: using 8 fragments of size 1376 bytes.
I: module.c: Loaded "module-alsa-sink" (index: #0; argument: "device=hw:0 sink_name=alsa_output").
I: module.c: Loaded "module-esound-protocol-unix" (index: #1; argument: "").
I: protocol-native.c: Allowing access to group 'pulse-access'.
I: protocol-native.c: loading cookie from disk.
I: module.c: Loaded "module-native-protocol-unix" (index: #2; argument: "").
D: module-zeroconf-publish.c: Publishing services in Zeroconf
E: module-zeroconf-publish.c: avahi_entry_group_add_service_strlst(): Invalid service name
I: module.c: Loaded "module-zeroconf-publish" (index: #3; argument: "").
I: module-volume-restore.c: starting with empty ruleset.
I: module.c: Loaded "module-volume-restore" (index: #4; argument: "").
I: module.c: Loaded "module-rescue-streams" (index: #5; argument: "").
I: main.c: Daemon startup complete.

How can I diagnose the issue? I'm using avahi-0.6.18 with pulseaudio-0.9.6, dbus-1.0.2.

Changed 5 years ago by hamfactorial

After disabling my soundcard and using the onboard audio, the problem is gone. I am now using my onboard VIA sound with the snd-via82xx ALSA driver. Previously I was using the SB Live! Value card with the emu10k1 driver.

That's pretty strange, what's that all about?

Changed 5 years ago by danadocus

  • type changed from enhancement to defect

I have the same problem, and I am also using the emu10k1 driver.

I'm not sure if this is the reason or not, but I can't get the "server" to show up in avahi-discover, only the sink, on this machine.

Changed 5 years ago by lennart

The reason for this bug is probably just that the service name that PA concatenates from the hw name and stuff is longer then the maximum allowed DNS-SD name. Should be easy to fix in PA by truncating/ellipsizing the HW info string in some sensible way.

Changed 4 years ago by geoffp

I'm on emu10k also, with the same problem. My device strings are waaaay too long.

I'm attaching a patch I wrote that works for me as "truncate_avahi_names.diff. Disclaimer: all I have are my old C skills (if you can call them that) from college, so for all I know, this is too quick and dirty to be stable, but as I said, it works great for me. This patch is against the 0.9.6 branch.

Changed 4 years ago by geoffp

Truncates avahi strings to fit into the 64 character max

Changed 4 years ago by lennart

I fixed this issue the /branches/lennart branch a while back. I will close this bug as soon as I merge that branch back into trunk.

BTW, it's not that easy as you suggested to truncate the service names. You have to make sure that you don't create invalid utf8 characters that way.

Changed 4 years ago by lennart

  • component changed from daemon to module-zeroconf-*

Changed 4 years ago by lennart

  • milestone set to 0.9.7

Changed 4 years ago by geoffp

Excellent, lennart -- thanks for the fix. I'd like to look at your code; I'd completely forgotten about UTF-8.

Changed 4 years ago by Rudd-O

I continue to have this problem.

root@gabriela:/etc/pulse# dpkg -l pulseaudio libavahi-core5 dbus Desired=Unknown/Install/Remove/Purge/Hold | Status=Not/Installed/Config-f/Unpacked/Failed-cfg/Half-inst/t-aWait/T-pend |/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)

/ Nombre Versión Descripción

+++-==================================-==================================-==================================================================================== ii dbus 1.1.1-3ubuntu4 simple interprocess messaging system ii libavahi-core5 0.6.20-2ubuntu3 Avahi's embeddable mDNS/DNS-SD library ii pulseaudio 0.9.6-1ubuntu2 PulseAudio sound server

Emu10k1 again.

Changed 4 years ago by lennart

Rudd-O: not particularly surprising since this is still only fixed in 0.9.7-svn which is available in Fedora but not in the spaceboy distro.

Changed 4 years ago by lennart

  • status changed from assigned to closed
  • resolution set to fixed

Fixed in SVN trunk.

Note: See TracTickets for help on using tickets.