Skip to content

Commit

Permalink
pulseaudio: disable memfd
Browse files Browse the repository at this point in the history
  • Loading branch information
licy183 committed Oct 5, 2024
1 parent 35712e7 commit 0ae3a72
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 53 deletions.
15 changes: 15 additions & 0 deletions packages/pulseaudio/arm_neon.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
https://cgit.freebsd.org/ports/diff/audio/pulseaudio/files/patch-src_pulsecore_mix__neon.c?id=3dd02a0fe712c2b67ab0e15444d9fbb4f00b3817

--- a/src/pulsecore/mix_neon.c
+++ b/src/pulsecore/mix_neon.c
@@ -176,8 +176,8 @@ static void pa_mix2_ch4_s16ne_neon(pa_mix_info streams
int32x4_t sv0, sv1;

__asm__ __volatile__ (
- "vld1.s32 %h[sv0], [%[lin0]] \n\t"
- "vld1.s32 %h[sv1], [%[lin1]] \n\t"
+ "vld1.s32 {%e[sv0],%f[sv0]}, [%[lin0]] \n\t"
+ "vld1.s32 {%e[sv1],%f[sv1]}, [%[lin1]] \n\t"
: [sv0] "=w" (sv0), [sv1] "=w" (sv1)
: [lin0] "r" (streams[0].linear), [lin1] "r" (streams[1].linear)
: /* clobber list */
3 changes: 2 additions & 1 deletion packages/pulseaudio/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ TERMUX_PKG_LICENSE="GPL-2.0"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_SRCURL=git+https://github.com/pulseaudio/pulseaudio
TERMUX_PKG_VERSION="17.0"
TERMUX_PKG_REVISION=1
TERMUX_PKG_REVISION=2
TERMUX_PKG_DEPENDS="dbus, libandroid-execinfo, libandroid-glob, libc++, libltdl, libsndfile, libsoxr, libwebrtc-audio-processing, speexdsp"
TERMUX_PKG_BREAKS="libpulseaudio-dev, libpulseaudio"
TERMUX_PKG_REPLACES="libpulseaudio-dev, libpulseaudio"
Expand All @@ -16,6 +16,7 @@ TERMUX_PKG_EXTRA_CONFIGURE_ARGS="-D alsa=disabled
-D openssl=disabled
-D gsettings=disabled
-D doxygen=false
-D tests=false
-D database=simple"
TERMUX_PKG_CONFFILES="etc/pulse/client.conf etc/pulse/daemon.conf etc/pulse/default.pa etc/pulse/system.pa"

Expand Down
73 changes: 21 additions & 52 deletions packages/pulseaudio/meson.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
diff --git a/meson.build b/meson.build
index c5135330f..0f0c3d5ed 100644
--- a/meson.build
+++ b/meson.build
@@ -279,10 +279,6 @@ if host_machine.system() != 'windows'
@@ -286,10 +286,6 @@
endif
endif

Expand All @@ -13,7 +11,25 @@ index c5135330f..0f0c3d5ed 100644
# Headers which are usable

check_usable_headers = [
@@ -374,7 +370,7 @@ if cc.has_function('dgettext')
@@ -322,7 +318,6 @@
'getuid',
'lrintf',
'lstat',
- 'memfd_create',
'mkfifo',
'mlock',
'nanosleep',
@@ -369,8 +364,7 @@
endif
endforeach

-if cc.has_header_symbol('sys/syscall.h', 'SYS_memfd_create') \
- or cc.has_function('memfd_create')
+if false
cdata.set('HAVE_MEMFD', 1)
endif

@@ -381,7 +375,7 @@
libintl_dep = cc.find_library('intl')
endif
else
Expand All @@ -22,7 +38,7 @@ index c5135330f..0f0c3d5ed 100644
endif

# Symbols
@@ -440,6 +436,8 @@ endif
@@ -448,6 +442,8 @@
# Core Dependencies

libm_dep = cc.find_library('m', required : true)
Expand All @@ -31,50 +47,3 @@ index c5135330f..0f0c3d5ed 100644

thread_dep = dependency('threads')
foreach f : [
diff --git a/src/modules/meson.build b/src/modules/meson.build
index 1e12569dc..6112480e2 100644
--- a/src/modules/meson.build
+++ b/src/modules/meson.build
@@ -61,6 +61,9 @@ all_modules = [
[ 'module-virtual-sink', 'module-virtual-sink.c' ],
[ 'module-virtual-source', 'module-virtual-source.c' ],
[ 'module-volume-restore', 'module-volume-restore.c' ],
+ [ 'module-sles-sink', 'sles/module-sles-sink.c', [], [], [sles_dep] ],
+ [ 'module-sles-source', 'sles/module-sles-source.c', [], [], [sles_dep] ],
+ [ 'module-aaudio-sink', 'aaudio/module-aaudio-sink.c', [], [], [aaudio_dep] ],
]

if host_machine.system() == 'windows'
diff --git a/src/pulsecore/meson.build b/src/pulsecore/meson.build
index b37fec499..2cdac04e9 100644
--- a/src/pulsecore/meson.build
+++ b/src/pulsecore/meson.build
@@ -185,14 +185,7 @@ libpulsecore_simd_lib = []
foreach simd_kwargs : simd_variants

if host_machine.cpu_family() == 'arm' and 'neon' in simd_kwargs
- if not cc.compiles('''
- #include <arm_neon.h>
- int main() {
- return sizeof(uint8x8_t) + sizeof(int32x4_t) + sizeof(float32x4_t);
- }
- ''', name : 'neon code')
- continue
- endif
+ continue
endif

libpulsecore_simd = simd.check('libpulsecore_simd',
diff --git a/src/tests/meson.build b/src/tests/meson.build
index dceca55c7..04993ea1c 100644
--- a/src/tests/meson.build
+++ b/src/tests/meson.build
@@ -106,8 +106,6 @@ if get_option('daemon')
default_tests += [
[ 'sigbus-test', 'sigbus-test.c',
[ check_dep, libpulse_dep, libpulsecommon_dep, libpulsecore_dep ] ],
- [ 'usergroup-test', 'usergroup-test.c',
- [ check_dep, libpulse_dep, libpulsecommon_dep, libpulsecore_dep ] ],
]
endif

6 comments on commit 0ae3a72

@twaik
Copy link
Member

@twaik twaik commented on 0ae3a72 Oct 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait, this commit removes building module-sles-sink, module-sles-source, module-aaudio-sink?

@licy183
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahhhh... I deleted it by accident.

@twaik
Copy link
Member

@twaik twaik commented on 0ae3a72 Oct 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also there is no PR for this branch.

@licy183
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This branch will not get merged. I just trigger this for #21660

@twaik
Copy link
Member

@twaik twaik commented on 0ae3a72 Oct 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there are more than two users who reported that memfd not work for them, probably it is a good idea to merge this patch.

@licy183
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so. The kernel for Android 7.x should have memfd enabled. These Android ROMs without memfd is usually not officially maintained by the manufacturers.

Please sign in to comment.