kcat / openal-soft

OpenAL Soft is a software implementation of the OpenAL 3D audio API.
Other
2.23k stars 536 forks source link

AL lib: (EE) ALCplaybackAlsa_mixerProc A disconnected pipe #1057

Open Mq-b opened 2 weeks ago

Mq-b commented 2 weeks ago

In order to use SFML, it relies on OPenAL。

Installation:

apt install openal

Error:

AL lib: (EE) ALCplaybackAlsa_mixerProc: available update failed: 断开的管道
AL lib: (EE) ALCplaybackAlsa_mixerProc: mmap commit error: 断开的管道
AL lib: (EE) ALCplaybackAlsa_mixerProc: mmap commit error: 断开的管道
AL lib: (EE) ALCplaybackAlsa_mixerProc: available update failed: 断开的管道
AL lib: (EE) ALCplaybackAlsa_mixerProc: available update failed: 断开的管道
AL lib: (EE) ALCplaybackAlsa_mixerProc: mmap commit error: 断开的管道
AL lib: (EE) ALCplaybackAlsa_mixerProc: mmap commit error: 断开的管道
AL lib: (EE) ALCplaybackAlsa_mixerProc: mmap commit error: 断开的管道
AL lib: (EE) ALCplaybackAlsa_mixerProc: mmap commit error: 断开的管道
AL lib: (EE) ALCplaybackAlsa_mixerProc: available update failed: 断开的管道
AL lib: (EE) ALCplaybackAlsa_mixerProc: available update failed: 断开的管道
AL lib: (EE) ALCplaybackAlsa_mixerProc: mmap commit error: 断开的管道
AL lib: (EE) ALCplaybackAlsa_mixerProc: available update failed: 断开的管道
AL lib: (EE) ALCplaybackAlsa_mixerProc: available update failed: 断开的管道
AL lib: (EE) ALCplaybackAlsa_mixerProc: mmap commit error: 断开的管道
AL lib: (EE) ALCplaybackAlsa_mixerProc: mmap commit error: 断开的管道
AL lib: (EE) ALCplaybackAlsa_mixerProc: available update failed: 断开的管道
AL lib: (EE) ALCplaybackAlsa_mixerProc: available update failed: 断开的管道
AL lib: (EE) ALCplaybackAlsa_mixerProc: mmap commit error: 断开的管道
AL lib: (EE) ALCplaybackAlsa_mixerProc: mmap commit error: 断开的管道
AL lib: (EE) ALCplaybackAlsa_mixerProc: available update failed: 断开的管道
AL lib: (EE) ALCplaybackAlsa_mixerProc: mmap commit error: 断开的管道
AL lib: (EE) ALCplaybackAlsa_mixerProc: available update failed: 断开的管道
AL lib: (EE) ALCplaybackAlsa_mixerProc: available update failed: 断开的管道
AL lib: (EE) ALCplaybackAlsa_mixerProc: available update failed: 断开的管道
AL lib: (EE) ALCplaybackAlsa_mixerProc: available update failed: 断开的管道
AL lib: (EE) ALCplaybackAlsa_mixerProc: available update failed: 断开的管道
AL lib: (EE) ALCplaybackAlsa_mixerProc: available update failed: 断开的管道
AL lib: (EE) ALCplaybackAlsa_mixerProc: mmap commit error: 断开的管道
AL lib: (EE) ALCplaybackAlsa_mixerProc: mmap commit error: 断开的管道
AL lib: (EE) ALCplaybackAlsa_mixerProc: mmap commit error: 断开的管道
AL lib: (EE) ALCplaybackAlsa_mixerProc: available update failed: 断开的管道
AL lib: (EE) ALCplaybackAlsa_mixerProc: available update failed: 断开的管道
AL lib: (EE) ALCplaybackAlsa_mixerProc: mmap commit error: 断开的管道
AL lib: (EE) ALCplaybackAlsa_mixerProc: mmap commit error: 断开的管道
AL lib: (EE) ALCplaybackAlsa_mixerProc: mmap commit error: 断开的管道
AL lib: (EE) ALCplaybackAlsa_mixerProc: available update failed: 断开的管道
AL lib: (EE) ALCplaybackAlsa_mixerProc: available update failed: 断开的管道
AL lib: (EE) ALCplaybackAlsa_mixerProc: available update failed: 断开的管道
AL lib: (EE) ALCplaybackAlsa_mixerProc: mmap commit error: 断开的管道
AL lib: (EE) ALCplaybackAlsa_mixerProc: mmap commit error: 断开的管道
AL lib: (EE) ALCplaybackAlsa_mixerProc: mmap commit error: 断开的管道
AL lib: (EE) ALCplaybackAlsa_mixerProc: available update failed: 断开的管道
AL lib: (EE) ALCplaybackAlsa_mixerProc: available update failed: 断开的管道
AL lib: (EE) ALCplaybackAlsa_mixerProc: mmap commit error: 断开的管道
AL lib: (EE) ALCplaybackAlsa_mixerProc: mmap commit error: 断开的管道
Mq-b commented 2 weeks ago

Sometimes I do basically nothing and have similar problems with disconnected pipes.

It may not affect my program, but sometimes it seems to.

Mq-b commented 2 weeks ago

https://github.com/kcat/openal-soft/issues/739

https://github.com/kcat/openal-soft/issues/337

These two seem similar to my error, but I don't see how to fix my problem.

