-
-
Notifications
You must be signed in to change notification settings - Fork 21.6k
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 doesn't work on Linux with official builds #33184
Comments
Works for me on Mageia 7 using PulseAudio. |
Confirmed Linux Mint 19.2 Cinnamon, x64 Kernel 5.0.0-31-generic, Lenovo Laptop. |
Confirmed on Ubuntu 18.04.3 on a Lenovo Thinkpad T420. |
Confirmed on up-to-date NixOS unstable with KDE, PulseAudio. |
Can this get added to 3.2 milestone, and how can we help troubleshoot the problem? |
@FeralBytes Which Godot versions can you reproduce this on? Microphone support was added in 3.1. Here, I can still reproduce this on a10449b, which means it wasn't fixed by #34306. |
I can reproduce this with 3.1.2 |
@Calinou 3.2 beta 4 is broken, also 3.1.1 is broken Also 3.1 Stable does not work. A what stage of 3.1 was it added at Alpha? Ah 3.1 Alpha1 works. I then tested Beta 1 and it was broken. I then worked backwards and found that even 3.1. Alpha2 was broken. So a change between 3.1 Alpha1 and 3.1Alpha2 broke mic recording for many versions of Linux. EDIT: Tested in both Linux Mint 19.2 and 19.3, same result. |
@FeralBytes the change might be in the fa26a55. After reverting that in Master the recording started working for me. The changes look pretty innocent and I cannot tell just by looking what is the problem. Any thoughts @marcelofg55. Edit: Adding this line seems to be enough fix it for me. Race condition / synchronization problem perhaps?
|
I could finally reproduce this too, it seems like official builds don't work but local builds do. Likely an issue with the different PulseAudio versions used on the official buildsystem and on user systems. |
I confirm that reverting fa26a55 "fixes" the issue, i.e. the audio recording works again, but it's cracking and of bad quality (contrarily to the current state in the master branch if you build against a recent PulseAudio, where it works and sounds good). The official buildsystem uses Ubuntu 14.04 with |
@akien-mga Would loading the PulseAudio library via |
No, it's properly linked and found already. |
I can confirm @Zolzak's finding about the |
This fix is not a real fix. I wish I could properly fix the bug, but it eludes me. See godotengine#33184
This fix is not a real fix. I wish I could properly fix the bug, but it eludes me. See godotengine#33184
At least, it's kind of recording something... However, I'm still stuck due to this bug : godotengine/godot#33184 So, I'll have to test this back under Windows... Signed-off-by: Miouyouyou (Myy) <[email protected]>
This was confirmed to also occur on Windows and macOS in godotengine/godot-demo-projects#572. |
Please open a separate issue to track the root cause on macOS, as it's likely different compared to Linux. |
i get no audio from anything recorded on windows. |
@idg32 this is a Linux specific issue, please open another one for Windows |
In https://github.com/V-Sekai/godot-speech we added code from libsamplerate to resample audio arbitrarily to 48000hz. @enorrmann has a sample conversion problem and this relates to that. |
Not sure if this is the right place for that, but I have the same problem on FreeBSD Playback works fine, recording just yields a completely silent audio stream, no errors. |
Over 3 years later and this is still happening on Godot 4.01 stable. Recorded audio is silent every time. The length of the recording is accurate but the data is all 0s. You can clearly hear yourself with the Record bus unmuted, so imo the issue lies somewhere within the set_recording_active() and/or get_recording() functions. I tried to figure it out but I am not equipped enough to figure it out. Please help anyone :'( |
This issue is still present, for me as well. I can hear the feedback through the "Record" bus when unmuted, but the audio is being recorded. On Arch Linux, kernel 6.2.9-zen1-1-zen |
I was looking closely at the code and I'm no expert at C++ or threaded stuff. When Also Maybe I can try to clone the repo and test to see if there is any issues there. |
I'm not getting any results so far except that PulseAudio sometimes exit badly when I stop hitting record. There is also sometimes where audio crackles though closing and opening the game fixes it. (aka when i keep the audio bus unmuted) Note I'm using the Is AudioEffectRecord really the right thing to use here? The documentation says to use AudioEffectCapture to capture the voice and mentions nothing about AudioEffectRecord. Looking it up more, it seems like AudioEffectRecord is meant only for recording your voice to a file and AudioEffectCapture is used for processing your voice in real time. #52441 Does AudioEffectCapture work here? I haven't seen anyone mention it yet so I guess I will test it out. |
I had this issue with earlier betas on arch Linux, but since the release it works perfectly for me. Not sure if that means it's an issue with how it works or not, maybe some sort of driver difference? Idk |
What were your findings, @Nukiloco ? @andersmmg: What did you use to record? AudioEffectRecord? Or AudioEffectCapture, like the docs say? |
It works for me using the official audio record demo, which looks like it's using AudioEffectRecord |
I haven't tested it out yet since I been busy doing other things currently. |
For me it works in linux (nixos) for v4.0.2 and 4.0.3 but then it's back to total silence on v4.1.1 when using the Audio Mic Record Demo. v4.2.dev.4 is also silent. The same results (for working and not working) occur when setting $AudioStreamPlayer.stream = AudioStreamMicrophone. |
Using git bisect between (working) 4.0.3-stable and (not working) 4.1.1-stable and the power of the following Nix expression
I have determined that the breaking change was at: Unfortunately this commit doesn't look suspicious at all. Further investigation is necessary. For the record, the bisect log is:
|
I have definitely confirmed that this is the breaking commit, from two subsequent checkins in this list from around May 10 It's a very large commit, none of which appears to relate the the audio system, so I have no idea what's happened. |
That's a different issue from this one which was reported in 2019 then, and seemed specific to build environments / runtime environments. Could you open a new issue about the 4.1 regression with those details? |
More testing, i was reading through the source code and wanted to get more details. I run the test project in verbose mode, and all of the sudden, it starts to work. For some unknown reason, verbose mode, fixes the issue? All I can assume here and what I'm guessing, is that the verbose printing is delaying something long enough for it to work? EDIT: Oh wait, that's what everyone above has said as well, didn't check that part, whoops. |
This is almost certainly fixed by #102069 It has all the hallmarks of being due to an uninitialized variable parameter which makes it work or fail intermittently depending on the build. |
Closing per @goatchurchprime's comment. Thanks for the thorough investigation 🙂 If you can still reproduce this on 4.4.beta2 or newer, please comment. |
Godot version: Git 924db5f
OS/device including version: Fedora 30, PulseAudio
Issue description: Microphone recording doesn't seem to work on Linux, even though Godot appears as a capture device when running the Mic Record Demo:
Saving the file after recording a few seconds will write a WAV file that contains only a few seconds of silence. I made sure the microphone is not muted by recording a sample in Audacity beforehand (where it works correctly).
Steps to reproduce: Use the "Mic Record Demo" from godot-demo-projects. Click the Record button, say something, then press Stop. Save the audio to a WAV file then inspect it using a media player.
See also godotengine/godot-demo-projects#359. This issue has been confirmed by @CombustibleLemonade in godotengine/godot-demo-projects#359 (comment), so I'll add the
confirmed
label right away.Edit: This issue is not exclusive to Linux and has been occurring on Windows and macOS too (both x86 and ARM).
The text was updated successfully, but these errors were encountered: