Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ubuntu 22.10: Project closes if there are no audio output devices #67900

Closed
Tracked by #76797
dalexeev opened this issue Oct 26, 2022 · 5 comments
Closed
Tracked by #76797

Ubuntu 22.10: Project closes if there are no audio output devices #67900

dalexeev opened this issue Oct 26, 2022 · 5 comments

Comments

@dalexeev
Copy link
Member

Godot version

v3.5.stable.official [991bb6a], v4.0.beta3.official [01ae26d]

System information

Kubuntu 22.10

Issue description

Not sure if this is a Godot or Ubuntu bug, but I'll report it here as the running project is closing. I think this is wrong behavior.

When trying to play audio, the running project closes with the following errors if there are no audio output devices (for example, headphones are not connected).

E 0:00:00.216   pa_sink_info_cb: PulseAudio: sink info error: No such entity
  <C++ Source>  drivers/pulseaudio/audio_driver_pulseaudio.cpp:77 @ pa_sink_info_cb()

E 0:00:00.216   init_device: PulseAudio: init device failed to detect number of output channels
  <C++ Source>  drivers/pulseaudio/audio_driver_pulseaudio.cpp:195 @ init_device()

Perhaps this is due to the fact that in 22.10 Ubuntu switched from PulseAudio to PipeWire.

Steps to reproduce

Try running a project with audio on Ubuntu 22.10 without audio output devices.

If any configs are required, I can provide them.

Minimal reproduction project

No response

@Calinou
Copy link
Member

Calinou commented Oct 26, 2022

Godot should definitely be able to fallback if no audio output device is present, but this needs to be checked on all platforms.

@DreamHollow
Copy link

DreamHollow commented Oct 29, 2022

It looks like this error might be related to the way the code is written in 'godot/audio_driver_pulseaudio.cpp'

There seems to be no built-in case for an actual 0 device error; I'm not sure if it's supposed to be coded that way intentionally.

void AudioDriverPulseAudio::pa_sink_info_cb(pa_context *c, const pa_sink_info *l, int eol, void *userdata) {
	AudioDriverPulseAudio *ad = static_cast<AudioDriverPulseAudio *>(userdata);

	// If eol is set to a positive number, you're at the end of the list
	if (eol > 0) {
		return;
	}

	// If eol is set to a negative number there's an error.
	if (eol < 0) {
		ERR_PRINT("PulseAudio: sink info error: " + String(pa_strerror(pa_context_errno(c))));
		ad->pa_status--;
		return;
	}

	ad->pa_map = l->channel_map;
	ad->pa_status++;
}

So the less than 0 condition is called instead, rather than a condition that would allow for a complete lack of an audio device?

@Calinou
Copy link
Member

Calinou commented Apr 27, 2023

@DreamHollow Can you test changing eol < 0 to eol == 0 locally and see if it resolves the issue?

@dalexeev
Copy link
Member Author

dalexeev commented Feb 3, 2024

This is no longer reproducible on my configuration. Let's close this if nobody can confirm it.

@Calinou
Copy link
Member

Calinou commented Feb 3, 2024

Closing per the above comment. For future readers, please comment if you can still reproduce this on the latest Godot version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants