History log of /hardware/libhardware/modules/audio_remote_submix/audio_hw.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
79fbccf91be4d98d0e04dd840f1ccf156fab2ae3 06-Apr-2016 Jean-Michel Trivi <jmtrivi@google.com> Fix typo in error logs in r_submix open_input_stream function

Change-Id: I52d5268290802e3f0a88662aa6fbe9a46efda735
/hardware/libhardware/modules/audio_remote_submix/audio_hw.cpp
854a10af10df54eb09946d8a39c9188939d57093 19-Feb-2016 Eric Laurent <elaurent@google.com> Add debug folder for audioserver

Use /data/misc/audioserver instead of data/misc/media for
audioserver debug.

Bug: 27064332
Change-Id: Ic213ee0354d9ab1ed1980e8c3d07cd239597ad2e
/hardware/libhardware/modules/audio_remote_submix/audio_hw.cpp
04c88495bb7caf851f9802dee20a2a1ffceff195 06-Jan-2016 Glenn Kasten <gkasten@google.com> Remove TimedAudioTrack and associated code

Bug: 8278435
Change-Id: I095c1a4888e645e14d93b0b15fbef4524a831ca1
/hardware/libhardware/modules/audio_remote_submix/audio_hw.cpp
0b93c0ab58a9d919d13c3d25f2ba262df0082519 10-Aug-2015 Andy Hung <hunga@google.com> Do not reset out_get_presentation_position() to 0 on standby

Bug: 21199150
Bug: 23080499
Change-Id: I749b331bfce8cfe27b16bb2fce14f23816fb48ce
/hardware/libhardware/modules/audio_remote_submix/audio_hw.cpp
25f4751f6d0992ec4f988fd4f51f36140a28d0e2 26-May-2015 Jean-Michel Trivi <jmtrivi@google.com> Implement timestamp reporting functions

Count number of frames that have been written, reset on standby.
The presentation position is the number of written frames minus
the frames still in the pipe (they were written but not presented).

Bug 21198864

Change-Id: I00ef10f56a825555e7a970cce1504a9bd3744e04
/hardware/libhardware/modules/audio_remote_submix/audio_hw.cpp
bbb3e77ab0ca247c646d4a0f9d815bd6754d8eba 27-May-2015 Jean-Michel Trivi <jmtrivi@google.com> Reduce pipe length

Bug 21198864

Change-Id: I5bb7ba20c4e2d294363a3a4487f4e3ae634ada46
/hardware/libhardware/modules/audio_remote_submix/audio_hw.cpp
257fde6eb533b890776c8c45be8b61c48ab04945 10-Dec-2014 Jean-Michel Trivi <jmtrivi@google.com> Reroute submix HAL: fix race condition on output state

When reading from a pipe, the output may have been previously
closed, therefore the output state should only be read if it
is still available.
This fixes a race condition observed between in_read() (which
accesses the output stream) and adev_close_output_stream()
(which sets the output reference to NULL).
No issue with out_write() which checks the input reference.

Bug 16009464

Change-Id: I979bc12c8fe91fad9b6f6c9e0be107c1bacae360
/hardware/libhardware/modules/audio_remote_submix/audio_hw.cpp
b73bc86089b8a65da88776bafcf48529431150b8 14-Nov-2014 Jean-Michel Trivi <jmtrivi@google.com> Support multiple pipes for rerouting

The implementation for "remote submix" supported only one pipe
to capture the output of a mix.
This CL adds support for multiple pipes to support capturing
multiple audio routes.
The structure for the r_submix audio device holds an array
of route configurations (route_config), each referencing
the input and output of the pipe dedicated to this route.
Each route is associated to a unique address. Standby
status is maintained per stream.

Bug 16009464

Change-Id: Ie164c4ad2a6d8138f825484e7faf29a974ccf82e
/hardware/libhardware/modules/audio_remote_submix/audio_hw.cpp
793a854e4547fa43632907a987684cadc93eb5e2 15-Oct-2014 Jean-Michel Trivi <jmtrivi@google.com> Fix remote submix crash on null sink

The "remote submix" HAL uses a MonoPipe instance to "pipe" audio
from the sink of this virtual device HAL to its source.
The life-cycle of this pipe is:
- creation when either the input or output stream is open
- destruction when both input and output are closed.

