Closed wtftf closed 4 months ago
Exactly the same problem for me.
same problem for me with version 2.2.3, running on wayland though
I'm having the same problem with version 2.2.4 on Gnome 45 (Wayland). I'd be happy to provide more information since I'd love to use Kooha to record my lectures. Unfortunately, in its current state, it simply doesn't work for that since the audio is practically lost.
Same problem, version 2.2.4, Archlinux, Gnome 45 (Wayland)
Recording in MP4 format (H.264 + MP3 48 kHz), with an Intel Kabylake chipset on the Wayland version of GNOME 45 with Kooha 2.2.4 from Flathub, my observation in my case is that this happens to audio recorded from the microphone rather than the audio recorded from the playback (monitor) audio device... or at least, it happens much faster with the microphone.
For example, I was able make an 11-minutes-long "monitor audio only" recording and it was flawless, but when recording a video with microphone-only audio, the sound started stuttering at ~4 minutes 23 secs, within the next 5 seconds it started disintegrating significantly, at 4 mins 50 seconds it became near unusable, and beyond 5 mins 20 seconds it was pretty much unrecognizeable/unintelligible.
I tried again another recording "from the microphone" while writing this comment, and it failed in the exact same way, around the 4 minutes 13-23 seconds mark the sound started stuttering and getting progressively worse in the minute that followed.
The audio, while garbled, apparently remained in sync with the visuals (which remained smooth), however.
I have some new findings for you today. By total happenstance, I discovered that not only Kooha, but also @ryonakano's "Reco" app is affected with the same symptoms on the same computer: after the 5 minutes mark, my microphone's recorded sound stream in the app starts becoming increasingly/exponentially saccated and garbled.
The differences are:
Since it affects two different applications, this is starting to sound like a PipeWire (or PulseAudio / ALSA / GStreamer?) bug to me.
On this computer, I am using a "Logitech USB Desktop Microphone" (that's what the product is named), which is identified as such under Linux with lsusb
:
Bus 003 Device 053: ID 0556:0001 Asahi Kasei Microsystems Co., Ltd AK5370 I/F A/D Converter
I don't know/remember what sampling rate etc. this thing uses, it's probably either 44.1 or 48 kHz... I don't know if this might be a factor vs the motherboard or my ThinkPad's USB-C docking station that serves as the sound output through speakers.
Let me know if there is any additional information I should gather here to make it easier for you to narrow down which software component might be causing the issue.
In case the developers never encountered this issue themselves and don't know what it "sounds" like, here is a test sample recording with Kooha in microphone-only mode (you'd get a similar result with Reco when recording in "Both" microphone+system mode):
https://github.com/SeaDve/Kooha/assets/479401/11c62e7b-de9f-44a6-b931-604d5d612484
Play that video, turn on the volume (it is muted by default) and seek to the 3mins 40s mark, listen to the music and within 10-20 seconds the stuttering will start becoming noticeable; afterwards it will fall apart very rapidly within the minute that follows.
developers never encountered this issue themselves
I did encounter it, and it was reproducible most of the time.
@nekohayo Thanks for the very detailed report, I have actually attempted to debug and determine the root cause of the issue and failed a lot of times before. But now, I think I have found it. It seems to be caused by audiomixer
dropping buffers once they become late. This is proven by setting qos-messages=true
on audiomixer
's sink pads and listening for QoS messages on the bus. The QoS messages from the audiomixer
will start to appear with the stuttering.
A quick fix is setting the audiomixer
's latency
property to some value, other than 0. I was able to record audio for longer than an hour with the audio never cut, which would have been cut earlier than ~10 minutes with latency=0
. But ideally, I think that the latency should be adjusted depending on the audio sources.
By matching the actual-latency-time
of the src
with the latency
of the audiomixer
, it seems to be fixed. I again attempted to record 2 hours, and there are zero stutters.
If anyone have the time, please test https://github.com/SeaDve/Kooha/pull/279.
I have checked out git main
, built it with GNOME Builder, confirmed the bug still happened there (within 5 minutes of recording), then checked out your fix-stutter-audio
branch, built it, and can confirm that the issue does not occur there even after 10 minutes of recording with the same methodology. Great job!
Hopefully others can confirm, but I am pretty confident that this is going to solve everybody's problems. Given how impactful it can be on the recorded results, I believe this could warrant a release on its own, it's that big of a difference in usability for users with (external?) microphones :)
That's nice to here, thanks!
I believe this could warrant a release on its own, it's that big of a difference in usability for users with (external?) microphones :)
As much as I like to do a release, I would like to wait for org.gnome.Platform//46
release.
But if someone have the time to submit patch on https://github.com/flathub/io.github.seadve.Kooha, I would accept it.
Submitted a patch https://github.com/flathub/io.github.seadve.Kooha/pull/12
I have published a patch on Flathub that should be available on flatpak update
any time now.
Except that's exactly the problem I'm now experiencing (on two consecutive failed attempts) recording video & audio of about 1:10:00 in total length. Audio starts disintegrating by 10:00 and cuts out completely at about 13:30.
io.github.seadve.Kooha 2.2.3
Flatpak: true
Experimental: false
Distribution: GNOME 43 (Flatpak runtime)
Desktop Session: pop
Display Server: x11
GTK 4.8.3
Libadwaita 1.2.1
GStreamer 1.20.5
Pipewire 0.3.59