AIMP Forum
AIMP for PC => Ошибки и замечания / Bugs => Topic started by: Elar on August 06, 2026, 21:57:36
-
SUMMARY
On the native Linux build of AIMP 6.0 Beta, opening the Preferences window causes the application to freeze indefinitely (low but constant CPU usage, ~2-4%) while spamming the following error in the console, forever, without ever completing or timing out:
Expression 'ret' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 1736
Expression 'AlsaOpen( hostApi, parameters, streamDir, &pcm )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 1768
Root cause identified: the freeze is directly tied to the audio output device being set to DeviceName=PortAudio: default in aimp.ini. This value also caused complete silence during playback (no sound through speakers or headphones), despite PipeWire/ALSA working correctly outside AIMP (confirmed with speaker-test and paplay).
Fix that resolved both issues simultaneously: manually editing aimp.ini and changing:
[AIMPSoundOut]
DeviceName=PortAudio: default
to:
[AIMPSoundOut]
DeviceName=PortAudio: pulse
After this change, both problems disappeared:
- Audio playback works correctly through speakers/headphones.
- The Preferences window opens normally without freezing.
This suggests that when DeviceName is set to default, AIMP/PortAudio's ALSA host API attempts to enumerate and probe every raw ALSA hardware endpoint on the system (not just the ones actually usable), gets stuck retrying a device that is permanently held exclusively by PipeWire, and never falls back or times out — hanging the whole Preferences dialog. When the device is explicitly pulse, this raw enumeration/probing step appears to be skipped or handled correctly.
System info
- AIMP version: v6.00.3070 Beta 4 (build 3079 per aimp.ini VersionBuild=3079)
- Distro: Tuxedo OS (Same as Ubuntu) (KDE Plasma desktop)
- KWin version: 6.6.5, Qt 6.10.2
- Session type: Wayland (also tested under XWayland via GDK_BACKEND=x11, freeze persisted regardless of X11/Wayland)
- GPU: Intel (Mesa Intel(R) Graphics, LNL / Lunar Lake), Mesa 26.1.4
- Sound stack: PipeWire + WirePlumber (also tested with PipeWire fully stopped — freeze persisted, ruling out simple exclusive-lock contention as the sole cause)
- Audio card: sof-soundwire (Intel SOF firmware), exposing multiple ALSA subdevices:
- hw:CARD=sofsoundwire,DEV=0 — real laptop speakers (confirmed working via speaker-test)
- hw:CARD=sofsoundwire,DEV=2 — held exclusively by PipeWire (fuser /dev/snd/* shows pipewire on pcmC0D2p), returns -16 Device or resource busy when probed directly
- hw:CARD=sofsoundwire,DEV=5,6,7 — open without error but are internal DSP/loopback paths with no audible output ("Unknown" channel labels)
- hw:CARD=sofsoundwire,DEV=31 — opens without error, labeled Front L/R, but produces no audible sound (likely unconnected secondary output path, e.g. HDMI passthrough)
- Skin in use: A4 (Skin=A4.acs6), custom third-party skin. There were reports of problems with background/spectrum visual effect but it was already disabled before the issue.
Steps to reproduce
1. Install AIMP 6.0 Beta native for Linux on a system using PipeWire, with an Intel SOF soundwire audio card exposing multiple ALSA subdevices (common on modern Intel laptops).
2. Leave DeviceName=PortAudio: default in aimp.ini (default/typical value).
3. Launch AIMP and try to play a track — no audio output at all, despite the underlying system audio stack working correctly.
4. Open Preferences — the window becomes fully unresponsive. Console output floods indefinitely with:
Expression 'ret' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 1736
Expression 'AlsaOpen( hostApi, parameters, streamDir, &pcm )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 1768
This repeats forever; waiting several minutes does not resolve it. CPU usage stays low (~2-4%), so it's a retry loop, not a hard deadlock.
5. Force-kill the process (killall -9 AIMP).
6. Close AIMP, manually edit aimp.ini, change DeviceName=PortAudio: default to DeviceName=PortAudio: pulse.
7. Relaunch AIMP — audio plays correctly, and Preferences opens without any freeze.
Expected behavior
- AIMP should not attempt to open/probe raw ALSA hardware subdevices that are exclusively held by the sound server (or should fail gracefully and continue to the next device instead of retrying indefinitely).
- The default PortAudio/ALSA device should either work out of the box on PipeWire systems, or AIMP should default to pulse automatically when PipeWire is detected, since default currently results in total audio silence plus this Preferences freeze.
Additional notes
- The freeze is unrelated to KDE's compositor/Wayland — it persisted identically when forcing the app through XWayland (GDK_BACKEND=x11 AIMP).
- The freeze persisted even with PipeWire fully stopped (systemctl --user stop pipewire pipewire-pulse wireplumber), which rules out simple exclusive-device contention as the only trigger — the enumeration/probe loop itself seems to be the actual bug, independent of what's holding the device.
-
Open Preferences — the window becomes fully unresponsive. Console output floods indefinitely with:
Can you provide to me console output with the AIMP's entry points too? I’m not very clear on exactly which stage the problem occurs.
-
Fix that resolved both issues simultaneously: manually editing aimp.ini and changing:
Does the "ALSA: default" works as expected? May be an issue of PortAudio?
-
I managed to reproduce the freeze again with full logging and captured a crash report.
1) Console output:
Here's the relevant excerpt from AIMP.log, from a fresh launch through to the point where the crash loop starts:
Main D/Main: LoadSettings2
Main D/ASO: Device.DeviceReinitialize
Main D/Main: InitDone
...
Main D/Main: ApplySkin(A4.acs6)
Main D/Main: WindowShow
...
Main E/Main: [EExternalException] Fatal exception at 70EA786ECBDF
--------------------------------------------------------------------------
[libc.so.6] nanosleep
[libportaudio.so.2.0.0] Pa_Sleep
[libportaudio.so.2.0.0] PaAlsa_SetRetriesBusy
[libportaudio.so.2.0.0] Pa_Sleep
[libportaudio.so.2.0.0] PaAlsa_SetNumPeriods
[libportaudio.so.2.0.0] Pa_IsFormatSupported
[AIMP] ASO.Devices.PortAudio.pas.TPortAudioDeviceFormatEnumerator.IsSupported at line 258
[AIMP] ASO.Devices.pas.TASODeviceFormatsEnumerator.TestSampleFormats at line 497
[AIMP] ASO.Devices.pas.TASODeviceFormatsEnumerator.Populate at line 413
[AIMP] ASO.Devices.pas.TASODevice.GetFormats at line 682
[AIMP] AIMPOptionFrameSoundOutUtils.pas.TASOSettingsSampleFormatComboboxHelper.Populate at line 433
[AIMP] AIMPOptionFrameSoundOutUtils.pas.TASOSettingsCustomComboboxHelper.Validate at line 227
[AIMP] AIMPOptionFrameSoundOut.pas.TAIMPOptionsFrameSoundOut.cbDeviceParamSelect at line 267
...
[AIMP] AIMPOptionFrameSoundOut.pas.TAIMPOptionsFrameSoundOut.cbDeviceSelect at line 319
...
[AIMP] AIMPOptionFrameSoundOut.pas.TAIMPOptionsFrameSoundOut.LoadConfig at line 207
[AIMP] AIMPOptionsDialogClasses.pas.TAIMPOptionsDialogCustomFrameWindow.InternalLoadCore at line 303
...
[AIMP] AIMPOptionsDialog.pas.ExecuteOptions at line 195
[AIMP] AIMPMainHelper.pas.TAIMPMainFormHelper.HostCommands at line 1017
This repeated 3 times in a row (once per ~14 seconds) while the Preferences window was open and unresponsive, before I force-killed the process.
2) ALSA: default or PortAudio:
The stack trace confirms this is specifically PortAudio's ALSA host API (PaAlsa_SetRetriesBusy / PaAlsa_SetNumPeriods / Pa_IsFormatSupported) getting stuck while enumerating supported sample formats/rates for the PortAudio: default device, triggered by TAIMPOptionsFrameSoundOut.cbDeviceSelect → LoadConfig when the Preferences dialog populates the Sample Format and Sample Rate dropdowns.
I don't see a separate "ALSA: default" entry distinct from PortAudio in my device list — in my build, PortAudio: default and PortAudio: pulse are the two relevant entries, and the crash only occurs with default. Switching to PortAudio: pulse (in aimp.ini, since the UI itself can't be reached while default is selected) resolves both the freeze and the total audio silence I was experiencing.
System for reference: Intel SOF/soundwire audio card, PipeWire sound server, KDE Plasma 6.6.5 on Wayland (also reproduced identically under XWayland via GDK_BACKEND=x11, and with PipeWire fully stopped — so it's not simply exclusive-device contention, the enumeration itself never completes/never fails gracefully for this device).
-
I managed to reproduce the freeze again with full logging and captured a crash report.
1) Console output:
Here's the relevant excerpt from AIMP.log, from a fresh launch through to the point where the crash loop starts:
Nevertheless, I need the full log from the player, not just the trimmed version. It will indicate the version being used, as well as the parameters with which the player attempted to query the devices.
getting stuck while enumerating
FatalException maps to SIGABRT signal that tells that something goes wrong on ALSA-backend on side of the PortAudio library. Usually, it should return an error code instead of throw the exception.
I don't see a separate "ALSA: default"
As I say upper, I need full log from the app. ALSA is default output for Linux. If the ALSA configuration is missing or damaged, this would explain why PortAudio crashes.
-
I can no longer provide logs, sorry. I had to change the operating system, with the one I use now there is no problem anymore.
-
Ок