Skip to content

Segmentation fault when getting peak level #35

@MedicMomcilo

Description

@MedicMomcilo

I'm writing a small tool to do some very basic normalizing of the sound.
Python script works just fine for a while and then it segfaults.

I've managed to create minimalistic example where segfault happens consistently.
Time before crashing varies, it is sometimes 10-15 seconds, and sometimes a couple of minutes.

Details about my system (Fedora 30):

$ rpm -q pulseaudio
pulseaudio-12.2-9.fc30.x86_64
$ rpm -q python3-pulsectl
python3-pulsectl-19.9.5-1.fc30.noarch
$ rpm -q kernel
kernel-5.2.17-200.fc30.x86_64

Script to reproduce the issue:

#!/usr/bin/python3

import time
import pulsectl

def find_vlc():
	while 1:
		sinks = pulse.sink_input_list()
		for sink in sinks:
			if sink.proplist["application.process.binary"] == "vlc":
				return sink
		print("No VLC found, waiting.")
		time.sleep(5)

pulse = pulsectl.Pulse('segfa')

while 1:
	pa_vlc = find_vlc()
	peak = pulse.get_peak_sample(pulse.sink_info(pa_vlc.sink).monitor_source, 0.2, pa_vlc.index)
	print(round(peak, 3))

Note that finding VLC can be removed from the loop, and it still segfaults.

Please let me know if there is anything else I can provide to further help with resolving.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions