You are not logged in.

#1 2021-11-23 08:21:05

zegkljan
Member
Registered: 2017-12-30
Posts: 60

Video playback in browser broken due to (?) pipewire-zeroconf

I recently installed pipewire-zeroconf in order to be able to play sound over local network (the remote server runs pulseaudio). It works flawlessly. However, since then, browser audio/video playback on my local machine is broken. It manifests like this: when I play a video in a browser (I tested Firefox and Chrome, although there are subtle differences, see below; tried with YouTube, Twitter, and Facebook videos, all behave the same), the video plays for about 2-3 frames and then stops, while the sound continues playing. This happens even when module-zeroconf-disover module is not loaded at all. When I load that module and set the output for the browser to the remote server, it suddenly plays just fine.

Chrome behaves almost identically, except when I mute the sound, then the video playback runs as it should (but with no sound, obviously). When I unmute the sound, the video stops, but the sound continues, when I mute the sound again, the video "rushes" through the missed frames to catch up to where it should be.

Any ideas on how to fix this? It is really annoying. I'll be happy to provide diagnostic info if instructed, as I'm no expert on pipewire/pulseaudio.

Last edited by zegkljan (2021-11-23 08:21:34)

Offline

#2 2021-11-23 08:57:23

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,655

Re: Video playback in browser broken due to (?) pipewire-zeroconf

Check where they are actually configured to playback to and change the node if necessary in e.g. pavucontrol or so. During the "broken" situation, what's your output for

