Skip to content

Building libao using Android standalone toolchain #7

Open
@lm8

Description

@lm8

Was experimenting to see if libao would build for Android using the standalone toolchain. I hit an issue with it not being able to find the soundcard.h include.

In configure.ac where the following appear:
AC_CHECK_HEADERS(sys/soundcard.h, have_oss=yes)
AC_CHECK_HEADERS(machine/soundcard.h, have_oss=yes)
I ended up adding this after it:
AC_CHECK_HEADERS(linux/soundcard.h, have_oss=yes)

I then patched ao_oss.c to use the HAVE_LINUX_SOUNDCARD_H define that the above check created:
diff -Naurp src/libao-1.2.0/src/plugins/oss/ao_oss.c tmp/libao-1.2.0/src/plugins/oss/ao_oss.c
--- src/libao-1.2.0/src/plugins/oss/ao_oss.c 2014-01-27 12:02:05 -0500
+++ tmp/libao-1.2.0/src/plugins/oss/ao_oss.c
@@ -34,11 +34,15 @@
#include <unistd.h>
#include <fcntl.h>
#include <math.h>
+#ifdef HAVE_LINUX_SOUNDCARD_H
+#include <linux/soundcard.h>
+#else
#if defined(OpenBSD) || defined(NetBSD)
#include <soundcard.h>
#else
#include <sys/soundcard.h>
#endif
+#endif
#include <sys/ioctl.h>

#include "ao/ao.h"

After those changes, I was able to get libao to build with some sound support. Thought I'd mention the patches I needed in case anyone else was interested or might need them in the future.

Thank you.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions