pelya / android-shmem

System V shared memory emulation on Android, using ashmem. That includes shmget, shmat, shmdt and shmctl functions.
BSD 3-Clause "New" or "Revised" License
200 stars 43 forks source link

Cannot make it work with alsa #1

Open mittorn opened 9 years ago

mittorn commented 9 years ago

Alsa dmix module uses shmget syscall. I have preloaded emulation library, but it seems to call shmget direcly. Is there any way to override functions from libasound?

pelya commented 9 years ago

libasound is not accessible to regular apps on Android, adding shmem library won't make it work.

Debian noroot uses pulseaudio with pipe to pass audio stream to Java layer, that setup is not very reliable though. On Feb 15, 2015 10:08 AM, "mittorn" notifications@github.com wrote:

Alsa dmix module uses shmget syscall. I have preloaded emulation library, but it seems to call shmget direcly. Is there any way to override functions from libasound?

— Reply to this email directly or view it on GitHub https://github.com/pelya/android-shmem/issues/1.

mittorn commented 9 years ago

libasound works when dmix is not enabled in asound.conf, so shm should help. Problem was that LD_PRELOAD does not work when wrapped/replaced functions are called from same library (like shmget from libc directly).