UltraStar-Deluxe / USDX

The free and open source karaoke singing game UltraStar Deluxe, inspired by Sony SingStarâ„¢
https://usdx.eu
GNU General Public License v2.0
832 stars 160 forks source link

Sound choppy (crackling) #211

Closed lotan closed 7 years ago

lotan commented 7 years ago

I've installed USDX on two laptops (both Arch Linux) using the following PKGBUILD https://aur.archlinux.org/packages/ultrastardx-git/. On both laptops the sound is choppy. I do get error messages regarding ALSA and Jack probing, but as far as I'm aware, that is normal for Portaudio. I tested other applications using Portaudio (e.g. Audacious) on those laptops and they all run flawlessly.

Other tests: I disabled Pulseaudio and tried running USDX directly on ALSA -> no difference, still sound is choppy.

bohning commented 7 years ago

I believe I have the same issue on my Mac. This also refers to the background music in the game, correct?

basisbit commented 7 years ago

please test diffrent versions of ultrastar deluxe and see which change introduced this problem for you.

lotan commented 7 years ago

@bohning: That is correct. Interesting that it also happens on the Mac. That renders all further tests into sound card configuration almost useless.

@basisbit: I'd thought about running earlier versions. I looked at the release history and found only one other release since the major rework. I didn't think it made sense to try that one out. A version before the rework has been running on my desktop for a long time without any sound problems.

basisbit commented 7 years ago

I'd guess that either things broke for you when switching from sdl 1.2 to sdl 2 because that also introduced changes in the threading,..., or the issue is caused by an api change in one of the used libraries. Thus, please test with older source code from this repository and maybe also the last trunk version from the old repository.

dr-waterstorm commented 7 years ago

I can confirm this issue on Arch and Ubuntu (16.04). I also first thought this is related to the switch from SDL 1.2 to 2.0 (I also tried switching the SDL to ALSA which did work in USDX 1.1 but not in 1.3). I tested a lot and "wasted" half of my Saturday trying to fix it (Sinks, PA, ALSA, SampleRates, SDL, etc.).

Surprisingly when I compiled the last "officially declared beta" from here: https://github.com/UltraStar-Deluxe/USDX/releases (2. Dec) everything works quite well. So this seems to be a rather "new" issue.

I hope this gets sorted out. If I can be of any help, just let me know.

bohning commented 7 years ago

Yes, this must be a rather new issue. The Mac version (DMG) I compiled and uploaded on 2016-12-05 works just fine (stilll have that DMG/APP and currently use that, compiling the current master leads to choppy sound in the game. First I thought it was due to the update to macOS Sierra and didn't have time to look into it, so I didn't bother reporting it here. If anybody can help me with Github Desktop and how to go back to certain commits in time, then I'd be happy to test compile older versions to see where the problem first occurs.

lotan commented 7 years ago

@dr-waterstorm: Thanks very much for the pointer. The last release worked for me as well.

I tried to narrow it down a bit (manual git bisect :)): d2b3b2e0a78b0e8d93d183bf09d71e58ea58dfcc is the last one that works, the next few don't compile 7171b42d085069584809edbfa819c0b5252221dc is the first one that compiles again and has the sound coppiness issue

in particular 8f124684198e2a99e69cfc1075890902ddc67521 "audiobuffer requires size of int, not of byte." sounds like a potential candidate to influence sound, however, looking into it, the changes seem reasonable, except it fails here with:

/tmp/yaourt-tmp-xxx/aur-ultrastardx-git/src/USDX/src/media/UAudioPlayback_SoftMixer.pas(183,16) Error: There is no method in an ancestor class to be overridden: "ReadData(PByteArray;LongInt):LongInt;"
/tmp/yaourt-tmp-xxx/aur-ultrastardx-git/src/USDX/src/media/UAudioPlayback_SoftMixer.pas(194,1) Fatal: There were 1 errors compiling module, stopping

Maybe its fix is a problematic candidate?

ePirat commented 7 years ago

Commit 41d282e should have fixed this, so it probably can be closed.

nathancatlow commented 7 years ago

I can confirm this has fixed the problem on arch linux git package (https://aur.archlinux.org/packages/ultrastardx-git/), thank you!

katosh commented 7 years ago

It also fixed the issue for macOS 10.12.2.

lotan commented 7 years ago

It's fixed for me, too. Thank you!

basisbit commented 7 years ago

this issue log shows why free/libre open source software development is so amazing!

about-design commented 7 years ago

I know it is closed, but i have a problem with a firewire Interface on macOS 10.12.2 and 10.11. With an usb-interface there is no problem. With a sample rate at 96 kHz it works correctly. 44.1 or 48 kHz didn't work.

basisbit commented 7 years ago

please create a new issue for that.