Changes are:
Fix test for pipe destruction: destroy pipe when both
input and output streams are NULL.
Count how many read errors went into the logs and cap them
so as not to spam the logs when the pipe is not properly
set up. Less 'I' logs, 'D' logs instead.
When opening input stream, check for non-null sink before
checking if it's shutdown.

Bug 16653334
Bug 17111907

Change-Id: I634b4192b00f9b74a5109f42242423e9c8cb4c7c
/hardware/libhardware/modules/audio_remote_submix/audio_hw.cpp
f5e2469c02825f018df6336125882812003b8e64 28-Jul-2014 Eric Laurent <elaurent@google.com> audio HAL: add parameters to open stream

Pass device address (and audio source for inputs) to
open_output_stream() and open_input_stream() audio HAL functions.

Bug: 14815883.
Change-Id: I5535677db3f3027917a31a7ed5c0a4c6bc013639
/hardware/libhardware/modules/audio_remote_submix/audio_hw.cpp
7d973adff4c9b344b530dd7c585f789d02c605da 15-Jul-2014 Glenn Kasten <gkasten@google.com> Add audio_input_flags_t to HAL open_input_stream

Change-Id: I3519bfa45809e064d19473ebe6489c5249d306a8
/hardware/libhardware/modules/audio_remote_submix/audio_hw.cpp
c5ae6a030484f83beb3f2120f136cec1c0ef8b0a 02-Jul-2014 Eric Laurent <elaurent@google.com> audio: different frame size calculation for input and output

Bug: 15000850.
Change-Id: I7813e99a0b7ce613cc3b7d7c95be0525cb2d6c81
/hardware/libhardware/modules/audio_remote_submix/audio_hw.cpp
dd45fd3aede6b116656a60a2d9b6e286d19f030f 02-Jul-2014 Eric Laurent <elaurent@google.com> audio: fixed channel count determination from channel mask

Do not use popcount() to derive channel count from channel mask.

Bug: 15000850.
Change-Id: I4d803dc3e1cb680baa0022e539e6f9eab3ffef1a
/hardware/libhardware/modules/audio_remote_submix/audio_hw.cpp
10f1a806e6537835de7f71dbc05db1889436732e 10-Jun-2014 Stewart Miles <smiles@google.com> Fixed submix buffering when input and output stream formats differ.

When channel conversion is enabled and the pipe is opened with less channels
(e.g 1) than the output stream's channels (e.g 2) the input stream's buffer
size was calculated incorrectly which resulted in the input stream buffer size
being larger than the output stream buffer size in terms of time. This
changes the pipe size to take into the account maximum frame size so the
output stream buffer size will be greater or equal to the input stream buffer
size.

In addition, if the pipe is created when the input stream is opened and the
output stream is opened at a different sample rate (e.g input = 8KHz,
output = 48Khz) the pipe will incorrectly rate limit writes to the pipe
resulting in gaps of silence in the data read from the pipe by the input
stream.

Bug: 15291446
Change-Id: I01480edff7ef3a199f509866c1e95ecd4c437a92
/hardware/libhardware/modules/audio_remote_submix/audio_hw.cpp
02c2f7126c78334ffb20d95f68284f4ec5bdae02 01-May-2014 Stewart Miles <smiles@google.com> Added basic resampling of submix data on read from the input stream.

As described in If592270a17e08c5852b00b730bb9c5166c746ad2 the audio mixer
doesn't work correctly when sending data to an output device that supports
a sample rate that is more than 2x different to the source data rate.

This modifies the remote submix module to resample data from the pipe
when it's read from the input stream.

Bug: 11273000
Change-Id: I9c4b3710bcebf3a2df045965dfdafdd9855b0b25
/hardware/libhardware/modules/audio_remote_submix/audio_hw.cpp
92854f5fcced958e5888074fc4e68ad0ec67aeef 01-May-2014 Stewart Miles <smiles@google.com> Add optional logging of input and output streams to the submix HAL.

In order to aid debugging of issues with streaming data in the submix HAL
this change introduces a compile time option to log the input and output
streams to files for offline inspection.

Bug: 11273000
Change-Id: Ib2d929d7ba66f63b719e6996df9016f73c9080aa
/hardware/libhardware/modules/audio_remote_submix/audio_hw.cpp
e54c12cd532dc36286d500c03ad638402254d4e5 01-May-2014 Stewart Miles <smiles@google.com> Implemented mono->stereo, stereo->mono channel conversion in submix HAL.

The AudioFlinger service currently will only open stereo streams from
mono AudioTracks since all mixing is performed in stereo and then sent
to the HAL stream. In order to allow a process to record a mono stream
from the submix HAL, this change implements channel conversion in
the submix HAL so that it's possible to open the output stream in stereo
and the input stream in mono.

Bug: 11273000
Change-Id: I840ce0be3cf7e5bc8a4c6de63a70d5408d60b716
/hardware/libhardware/modules/audio_remote_submix/audio_hw.cpp
2d199fe082312963edd1ac198197280a4f18ca21 01-May-2014 Stewart Miles <smiles@google.com> Modified submix HAL to drop data to the output stream if the pipe could block.

Since it's possible to open an output stream on the submix HAL before the input
stream is open, writes to the output stream that fill the shared pipe result in
indefinitely blocking the thread writing to the stream. This change modifies
the behavior of writes to a submix output stream such that if a write would
result in blocking the thread and an input isn't open, the pipe is flushed
of the appropriate amount of data such that the write will not block.

Bug: 11273000
Change-Id: Ic81c50e4b44b777273191a1bc8cdf52181c3d2a0
/hardware/libhardware/modules/audio_remote_submix/audio_hw.cpp
3dd36f959532db801e65ea160623e94a0e7fd3a9 01-May-2014 Stewart Miles <smiles@google.com> Modify submix HAL to allow either input or output streams create the pipe.

This change is primarily being made as a short term solution to allow an input
audio stream received over the network to be fed into an audio input stream (e.g
the MIC stream) when a physical audio input device isn't present.

This makes both the input and output streams owners of the pipe so that
creation order no longer matters. In addition, it works around a memory leak
caused by applications that never close input streams.

Bug: 11273000
Change-Id: I5a3fb0b6f2148c113b2f3050b72ff2a8979a3e6d
/hardware/libhardware/modules/audio_remote_submix/audio_hw.cpp
7072684fbfc73b0dd92dc010f418b3919221f1d8 01-May-2014 Stewart Miles <smiles@google.com> Allow submix module streams to use any NBAIO format.

This modifies the submix module to allow the internal buffer to be any NBAIO
format. This is useful when sending audio of arbitrary formats between
processes. AudioFlinger continues to enforce format restrictions as specified
by the device specific audio_policy.conf so the submix streams will have the
same restrictions as before.

Bug: 11273000
Change-Id: I2cd4ff383c5c75e491ab22bc1949c835f04e230f
/hardware/libhardware/modules/audio_remote_submix/audio_hw.cpp
568e66ff9e0d6be92ba994e8054f78a0fb8726e2 01-May-2014 Stewart Miles <smiles@google.com> Modified submix buffer size accessors to use the pipe configuration.

This change stores the period size (fraction of the pipe buffer size)
in the submix device's configuration which is then used to calculate
the input and output stream buffer size.

In addition, accessors for the input / output stream format have been
modified to use the pipe format in the device configuration rather than
returning hard coded values.

Bug: 11273000
Change-Id: I9c14f8d549f4b4a6d7f77a9aeab4edfa5ba6bd1a
/hardware/libhardware/modules/audio_remote_submix/audio_hw.cpp
f645c5e629147628957cb8d66ce3405f242fd2e9 01-May-2014 Stewart Miles <smiles@google.com> Implemented accessors for derived submix HAL objects.

This change cleans up casting from contained to container structures.
Such that if..

struct child {
struct parent;
int child_data;
};

is changed to...

struct child {
int child_data;
struct parent;
};

functions that cast from "parent" to "child" will continue to function
correctly.

Change-Id: I88d70930d4d4df2e291239e562971b07d8b92f94
/hardware/libhardware/modules/audio_remote_submix/audio_hw.cpp
c049a0a3a9cdc0ba4cbc5fe8524e67ae39b1dd9a 01-May-2014 Stewart Miles <smiles@google.com> Added a compile time option to enable / disable verbose submix logging.

Along with the following minor changes:
* Fixed all referenced variable compiler warnings.
* Ordered headers in alphabetical order.

Change-Id: I122ef67d25b78056a60b85baf897005293a9efa0
/hardware/libhardware/modules/audio_remote_submix/audio_hw.cpp
747d0df39c66704e182b5c8485471940bfdf5816 21-Apr-2014 Colin Cross <ccross@android.com> am 6322562d: am c070bad4: Merge changes I672d4ee8,I6a2183b5,If0c0135e

* commit '6322562d0f1387c08109f706f381a3818114f91f':
usbaudio: allow compiling for 64-bit
audio_remote_submix: allow compiling for 64-bit
audio: allow compiling for 64-bit
5685a0845ecde4a1e53684473af3de77e6641af6 19-Apr-2014 Colin Cross <ccross@android.com> audio_remote_submix: allow compiling for 64-bit

Fix a few 64-bit warnings and set -Wno-unused-parameter, which makes
the directory warnings-clean on 32-bit and 64-bit.
Remove LOCAL_32_BIT_ONLY.

Change-Id: I6a2183b5bb0cdf438a04de967995da7b1e2e3854
/hardware/libhardware/modules/audio_remote_submix/audio_hw.cpp
0538a3e4abac286d94307e9a8a1e20bd9c1d0b64 07-Mar-2014 Glenn Kasten <gkasten@google.com> NBAIO::Format_from_SR_C requires audio_format_t parameter

Change-Id: I8bdfbd227dbfd4a46eb7ffc82ec7064582a626d0
/hardware/libhardware/modules/audio_remote_submix/audio_hw.cpp
59caeb14a7cb7cbc74db725343922c81f0e2e3aa 23-Aug-2013 Glenn Kasten <gkasten@google.com> Merge "Fix file permissions" into klp-dev
c49aa8d4f3c8a8647ca567c762fe4af59007307c 22-Aug-2013 Eric Laurent <elaurent@google.com> am 9595f7cf: remote submix: fix test on sampling valid rates

* commit '9595f7cff6ddbeb58350fadeaf21da3f14fb76bc':
remote submix: fix test on sampling valid rates
9595f7cff6ddbeb58350fadeaf21da3f14fb76bc 22-Aug-2013 Eric Laurent <elaurent@google.com> remote submix: fix test on sampling valid rates

Change-Id: I4e9e378940bb56202a6e6882f561b3293ad7225d
/hardware/libhardware/modules/audio_remote_submix/audio_hw.cpp
08708c5e1fda39bf0111b5e1175533e6763219e2 20-Aug-2013 Glenn Kasten <gkasten@google.com> Fix file permissions

Change-Id: Iffc2941d98ee16796cf3d44dec1cfa376d9362bb
/hardware/libhardware/modules/audio_remote_submix/audio_hw.cpp
6367c2ca3ee685055744f55c1afebecafafffa33 30-Jul-2013 Glenn Kasten <gkasten@google.com> Fix typo and remove executable bit on source code files

Change-Id: I0ac46bf80a4708d190c148f8b72bfcf4ea1168b1
/hardware/libhardware/modules/audio_remote_submix/audio_hw.cpp
eafbfa4058370f113bd94d597f54f28ba41c8a96 18-Dec-2012 Jean-Michel Trivi <jmtrivi@google.com> Use strong pointers and scope

Rely on strong pointers and scope rather than the more error prone
incStrong / decStrong approach which can cause object leaks.
No change in functionality.

Change-Id: I1bfc7f0cdeeac022e4120482cd3521e52ffea94e
/hardware/libhardware/modules/audio_remote_submix/audio_hw.cpp
430ac66690359b85ae1b606d12cdc4c22c0d2f61 02-Nov-2012 Glenn Kasten <gkasten@google.com> Fix build

Change-Id: I17094052b67f2069d80ea140442e5a969bd4e96f
/hardware/libhardware/modules/audio_remote_submix/audio_hw.cpp
90b0fbd13f97127e29ea565c09b64cc25ab6e9c9 31-Oct-2012 Jean-Michel Trivi <jmtrivi@google.com> Shutdown audio pipe when closing input stream

Writing to the audio pipe for the remote submix is blocking, unless
the audio output pipe is in shutdown mode. The playback thread
could stay blocked on the write if the input stream has already
been closed.
The change consists in shutting down the pipe also when the input
stream gets closed. When the pipe is in this state, simulate
timing in the write operation so we don't drain the output faster
than realtime.

Bug 7424646

Change-Id: I5feb3be642b0ee7eef10dee0141308684ee9c811
/hardware/libhardware/modules/audio_remote_submix/audio_hw.cpp
d44130339c7317faaa5cbab767eccc37347ffd25 30-Sep-2012 Jean-Michel Trivi <jmtrivi@google.com> bug 7253033 Add "exiting" state to remote audio submix module

Support receiving a parameter that sets the remote audio submix
module in a state where the audio pipe will unblock any current
write operation and not block anymore.

Change-Id: Ia3119cd79972afff0de24187dae627855a468ebf
/hardware/libhardware/modules/audio_remote_submix/audio_hw.cpp
97c262fc848c407f316fd7fe2b468a540f3bc38f 18-Sep-2012 Jean-Michel Trivi <jmtrivi@google.com> Remote submix: fix sink/source reference count handling

The reference count on the strong pointers to the audio sink and
source should be done on the object retrieved from the device
structure, not by accessing the corresponding fields, as they
can be cleared while reading or writing audio data.

Change-Id: I446a2c7bdcb0758b4013b0ad75450a15203fb9da
/hardware/libhardware/modules/audio_remote_submix/audio_hw.cpp
35a2c167b4ee090b5dd9779ecb40f82cdaf1c74d 17-Sep-2012 Jean-Michel Trivi <jmtrivi@google.com> Turn off logs in remote submix audio module

Change-Id: I61cd15534b1cd764b06f615569cdf02edbba909c
/hardware/libhardware/modules/audio_remote_submix/audio_hw.cpp
eec87706d21fc0ac4ad10ede86943770b2533564 17-Sep-2012 Jean-Michel Trivi <jmtrivi@google.com> Remote audio submix: blocking writes and sleeping reads.

Change how the remote audio submix is handling piping audio
through the pipe:
- use a MonoPipe as audio sink for blocking writes,
- use a MonoPipeReader as audio source for non blocking reads,
and keep track of when recording started to align the
time at which the in_read() call should return with the
projected time of the recording duration.

Change-Id: I8b0f8c56a0486806101e272dfbf9c6d2d1c11112
/hardware/libhardware/modules/audio_remote_submix/audio_hw.cpp
6acd966320c7f124f103044f3a152d90d6e38749 12-Sep-2012 Jean-Michel Trivi <jmtrivi@google.com> Remote submix audio module: sleep less, log errors

Neither write nor read are blocking, but write simulates
timing by checking the clock between two writes and
computing how long the next sleep should last.

Change-Id: I495ae6d44b0cf75a24fe4b70662cfac679049c67
/hardware/libhardware/modules/audio_remote_submix/audio_hw.cpp
5d85c537fcae931428ba8b7a47fdd393cc3cbd88 10-Sep-2012 Eric Laurent <elaurent@google.com> update audio remote submix API revision

Update remote submix audio HAL API revision to 2.0
(new audio device enums).

Change-Id: I61d5faf498144002929e570ee50375b059fb17c5
/hardware/libhardware/modules/audio_remote_submix/audio_hw.cpp
88b79cb001d1c733275c7cad490c32b143f78860 16-Aug-2012 Jean-Michel Trivi <jmtrivi@google.com> Add audio module for remote submix

New definitions of audio devices for remote submix: one representing
a sink for writing the audio buffers that won't be played directly
locally, another representing the audio source that can be read from
to obtain the audio mix.

New audio hardware module encapsulating the submix loop functionality.
Create a Pipe to serve as non-blocking audio ring buffer between
the output device (the sink) and the input device (the source).

Change-Id: I527f4721a69ced0430a99ebba3b4db7d419f2bb2
/hardware/libhardware/modules/audio_remote_submix/audio_hw.cpp