-
Notifications
You must be signed in to change notification settings - Fork 60
Switch to PortAudio #76
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
Conversation
You should explain the motivation and benefit for the migration of PortAudio. |
6d42303
to
6e00d27
Compare
Build failure:
|
Thanks for the reminder! |
f26f174
to
e331ed7
Compare
e331ed7
to
e7184f0
Compare
e7184f0
to
a73d91d
Compare
c270822
to
856807d
Compare
To make sure whether the hrtimer resolve the stuttering and sending invalid stream ID issues. |
Hi @jserv , I would like to summarize the current progress:
|
5d0f852
to
d6b9ac6
Compare
d6b9ac6
to
7dd3664
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rebase the latest master
branch.
7dd3664
to
99e44c7
Compare
99e44c7
to
1e978fd
Compare
Switch to PortAudio for cross-platform and cross backend compatibility. Linux v6.7 propose a solution to resolve sound stutter effect. Therefore, upgrade the kernel version as well. It is confirmed that there exists unknown issues in Linux Kernel that user has to adjust the buffer size to more than four times of period size, or the program cannot write PCM frames into guest ALSA stack.
1e978fd
to
d26f0dd
Compare
Fixes a compilation error introduced in sysprog21#76, where the `make all` target fails during the build of the PortAudio library on GNU/Linux systems. The failure was caused by a missing `-lsndio` linker flag. Adding this flag resolves the issue and allows the build to complete successfully.
Fixes a compilation error introduced in sysprog21#76, where the `make all` target fails during the build of the PortAudio library on GNU/Linux systems. The failure was caused by a missing `-lsndio` linker flag. Adding this flag resolves the issue and allows the build to complete successfully.
Fixes a compilation error introduced in sysprog21#76, where the `make all` target fails during the build of the PortAudio library on GNU/Linux systems. The failure was caused by PortAudio's configure script automatically enabling the sndio backend when `libsndio-dev` headers are present, which leads to linker errors due to missing `-lsndio`. To avoid this, we now explicitly pass `--without-sndio` to PortAudio’s configure script. This ensures that sndio support is disabled regardless of system headers, eliminating the need for `-lsndio` and fixing the build.
Quote from portaudio/config.log: ... configure:3194: checking whether the C compiler works configure:3216: gcc -I/opt/homebrew/opt/zlib/include portaudio/lib/.libs/libportaudio.a -framework CoreServices -framework CoreFoundation -framework AudioUnit -framewo rk AudioToolbox -framework CoreAudio -lpthread -lm mini-gdbstub/build/libgdbstub.a conftest.c >&5 clang: error: no such file or directory: 'portaudio/lib/.libs/libportaudio.a' ... configure:3265: error: C compiler cannot create executables ... The ./configure script fails on macOS because LDFLAGS includes static libraries (libportaudio.a) that have not yet been built. This causes the compiler check to fail with "C compiler cannot create executables". This patch unsets LDFLAGS during the configure step to allow the test program to compile and link successfully, enabling builds on macOS. Related: sysprog21#76
Quote from portaudio/config.log: ... configure:3194: checking whether the C compiler works configure:3216: gcc -I/opt/homebrew/opt/zlib/include portaudio/lib/.libs/libportaudio.a -framework CoreServices -framework CoreFoundation -framework AudioUnit -framewo rk AudioToolbox -framework CoreAudio -lpthread -lm mini-gdbstub/build/libgdbstub.a conftest.c >&5 clang: error: no such file or directory: 'portaudio/lib/.libs/libportaudio.a' ... configure:3265: error: C compiler cannot create executables ... The ./configure script fails on macOS because LDFLAGS includes static libraries (libportaudio.a) that have not yet been built. This causes the compiler check to fail with "C compiler cannot create executables". This patch unsets LDFLAGS during the configure step to allow the test program to compile and link successfully, enabling builds on macOS. Related: sysprog21#76
Switch to PortAudio for cross-platform and cross backend compatibility.
Testing
Preparation
make build-image
to build Linux Kernel image and root filesystem.Test Cases
play white noise
test procedures
speaker-test
in emulator shell.expected results
play sequence sound
test procedures
aplay /usr/share/sounds/alsa/Front_Center.wav
in emulator.aplay /usr/share/sounds/alsa/Front_Center.wav
in emulator.expected results
Summary by Bito
This pull request integrates PortAudio to enhance cross-platform audio playback, replacing the previous CNFA submodule. It updates the Makefile for better build configurations, addresses issues like sound loss and system crashes, and improves PCM stream handling and compatibility, while also updating documentation.Unit tests added: False
Estimated effort to review (1-5, lower is better): 2