Mq-b commented 2 weeks ago
root@gao-virtual-machine:~# apt show libopenal1
Package: libopenal1
Version: 1:1.19.1-2build3
Priority: extra
Section: universe/libs
Source: openal-soft
Origin: Ubuntu
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Original-Maintainer: Debian Games Team <pkg-games-devel@lists.alioth.debian.org>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 982 kB
Depends: libopenal-data (= 1:1.19.1-2build3), libc6 (>= 2.34), libsndio7.0 (>= 1.8.1)
Recommends: libasound2 (>= 1.0.16), libpulse0 (>= 0.99.1)
Suggests: libportaudio2 (>= 19+svn20101113)
Homepage: http://kcat.strangesoft.net/openal.html
Task: kubuntu-desktop, kubuntu-full, ubuntustudio-video, ubuntustudio-photography, ubuntustudio-graphics, ubuntustudio-audio, ubuntustudio-publishing, ubuntukylin-desktop, ubuntu-mate-desktop, ubuntu-budgie-desktop, ubuntu-budgie-desktop-raspi
Download-Size: 535 kB
APT-Manual-Installed: no
APT-Sources: https://mirrors.ustc.edu.cn/ubuntu jammy/universe amd64 Packages
Description: Software implementation of the OpenAL audio API (shared library)
 OpenAL, the Open Audio Library, is a joint effort to create an open,
 vendor-neutral, cross-platform API for interactive, primarily spatialized
 audio. OpenAL's primary audience are application developers and desktop
 users that rely on portable standards like OpenGL, for games and other
 multimedia applications.
 .
 This library is meant as a compatible update/replacement to the OpenAL Sample
 Implementation (the SI). The SI has been unmaintained for quite a while, and
 would require a lot of work to clean up. This is a fork the old Windows version
 to attempt an accelerated ALSA version of an OpenAL implementation.
 .
 OpenAL Soft supports mono, stereo, 4-channel, 5.1, 6.1, and 7.1 output, as
 opposed to the SI's 4-channel max (though it did have some provisions for 6
 channel, this was not 5.1, and was seemingly a "late" addition). OpenAL Soft
 does not support the Vorbis and MP3 extensions, however those were considered
 deprecated even in the SI. It does, though, support some of the newer
 extensions like AL_EXT_FLOAT32 and AL_EXT_MCFORMATS for multi-channel and
 floating-point formats, as well as ALC_EXT_EFX for environmental audio effects,
 and others.
 .
 This package installs the OpenAL Soft shared library.
kcat commented 2 weeks ago

1.19.1 is an old version, released 6 years ago. If possible, try to update to the latest, or at least a newer, version. Otherwise, what's the system like? Does it use PipeWire or PulseAudio? What's the audio hardware?

You can try disabling mmap mode with ALSA by creating/editing ~/.config/alsoft.conf and adding:

[alsa]
mmap = false
Mq-b commented 2 weeks ago

Ok, I'll try both options.

  1. Update the version.
  2. Edit the configuration file.

Is there an easy way to update openal? I am Ubuntu22.04 system, using apt package manager downloaded the version is like this.

kcat commented 2 weeks ago

If you can't update to a newer Ubuntu, you'd have to try building a newer OpenAL Soft from source. You may still need to stay with an older version like 1.20, 1.21, or 1.22, if you can't use a newer compiler either. If you do that, make sure also to install the development packages for libasound2, libpulse, etc.

Mq-b commented 2 weeks ago

ok.

Mq-b commented 2 weeks ago
[100%] Linking CXX executable allafplay
[100%] Built target allafplay
root@Mq-B:/test/openal/openal-soft/build# ls
aldebug    CMakeCache.txt       CTestTestfile.cmake   libopenal.so         OpenALConfig.cmake   utils
allafplay  CMakeFiles           default_hrtf.txt      libopenal.so.1       openal-info          version.h
alrecord   cmake_install.cmake  libalsoft.common.a    libopenal.so.1.23.1  openal.pc            version_witness.txt
altonegen  config.h             libalsoft.excommon.a  Makefile             OpenALTargets.cmake

Can I just remove the lower version of openal from /usr/lib/x86_64-linux-gnu and put libopenal.so, which I just compiled?

kcat commented 2 weeks ago

You should be able to install OpenAL Soft after building it, which will copy it into /usr/local/lib, where it will take precedence over the one in /usr/lib.

Mq-b commented 2 weeks ago

Hello, I updated openal version to 1.23, there is no error before, but there is a new problem. This is indirect, not necessarily triggered, my program will broadcast initialization completion every time it starts, and sometimes it will fail to play sound with this error:

root@relia-Default-string:/opt/ReleaseReliaCLIA# ./ReliaCLIA.AppImage 
ALSA lib pcm_direct.c:595:(snd_pcm_direct_slave_recover) recover: unable to prepare slave
ALSA lib pcm_direct.c:595:(snd_pcm_direct_slave_recover) recover: unable to prepare slave
ALSA lib pcm_direct.c:595:(snd_pcm_direct_slave_recover) recover: unable to prepare slave
ALSA lib pcm_direct.c:595:(snd_pcm_direct_slave_recover) recover: unable to prepare slave
[ALSOFT] (EE) Invalid state detected: 断开的管道
Mq-b commented 2 weeks ago
[ALSOFT] (EE) mmap commit error: disconnected pipe
kcat commented 1 week ago

Something is going on with ALSA and your device that it keeps disconnecting playback.

What's your hardware? Are you sure the system's not using PulseAudio or PipeWire? It's not normal these days for apps to use ALSA directly if they have other options, as OpenAL Soft does.

Mq-b commented 1 week ago

Ubuntu i5-8300H

Mq-b commented 1 week ago

I don't know, I just played the Music using the sfml::Music type of sfml.