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

Microphone recording no longer works under Linux #81950

Open
Tracked by #76797
goatchurchprime opened this issue Sep 19, 2023 · 12 comments
Open
Tracked by #76797

Microphone recording no longer works under Linux #81950

goatchurchprime opened this issue Sep 19, 2023 · 12 comments

Comments

@goatchurchprime
Copy link

Godot version

4.1.stable

System information

Godot v4.1.1.stable (bd6af8e) - NixOS 23.11 (Tapir) - Vulkan (Compatibility) - Mesa Intel(R) Graphics (ADL GT2) - 12th Gen Intel(R) Core(TM) i5-1240P (16 Threads)

Issue description

There has been a regression between v4.0 and v4.1, and the microphone has stopped working under Linux.

This was reported under an older issue at: #33184 (comment)

I have conducted a git bisect on this issue and found that the regression is between two subsequent checkins in this list from around May 10.

https://github.com/godotengine/godot/commits/master?after=c80a2b4fe99dcd0bba6fc24ed2748b1474b24448+1&branch=master&qualified_name=refs%2Fheads%2Fmaster

image

In particular, this very large commit to do with scene multithreading.
98c655e

There's nothing suspicious or microphone/audio related in that checkin that I can see, but it's hard to break it down further to find out where it went wrong.

Steps to reproduce

Test using the demo projects audio/mic_record between the two versions.
https://github.com/godotengine/godot-demo-projects/tree/master/audio/mic_record

Minimal reproduction project

N/A

@DavidGasku
Copy link

DavidGasku commented Oct 21, 2023

Same problem in Manjaro Linux.
EDIT:
PulseAudio driver in godot, using pipewire in the system.
I can see the input created in pipewire, and connected to my soundcard input. It lasts several seconds
(time seems unrelated to "audio/buses/channel_disable_time").

After that time, the input is removed, and godot gets a spike in that input (I have an AudioStreamPlayer with a Microphone stream, that scales a visualization sprite)

@Calandiel
Copy link

Same on Fedora 38

@Kirava0
Copy link

Kirava0 commented Oct 29, 2023

Same on Windows 10

@akien-mga
Copy link
Member

I can't reproduce the issue on Mageia 9 with Pulseaudio 16.1. Mic recording works fine for me in 4.1 and 4.2-beta3.

@Calandiel
Copy link

Calandiel commented Nov 3, 2023

On my machine, Discord, Steam and my own application in Rust all pick up my microphone just fine. Only Godot (latest stable) doesn't and instead records silence.

@akien-mga akien-mga modified the milestones: 4.2, 4.3 Nov 9, 2023
@seanluse41
Copy link

Confirmed here as well, Godot 4.2.1 Nixos, running pipewire.
Audio input works in system apps. Unable to record mic in godot.
printing AudioServer.input_device displays nothing as well. Meanwile, get_input_device_list() returns an array correctly.

@Calandiel
Copy link

I ran some tests again (this time on 4.2.1). Seems to still persist.

@MyriadMinds
Copy link

I'm experiencing this bug too. Godot seems to be having some issue with pulseaudio and can't read the microphone.

v4.2.1.stable.mono.official [b09f793], Pop!_OS 22.04 LTS

In the system logs i see something like this:
image
The errors start as soon as i launch a project. Interestingly enough, the error is not always present. About 1/10 launches will successfully start recording the microphone. I can actually watch the system log file and detect whether the microphone will work or not on a specific launch by looking for those errors.

@razcore-rad
Copy link
Contributor

It may be a pipewire-pulseaudio issue, I'm also having the same problem, v4.2.2.rc1.official [c7fb064]. Godot returns

E 0:00:12:0141   record_play_microphone.gd:21 @ toggle_recording(): Condition "current_instance->recording_data.size() == 0" is true. Returning: nullptr
  <C++ Source>   servers/audio/effects/audio_effect_record.cpp:207 @ get_recording()
  <Stack Trace>  record_play_microphone.gd:21 @ toggle_recording()

for me. Also don't get mic playback if I unmute the Record bus.

I also use pipewire with pulseaudio. I don't see any weird stuff in the journal, but on my end I also need to change the input in the pipewire patchbay cause it's the wrong one. Default is Yeti Stereo Microphone Analog Stereo, but the webcam is connected instead.

But even if I change the input I still get no recording.

image

@samar-01
Copy link
Contributor

I had issues with getting microphone to work on a laptop with and nvidia graphics card and proprietary drivers, unless it was run with the nvidia gpu and not the integrated graphics. However it only works in the editor and not while running the game or exporting and running that. If everyone can try doing the same it may give a better idea of what the cause is.

@Skipperro
Copy link

I had the same problem with Godot 4.2.
Just tried 4.3-beta2 and microphone input is working fine.

@bestvcboy
Copy link

godot4.3 In Android, after starting the recording and waiting for a period of time, such as 3 minutes, then stopping the recording, after multiple operations, recording becomes impossible. I have tried many times, and it seems the probability varies randomly with different devices. I can't find any pattern. Sometimes, when the recording is on, it will directly return -200 after a while.

@KoBeWi KoBeWi modified the milestones: 4.3, 4.x Aug 4, 2024
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