Skip to content
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

[Bug]: main/predict: the Termux-aware codepath is deactivated at compile-time if Termux's alsa-lib package is installed #22048

Open
robertkirkman opened this issue Oct 31, 2024 · 0 comments · May be fixed by #22049
Labels
bug report Something is not working properly

Comments

@robertkirkman
Copy link
Contributor

Problem description

I was going to put this in #21835 , alongside all the other changes for packages that fail to build if you use scripts/run-docker.sh ./build-package.sh xxx yyy in some combination, but the PR is getting too big and might be causing an intermittent CI error because of having too many packages changed in it, so I need to start separating every change out into its own PR, and later I will try to break up the other things in that PR into smaller pieces.

If predict's source code detects the presence of the alsa-lib package in the prefix, it activates a "generic Linux" block and deactivates a Termux-aware block written by the upstream developer.

Since the upstream code's "generic Linux" block contains snd_pcm_open() which is noted in a comment in the Termux alsa-lib package as non-functional on Android, I am pretty sure the correct change is this, to force ignoring alsa-lib and keep the play-audio codepath written by the upstream developer activated. It does seem odd to me that the "predict-2.3.1-termux.tar.gz" archive released by the upstream developer would contain a vestigial generic Linux codepath, though, so if there were an official issue tracker for the upstream project, I would report it there so there could be a chance of this patch I made no longer being required eventually. I haven't been able to find one.

What steps will reproduce the bug?

scripts/run-docker.sh ./build-package.sh alsa-lib predict

ld.lld: error: undefined symbol: snd_pcm_open

What is the expected behavior?

Termux-aware application predict should always force its intended play-audio-based codepath and ignore the alsa-lib package at least until the alsa-lib package gets its snd_pcm_open() backend patched into something else, since the alsa-lib package in Termux appears to be a stub for building software that doesn't actually call snd_pcm_open() since it says that snd_pcm_open() doesn't usually work on Android.

# pcm interface uses sysv semaphore which is broken on Android 14+ (issue #20514)
# Nonetheless, it is still enabled because:
# 1. probably never called because Android has no /dev/snd/pcm* device
# 2. still required for other packages in compile time, e.g. pipewire-alsa

System information

N/A
@robertkirkman robertkirkman added bug report Something is not working properly untriaged labels Oct 31, 2024
robertkirkman added a commit to robertkirkman/termux-packages that referenced this issue Oct 31, 2024
@licy183 licy183 removed the untriaged label Oct 31, 2024
robertkirkman added a commit to robertkirkman/termux-packages that referenced this issue Oct 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Something is not working properly
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants