Discussion:
alsa recording
Scott Sibley
2012-02-01 03:10:14 UTC
Permalink
Hello. I have a working implementation that samples audio input via the
tinyalsa API through NDK. However, it appears permissions for /dev/snd/*
aren't consistent across devices, and the directory doesn't seem to exist
at all on an emulator.

I've looked into AudioRecorder through Java, but it only deals with
microphone and phone call audio. I'm interesting in microphone audio, but
only secondarily to media audio, so this route isn't viable.

Is there a way to use tinyalsa consistently across various devices and
emulators? Is there another approach to accessing raw PCM data?

Thanks.

Scott
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To post to this group, send email to android-***@googlegroups.com.
To unsubscribe from this group, send email to android-ndk+***@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.
Glenn Kasten
2012-02-01 05:43:22 UTC
Permalink
This is far off-topic for NDK, but I'll give a brief answer here and
suggest android-porting for follow-up and further discussion of low-
level audio and tinyalsa.

Android low-level audio is handled by AudioFlinger service within
mediaserver process. AudioFlinger does not assume ALSA drivers.
Instead it accesses the audio drivers via a user-mode hardware
abstraction library called the "audio HAL". So not all Android devices
have ALSA device nodes. Even when there is ALSA present, mediaserver
owns the audio devices, so what you're describing would likely require
stopping mediaserver.
Post by Scott Sibley
Hello. I have a working implementation that samples audio input via the
tinyalsa API through NDK. However, it appears permissions for /dev/snd/*
aren't consistent across devices, and the directory doesn't seem to exist
at all on an emulator.
I've looked into AudioRecorder through Java, but it only deals with
microphone and phone call audio. I'm interesting in microphone audio, but
only secondarily to media audio, so this route isn't viable.
Is there a way to use tinyalsa consistently across various devices and
emulators? Is there another approach to accessing raw PCM data?
Thanks.
Scott
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To post to this group, send email to android-***@googlegroups.com.
To unsubscribe from this group, send email to android-ndk+***@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.
mic _
2012-02-01 07:06:43 UTC
Permalink
You want to record what's being played back on the phone? As Glenn
mentioned that would probably require modifying AudioFlinger or
AudioHardware (i.e. a custom Android version, which isn't something you can
do with the NDK). The AudioFlinger takes all the decoded (PCM) AudioTracks
belonging to each output thread, applies effects, mixes them together, and
writes them to the corresponding output stream in AudioHardware. Actually,
on some platforms it might not always be PCM; it could be e.g. an AC3/DTS
bistream going to the HDMI output, but that's a special case.

If you take an Android phone released before the last quarter of 2011 my
guess is that a fairly low percentage of those have ALSA drivers. It's
starting to get more common though.

/Michael
Post by Glenn Kasten
This is far off-topic for NDK, but I'll give a brief answer here and
suggest android-porting for follow-up and further discussion of low-
level audio and tinyalsa.
Android low-level audio is handled by AudioFlinger service within
mediaserver process. AudioFlinger does not assume ALSA drivers.
Instead it accesses the audio drivers via a user-mode hardware
abstraction library called the "audio HAL". So not all Android devices
have ALSA device nodes. Even when there is ALSA present, mediaserver
owns the audio devices, so what you're describing would likely require
stopping mediaserver.
Post by Scott Sibley
Hello. I have a working implementation that samples audio input via the
tinyalsa API through NDK. However, it appears permissions for /dev/snd/*
aren't consistent across devices, and the directory doesn't seem to exist
at all on an emulator.
I've looked into AudioRecorder through Java, but it only deals with
microphone and phone call audio. I'm interesting in microphone audio, but
only secondarily to media audio, so this route isn't viable.
Is there a way to use tinyalsa consistently across various devices and
emulators? Is there another approach to accessing raw PCM data?
Thanks.
Scott
--
You received this message because you are subscribed to the Google Groups
"android-ndk" group.
To unsubscribe from this group, send email to
For more options, visit this group at
http://groups.google.com/group/android-ndk?hl=en.
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To post to this group, send email to android-***@googlegroups.com.
To unsubscribe from this group, send email to android-ndk+***@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.
Paul Kalebu
2018-07-10 23:58:52 UTC
Permalink
How did you go about routing the audio through tinymix? I'm trying to do
the same thing but can't find any reliable documentation out there.
Post by Scott Sibley
Hello. I have a working implementation that samples audio input via the
tinyalsa API through NDK. However, it appears permissions for /dev/snd/*
aren't consistent across devices, and the directory doesn't seem to exist
at all on an emulator.
I've looked into AudioRecorder through Java, but it only deals with
microphone and phone call audio. I'm interesting in microphone audio, but
only secondarily to media audio, so this route isn't viable.
Is there a way to use tinyalsa consistently across various devices and
emulators? Is there another approach to accessing raw PCM data?
Thanks.
Scott
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk+***@googlegroups.com.
To post to this group, send email to android-***@googlegroups.com.
Visit this group at https://groups.google.com/group/android-ndk.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/26595fe2-7e3b-45fb-9189-0388f4719de1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Glenn Kasten
2018-07-12 00:26:36 UTC
Permalink
tinyalsa is not an NDK API, so this android-ndk group might not be the best
place.
But tinyalsa is sometimes discussed on android-porting. Here is one recent
post:

https://groups.google.com/forum/#!topic/android-porting/6oP3laJ4_6U
Post by Paul Kalebu
How did you go about routing the audio through tinymix? I'm trying to do
the same thing but can't find any reliable documentation out there.
Post by Scott Sibley
Hello. I have a working implementation that samples audio input via the
tinyalsa API through NDK. However, it appears permissions for /dev/snd/*
aren't consistent across devices, and the directory doesn't seem to exist
at all on an emulator.
I've looked into AudioRecorder through Java, but it only deals with
microphone and phone call audio. I'm interesting in microphone audio, but
only secondarily to media audio, so this route isn't viable.
Is there a way to use tinyalsa consistently across various devices and
emulators? Is there another approach to accessing raw PCM data?
Thanks.
Scott
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk+***@googlegroups.com.
To post to this group, send email to android-***@googlegroups.com.
Visit this group at https://groups.google.com/group/android-ndk.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/ca93e7c3-6486-4163-afe3-5e21e162f508%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Paul Kalebu
2018-07-12 00:49:50 UTC
Permalink
Thanks, I'll take a look!
Post by Glenn Kasten
tinyalsa is not an NDK API, so this android-ndk group might not be the
best place.
But tinyalsa is sometimes discussed on android-porting. Here is one recent
https://groups.google.com/forum/#!topic/android-porting/6oP3laJ4_6U
Post by Paul Kalebu
How did you go about routing the audio through tinymix? I'm trying to do
the same thing but can't find any reliable documentation out there.
Post by Scott Sibley
Hello. I have a working implementation that samples audio input via the
tinyalsa API through NDK. However, it appears permissions for /dev/snd/*
aren't consistent across devices, and the directory doesn't seem to exist
at all on an emulator.
I've looked into AudioRecorder through Java, but it only deals with
microphone and phone call audio. I'm interesting in microphone audio, but
only secondarily to media audio, so this route isn't viable.
Is there a way to use tinyalsa consistently across various devices and
emulators? Is there another approach to accessing raw PCM data?
Thanks.
Scott
--
You received this message because you are subscribed to the Google Groups
"android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an
Visit this group at https://groups.google.com/group/android-ndk.
To view this discussion on the web visit
https://groups.google.com/d/msgid/android-ndk/ca93e7c3-6486-4163-afe3-5e21e162f508%40googlegroups.com
<https://groups.google.com/d/msgid/android-ndk/ca93e7c3-6486-4163-afe3-5e21e162f508%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk+***@googlegroups.com.
To post to this group, send email to android-***@googlegroups.com.
Visit this group at https://groups.google.com/group/android-ndk.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/CAN3Ckmh4PA%3DzodMPJmuP_TyNVT69AuyipydBfLDnUxnmqOEazQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Continue reading on narkive:
Loading...