pactl list sinks
pactl list sink-inputs
sudo fuser -v /dev/snd/*

Offline

#3 2021-11-23 14:08:36

zegkljan
Member
Registered: 2017-12-30
Posts: 60

Re: Video playback in browser broken due to (?) pipewire-zeroconf

Without module-zeroconf-discover loaded, I have only one output device in pavucontrol. The browser shows up in the Playback tab, and it plays just as it should. Only the video-part of the video does not play. Seeking through the video works as well - the sound starts playing from the correct spot and the video shows the correct frame, but again only 2-3 of them and then stops (with sound continuing uninterrupted).

I also discovered another weird behavior. My output device has two ports - headphones (which are unplugged and show as unplugged) and line out (which is plugged and shows as plugged). During the broken situation, if I switch from line out to headphones, the sound goes out (obviously), but the video playback now restores. If I switch back, the sound goes back and the video does not stop, but only for about 5 seconds, then it stops again and it is as broken as before.

The outputs of the commands during the broken situation:

pactl list sinks

Sink #39
	State: RUNNING
	Name: alsa_output.pci-0000_00_1f.3.analog-stereo
	Description: Built-in Audio Analog Stereo
	Driver: PipeWire
	Sample Specification: s32le 2ch 48000Hz
	Channel Map: front-left,front-right
	Owner Module: 4294967295
	Mute: no
	Volume: front-left: 65536 / 100% / 0,00 dB,   front-right: 65536 / 100% / 0,00 dB
	        balance 0,00
	Base Volume: 65536 / 100% / 0,00 dB
	Monitor Source: alsa_output.pci-0000_00_1f.3.analog-stereo.monitor
	Latency: 0 usec, configured 0 usec
	Flags: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY 
	Properties:
		object.path = "alsa:pcm:0:front:0:playback"
		api.alsa.path = "front:0"
		api.alsa.pcm.card = "0"
		api.alsa.pcm.stream = "playback"
		audio.channels = "2"
		audio.position = "FL,FR"
		device.routes = "2"
		alsa.resolution_bits = "16"
		device.api = "alsa"
		device.class = "sound"
		alsa.class = "generic"
		alsa.subclass = "generic-mix"
		alsa.name = "ALC887-VD Analog"
		alsa.id = "ALC887-VD Analog"
		alsa.subdevice = "0"
		alsa.subdevice_name = "subdevice #0"
		alsa.device = "0"
		alsa.card = "0"
		alsa.card_name = "HDA Intel PCH"
		alsa.long_card_name = "HDA Intel PCH at 0xf7220000 irq 135"
		alsa.driver_name = "snd_hda_intel"
		device.profile.name = "analog-stereo"
		device.profile.description = "Analog Stereo"
		card.profile.device = "8"
		device.id = "38"
		factory.name = "api.alsa.pcm.sink"
		priority.driver = "1009"
		priority.session = "1009"
		media.class = "Audio/Sink"
		node.nick = "HDA Intel PCH"
		node.name = "alsa_output.pci-0000_00_1f.3.analog-stereo"
		device.description = "Built-in Audio Analog Stereo"
		device.icon_name = "audio-card-analog"
		device.bus = "pci"
		device.bus_path = "pci-0000:00:1f.3"
		device.form_factor = "internal"
		node.pause-on-idle = "false"
		factory.id = "18"
		client.id = "32"
		node.driver = "true"
		factory.mode = "merge"
		audio.adapt.follower = ""
		library.name = "audioconvert/libspa-audioconvert"
		object.id = "39"
		node.max-latency = "8192/48000"
	Ports:
		analog-output-lineout: Line Out (type: Line, priority: 9000, availability group: Legacy 4, available)
		analog-output-headphones: Headphones (type: Headphones, priority: 9900, availability group: Legacy 5, not available)
	Active Port: analog-output-lineout
	Formats:
		pcm

pactl list sink-inputs

Sink Input #76
	Driver: PipeWire
	Owner Module: n/a
	Client: 80
	Sink: 39
	Sample Specification: float32le 2ch 48000Hz
	Channel Map: front-left,front-right
	Format: pcm, format.sample_format = "\"float32le\""  format.rate = "48000"  format.channels = "2"  format.channel_map = "\"front-left,front-right\""
	Corked: no
	Mute: no
	Volume: front-left: 65536 / 100% / 0,00 dB,   front-right: 65536 / 100% / 0,00 dB
	        balance 0,00
	Buffer Latency: 0 usec
	Sink Latency: 0 usec
	Resample method: PipeWire
	Properties:
		client.api = "pipewire-pulse"
		pulse.server.type = "unix"
		application.name = "Chromium"
		application.process.id = "13934"
		application.process.user = "zegklitz"
		application.process.host = "vetrnik"
		application.process.binary = "FacebookMessenger"
		application.language = "en_US.UTF-8"
		window.x11.display = ":1"
		application.process.machine_id = "5479d1346bfb493f919ce3a8e3c5f399"
		application.icon_name = "chromium-browser"
		media.name = "Playback"
		node.rate = "1/48000"
		stream.is-live = "true"
		node.name = "Chromium"
		node.autoconnect = "true"
		media.class = "Stream/Output/Audio"
		adapt.follower.node = ""
		object.register = "false"
		factory.id = "6"
		audio.adapt.follower = ""
		factory.mode = "split"
		library.name = "audioconvert/libspa-audioconvert"
		client.id = "80"
		object.id = "76"
		node.latency = "1024/48000"
		pulse.attr.maxlength = "4194304"
		pulse.attr.tlength = "16384"
		pulse.attr.prebuf = "12296"
		pulse.attr.minreq = "4096"
		module-stream-restore.id = "sink-input-by-application-name:Chromium"

Sink Input #67
	Driver: PipeWire
	Owner Module: n/a
	Client: 49
	Sink: 39
	Sample Specification: float32le 2ch 48000Hz
	Channel Map: front-left,front-right
	Format: pcm, format.sample_format = "\"float32le\""  format.rate = "48000"  format.channels = "2"  format.channel_map = "\"front-left,front-right\""
	Corked: no
	Mute: no
	Volume: front-left: 20364 /  31% / -30,46 dB,   front-right: 20364 /  31% / -30,46 dB
	        balance 0,00
	Buffer Latency: 0 usec
	Sink Latency: 0 usec
	Resample method: PipeWire
	Properties:
		client.api = "pipewire-pulse"
		pulse.server.type = "unix"
		application.name = "Firefox Developer Edition"
		application.process.id = "10732"
		application.process.user = "zegklitz"
		application.process.host = "vetrnik"
		application.process.binary = "firefox"
		application.language = "en_US.UTF-8"
		window.x11.display = ":1"
		application.process.machine_id = "5479d1346bfb493f919ce3a8e3c5f399"
		media.name = "Adrian Vandenberg (Vandenberg, Whitesnake) plays a guitar solo on the new Star One album! - YouTube"
		node.rate = "1/48000"
		stream.is-live = "true"
		node.name = "Firefox Developer Edition"
		node.autoconnect = "true"
		media.class = "Stream/Output/Audio"
		adapt.follower.node = ""
		object.register = "false"
		factory.id = "6"
		audio.adapt.follower = ""
		factory.mode = "split"
		library.name = "audioconvert/libspa-audioconvert"
		client.id = "49"
		object.id = "67"
		node.latency = "3600/48000"
		pulse.attr.maxlength = "4194304"
		pulse.attr.tlength = "48000"
		pulse.attr.prebuf = "38408"
		pulse.attr.minreq = "9600"
		module-stream-restore.id = "sink-input-by-application-name:Firefox Developer Edition"

sudo fuser -v /dev/snd/*

Cannot stat file /proc/9878/fd/4: Permission denied
Cannot stat file /proc/9878/fd/5: Permission denied
Cannot stat file /proc/9878/fd/6: Permission denied
Cannot stat file /proc/9878/fd/7: Permission denied
Cannot stat file /proc/9878/fd/8: Permission denied
Cannot stat file /proc/9878/fd/9: Permission denied
Cannot stat file /proc/9878/fd/10: Permission denied
Cannot stat file /proc/9878/fd/11: Permission denied
Cannot stat file /proc/9878/fd/12: Permission denied
Cannot stat file /proc/9878/fd/13: Permission denied
Cannot stat file /proc/9878/fd/14: Permission denied
Cannot stat file /proc/9878/fd/15: Permission denied
Cannot stat file /proc/9878/fd/16: Permission denied
Cannot stat file /proc/9878/fd/17: Permission denied
Cannot stat file /proc/9878/fd/18: Permission denied
Cannot stat file /proc/9878/fd/19: Permission denied
Cannot stat file /proc/9878/fd/20: Permission denied
Cannot stat file /proc/9878/fd/21: Permission denied
Cannot stat file /proc/9878/fd/22: Permission denied
Cannot stat file /proc/9878/fd/23: Permission denied
Cannot stat file /proc/9878/fd/24: Permission denied
Cannot stat file /proc/9878/fd/25: Permission denied
Cannot stat file /proc/9878/fd/26: Permission denied
Cannot stat file /proc/9878/fd/27: Permission denied
Cannot stat file /proc/9878/fd/28: Permission denied
Cannot stat file /proc/9878/fd/29: Permission denied
Cannot stat file /proc/9878/fd/30: Permission denied
Cannot stat file /proc/9878/fd/31: Permission denied
Cannot stat file /proc/9878/fd/32: Permission denied
Cannot stat file /proc/9878/fd/33: Permission denied
Cannot stat file /proc/9878/fd/34: Permission denied
Cannot stat file /proc/9878/fd/35: Permission denied
Cannot stat file /proc/9878/fd/36: Permission denied
Cannot stat file /proc/9878/fd/37: Permission denied
Cannot stat file /proc/9878/fd/38: Permission denied
Cannot stat file /proc/9878/fd/39: Permission denied
Cannot stat file /proc/9878/fd/40: Permission denied
Cannot stat file /proc/9878/fd/41: Permission denied
Cannot stat file /proc/9878/fd/42: Permission denied
Cannot stat file /proc/9878/fd/43: Permission denied
Cannot stat file /proc/9878/fd/44: Permission denied
Cannot stat file /proc/9878/fd/45: Permission denied
Cannot stat file /proc/9878/fd/46: Permission denied
Cannot stat file /proc/9878/fd/47: Permission denied
Cannot stat file /proc/9878/fd/48: Permission denied
Cannot stat file /proc/9878/fd/49: Permission denied
Cannot stat file /proc/9878/fd/50: Permission denied
Cannot stat file /proc/9878/fd/51: Permission denied
Cannot stat file /proc/9878/fd/52: Permission denied
Cannot stat file /proc/9878/fd/53: Permission denied
Cannot stat file /proc/9878/fd/54: Permission denied
Cannot stat file /proc/9878/fd/55: Permission denied
Cannot stat file /proc/9878/fd/56: Permission denied
Cannot stat file /proc/9878/fd/57: Permission denied
Cannot stat file /proc/9878/fd/58: Permission denied
Cannot stat file /proc/9878/fd/59: Permission denied
Cannot stat file /proc/9878/fd/60: Permission denied
Cannot stat file /proc/9878/fd/61: Permission denied
Cannot stat file /proc/9878/fd/62: Permission denied
Cannot stat file /proc/9878/fd/63: Permission denied
Cannot stat file /proc/9878/fd/64: Permission denied
Cannot stat file /proc/9878/fd/65: Permission denied
Cannot stat file /proc/9878/fd/66: Permission denied
Cannot stat file /proc/9878/fd/67: Permission denied
Cannot stat file /proc/9878/fd/68: Permission denied
Cannot stat file /proc/9878/fd/69: Permission denied
Cannot stat file /proc/9878/fd/70: Permission denied
Cannot stat file /proc/9878/fd/71: Permission denied
Cannot stat file /proc/9878/fd/72: Permission denied
Cannot stat file /proc/9878/fd/73: Permission denied
Cannot stat file /proc/9878/fd/74: Permission denied
Cannot stat file /proc/9878/fd/1023: Permission denied
                     USER        PID ACCESS COMMAND
/dev/snd/controlC0:  zegklitz   9607 F.... pipewire
                     zegklitz   9608 F.... pipewire-media-
/dev/snd/pcmC0D0p:   zegklitz   9607 F...m pipewire
/dev/snd/seq:        zegklitz   9607 F.... pipewire

Offline

#4 2022-02-15 13:27:31

coru
Member
Registered: 2020-01-31
Posts: 2

Re: Video playback in browser broken due to (?) pipewire-zeroconf

I got the same issue, but I dont even have zeroconf installed. Did you manage to find your issue and fix it? My outputs show similar entries, the sink-inputs however are id'd with an insanely high number (1000 and rising) I am uncertain if this is due to the bug or my usage.

Offline

#5 2022-02-15 14:02:51

zegkljan
Member
Registered: 2017-12-30
Posts: 60

Re: Video playback in browser broken due to (?) pipewire-zeroconf

coru wrote:

I got the same issue, but I dont even have zeroconf installed. Did you manage to find your issue and fix it? My outputs show similar entries, the sink-inputs however are id'd with an insanely high number (1000 and rising) I am uncertain if this is due to the bug or my usage.

I didn't.

Offline

#6 2022-04-16 09:00:13

semilogic
Member
Registered: 2012-08-31
Posts: 3

Re: Video playback in browser broken due to (?) pipewire-zeroconf

I have this issue too. Any solutions or workarounds yet?

Offline

#7 2022-04-16 09:36:22

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,655

Re: Video playback in browser broken due to (?) pipewire-zeroconf

I really don't see how this should be related. Do you have a proper hostname set?

Offline

#8 2022-07-14 19:18:33

semilogic
Member
Registered: 2012-08-31
Posts: 3

Re: Video playback in browser broken due to (?) pipewire-zeroconf

I fixed this by unsetting the PULSE_LATENCY_MSEC environment variable. I had it defined as PULSE_LATENCY_MSEC=16, but I don't recall why I set it in the first place.

Solution found here on PipeWire's GitLab issue board.

Offline

Board footer

Powered by FluxBB