A constant sNumInts with a value of 6 was being assigned to the numInts
attribute in the private_handle_t constructor, and was also used in the
validate method. That constant value is appropriate for 32-bit systems
but is not appropriate for a 64-bit system where uintptr_t used for
base attribute will be 64-bit.
sNumInts is now changed to a static inline function that calculates
numInts.
Change-Id: I482ddb5915c9ff55fb2e2a87887a0ec2dc2299ed
Signed-off-by: Marcus Oakland <marcus.oakland@arm.com>
Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
out->dev->lock remains locked in error case in out_write()
Added pthread_mutex_unlock() in the error case
Bug: 12824374
Change-Id: Ibbbd5ced1f9d469cfba3b33a94414d0b94affa8f
Signed-off-by: Glenn Kasten <gkasten@google.com>
- Deprecates vendor tag specification in camera3 device.
- Moves vendor tag ops declaration to camera metadata library and
cleans up definitions.
- Updates the example HAL.
Change-Id: Ifb16bb0d4bbc896bc32d33dd150e7e174af57dad
Android's implementation of vibrator needs to be done inside a
hardware module, so that it can make a vendor implementation possible.
Hw module's name becomes vibrator.default.so.
This change is related to other changes in:
- frameworks/base
- hardware/libhardware_legacy
- device/generic/goldfish
- platform/build
Change-Id: I844279f5535289f079d412fdc44c5cb3c9c1130c
Author: Vincent Becker <vincentx.becker@intel.com>
Signed-off-by: Vincent Becker <vincentx.becker@intel.com>
Signed-off-by: Shuo Gao <shuo.gao@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Signed-off-by: David Wagner <david.wagner@intel.com>
Author-tracking-BZ: 49760 94611
Squashed commit of:
Move sensors multi HAL to libhardware
Added a SensorEventQueue, a circular buffer meant for reading with one thread
and polling a subhal with another. The writing thread gets access to pointers
in the internal buffer. This design avoids a memcpy on write when the multihal
fetches subhal events using poll().
Unit-tests include multithreaded reading and writing lots of events, in
random-sized chunks.
This is not used by the multihal yet. That will be a different CL.
MultiHal multithreaded polling
Tests SensorEventQueue I/O when the queue is full.
Reduced debug logging in multihal.
deactivated multihal logspam, made warnings warnings, left critical startup info
Removed unneeded linux/input.h includes, to fix Mac SDK build
Change-Id: I1e35508949df98a1acef7a4a2d012eea87b4a5eb
and polling a subhal with another. The writing thread gets access to pointers
in the internal buffer. This design avoids a memcpy on write when the multihal
fetches subhal events using poll().
Unit-tests include multithreaded reading and writing lots of events, in
random-sized chunks.
This is not used by the multihal yet. That will be a different CL.
Change-Id: I58418d69eebebeb96befb08ba3aed080f0f08551
Add* functions const to protect data being added.
Initiailze metadata object from a camera_metadata_t.
Remove template-specific constructor.
Add convenience "add1" method to abvoid stack-allocated data.
Construct templates manually (in ExampleCamera) from base.
Change-Id: I3201f61e9d32841ea7a769d69242b40d8727c02e
ExampleCamera represents a specific (e.g. front or back) camera device,
and contains all the device and logic for that device/sensor.
Change-Id: Iecc1a1d905501a66edb6e3994ff93d8761b82f8b
Now that libutils is outside of frameworks, use that for c++-style
scoped tracing and remove the temporary shim header.
Change-Id: I913767aed8ff70abb9299e7a7b318b24a25e23c1
Static camera characteristics can be queried on any device at any time.
Separate the locking for it from the rest of the device to eliminate any
contention between operations on the device and static characteristic
initialization.
Change-Id: I8076378699f274e70c6318e537df4758972de9db
The shutter callback timestamp should originate from the sensor itself,
since it knows exactly when the first line of the frame started
exposing. However, as a fallback (or in the CPU-painting case) query
CLOCK_BOOTTIME instead.
Change-Id: Id57c05525e9c575d009b9deb96a69557fccac16b
Metadata is currently only used for immutable persistent settings
(static camera characteristics, and the capture templates), but will be
used for dynamic metadata as well. Make it deleteable so we can
create/destroy these at will.
Change-Id: I7372b07b904d5a6b55453093712e0bb2675918b5
max_buffers and usage are read by the framework inside the struct used
to pass the stream configuration parameters; scribble our new
calculated values whever they are updated internally.
Adds logging to stream creation method (reuse/new).
Change-Id: I04e12880820571900f2ae80c27100f8aedcf9d02
Basic static metadata statically constructed from preprocessor passes
over an array of camera metadata tags.
Change-Id: I16ea9f4d68120d5a0bc010a4a67b0cbcd761329e
Adds a Stream object, and configureStreams support in parsing the
provided stream_array. Streams are naively setup for sync-less software
painting.
Change-Id: Ibbd90e3e2c7fa984dd5d2dcbd4da7bf4dad43aa1
This c++ helper class is normally provided by frameworks/native's
libutils, but cannot be used from the context of a hardware module. For
now just add the required functionality locally in the hardware module.
Change-Id: I5b399cbeb1c017a95baf19456dbf20569e677fbe
The register/unregister gralloc calls were avoiding
mmapping/munmapping the shared memory region if the buffer was created
by the current process. This is left over from the pmem-based
implementation, where trying to map the same region twice in the same
process would fail, or would reuse a single mapping without
refcounting.
This causes problems if a buffer is
- allocated in process A,
- transferred from A to process B and registered there
- unregistered/freed in A
- transferred back from B to A and re-registered
Process A then has a new handle to the buffer, but since it originally
created the buffer it will not be mmapped, so trying to read or write
the buffer will crash.
With ashmem, mmaping a region twice in the same process creates two
distinct mappings which can be used and munmapped independently. So
we no longer need to avoid mmapping again in the allocating process.
Bug: 8468756
Change-Id: I167bec5ca07e5534c5e2115630fe8386e481388e
Refactor the camera module into a single CameraHAL object. Adds
set_callbacks, new in the v2.1 module API.
Change-Id: I4da677c28d7425f545f68998844fcfa4caf0feb9
Explicitly hide all symbols from being exported from the camera HAL
except the symbol required to load the module.
Change-Id: I940b24b8d3895f46e63df3c28e43b8cb012bd637
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
This is meant to be an example and a reference for device manufacturers
on how to build a new Camera v2 HAL. This first patch has basic
configuration and entry/exit.
Change-Id: Ib4166e2eadb813228af38ec31a1215940c070bbf
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
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
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
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
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
Changed audio device API version to 2.0 because of
new enums for audio input and output devices.
Removed implementations of get_supported_devices() in
stub and usb audio modules.
Change-Id: I09345d38929d931e5015e36d18259f5a5f950298
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
(cherry picked from commit d245968b7ef0be5c776c9aefff3eca9e293d1b35)
> Extend the audio HAL interface to support get/set master mute
>
> Hand merge from ics-aah
>
> > Extend the audio HAL interface to support get/set master mute: DO NOT MERGE
> >
> > Extend the audio HAL interface to allow HALs to optionally support HW
> > level master mute. This follows the same pattern as master volume and
> > is part of the fix for bug 6828363. Because of the divergences
> > between ICS and master, this change will need to be merged by hand.
> >
> > Signed-off-by: John Grossman <johngro@google.com>
> > Change-Id: Ica6f5e37e13d13dde60463966f41f271ffa104fd
>
> Change-Id: I5e7aea6d7da0012dcc077281f9077fc04cfb9889
> Signed-off-by: John Grossman <johngro@google.com>
Change-Id: I2011cc5bc41ca7081ce255a4bfba65f36f899bc4
Signed-off-by: John Grossman <johngro@google.com>
The new version adds an acquire and release fence to each layer,
providing explicit producer->hwc and hwc->producer synchronization.
Change-Id: Ibd6e3c7b3515c012c767246e6d6514274fdef01d
Also don't clear card and device when out_set_parameters is called
to set other parameters.
Change-Id: I4feda9f6a2e76cb45bbc8a8f8256bb1760302707
Signed-off-by: Mike Lockwood <lockwood@google.com>
Modified open output and input stream functions to add new
parameters needed by audio HAL. Also grouped parameters
in a config structure for clarity.
Change-Id: I60832d8e5b5e4a48f209a6d83f5ca9c044be61f1
Add I2C slave address. Multiple I2C addresses are possible
for PN544 module. Configure address according to board design.
Change-Id: I847e8f3db631f5039cf15143a9982f4b9b209f27
This is a squashed merge of the following changes:
Commit f560da61a5e128ca9f82f7fe939afcf1f09188c7
Author: John Grossman <johngro@google.com>
Date: Thu Aug 11 15:34:55 2011 -0700
Fill out a missing entry in the audio HAL function table.
The entry for get_initial_master_volume was missing from the non-legacy audio
HAL and needs to be filled out. Also fix up the order of the comments
describing the get_initial_master_volume method.
Change-Id: I87d5415ef92611497a6dab4c657fc00367c4d80b
commit cea82facb63fd237a4ea6fb770605fcb500850ff
Author: Jason Simmons <jsimmons@google.com>
Date: Thu Jun 16 14:24:24 2011 -0700
Define a replacement for getSampleDelta that returns a DMA start time and count of samples queued
Change-Id: I2d13f57b5a8c5b97fb3aa0a90834ce91c56864ef
commit 60a9acd7eee470a8d870218e8be618bfa3be15a5
Author: Mike J. Chen <mjchen@google.com>
Date: Tue Jun 7 09:13:23 2011 -0700
Add Android@Home extensions to new Audio HAL interface.
Change-Id: I3ea4676d4b7d2afd78a5a7a7003ad5c437276d05
Signed-off-by: Mike J. Chen <mjchen@google.com>
Change-Id: I09f3756d12a1ce4f9af39610ed857890742a72df
Signed-off-by: Mike J. Chen <mjchen@google.com>
Signed-off-by: John Grossman <johngro@google.com>
Conflicts:
include/hardware/audio.h
modules/audio/audio_hw.c
This is a squashed merge of the following changes:
commit 9def1ae65f6b4d6a8fdec147fdcd34f22f08174a
Author: John Grossman <johngro@google.com>
Date: Fri Aug 12 11:47:20 2011 -0700
Change the signature of set_local_slew.
Changed the definition of the slew function in the local time HAL to take an
int16 instead of an int32 and to use the full range of the int instead of
attempting to imply any particular PPM range.
Change-Id: Ia67f50e77f1fe674a63ec69460e830d1191ef5a0
commit afab51327453d1bfc7423f8ce7a28933d8fc49b2
Author: John Grossman <johngro@google.com>
Date: Mon Jun 27 17:29:07 2011 -0700
Remove "primary" from the local_time HAL.
Interface instances are a pattern which should only be used by audio. Remove
its use from the local_time HAL.
Change-Id: If4c458cf16a02d9dc63c04185111ae793fc57801
commit 1c26e59a66e75ccb31027f42183aaa32bde6e456
Author: John Grossman <johngro@google.com>
Date: Fri Jun 17 14:19:24 2011 -0700
Refactor the local/common clock services.
This change is one of a set of 5 changes made to different repositories. Look
for this comment in all of them.
Refactor the local/common clock services to match android best
practice. Notable changes include
+ The kernel no longer knows anything about common time. Common time has been
moved completely up into user land. This has an impact on the accuracy of the
timesync debugging code, and the netfilter assisted approach to network based
timesync is going to have to be modified.
+ The timesync driver used by A@H is now just local time driver.
+ The kernel no longer needs access to the linear transform math code, and it
has been removed.
+ A new HAL has been introduced to expose the concept of local time to the
system.
+ A non-slewable stub implementation of the local time HAL based on
CLOCK_MONOTONIC has been added.
+ The old library has been eliminated. Its functionality has been
distributed among the common time binder service, the local time hal and the
linear transform utility code.
+ All clients of the old library have been changed to be clients of
the binder service, the hal and the utility code.
+ The reset_tt utilities have been removed, they no longer have a purpose in the
system.
Change-Id: I39843b94f9b6d13f63b22145a2edcafe4ca87349
Change-Id: Ib264c992d564b99ef7c7847a788e4fa7f5e101b4
Signed-off-by: Mike J. Chen <mjchen@google.com>
Signed-off-by: John Grossman <johngro@google.com>
Conflicts:
modules/Android.mk
Improve volume management by keeping track of volume for each type
of device independently.
Added functions at the audio policy interface to set and get stream volume
for a particular device.
Change-Id: Ic8899e82e48193cb65b3673e9d20383efed943b5
First implementation of a NFC HAL. This implementation doesn't
offer a generic NFC device HAL (yet), but offers typed interfaces
for different NFC controllers. Currently only the PN544 is supported.
Change-Id: I3ac04dcd767fb12a433edbe88ec7068eb1930a57
Added a method on audio policy interface to register
audio effect CPU usage on enable and unregister on disable
instead of when the effect is created or destroyed.
Change-Id: Iee20bf70fee7302f817ec4c7d9bf7640caca2e95
Note: The code under hardware/libhardware/modules/gralloc/ is only used
when running the system under the emulator.
Change-Id: I022978aeaacc5137c9917cd2ef6952dd3897ece4
This patch avoids a division-by-0 when the system is running
under emulation (the kernel driver reports pixclock as 0, for
some reason). Which results in a SIGFPE during the boot sequence.
Change-Id: Idb6bcdd58999ea9231f2411481c25929d5d02f1d
Some devices have low-level bugs in their page-flip.
Disabling it at this level gives us more flexibility
than trying to control it elsewhere.
Bug: 3097357
Change-Id: Icc6ae172264e453bec0680e74a497a2b24299c4a
this gralloc module is only used on the emulator or without a h/w
renderer. therefore there is no synchronization to do in lock/unlock
and pmem buffers are not relevant.
hopefully this will remove some of the confusion about how gralloc
should be implemented and make it more obvious that this implementation
is not intended to be used by h/w renderers.
The place where the PAGE_SIZE value is defined varies, mostly because
you're not supposed to be using it directly. sysconf(_SC_PAGE_SIZE)
is the approved method, and in fact some Linux distros actually #define
PAGE_SIZE to the library call.
- make sure to return an error if a buffer is locked twice or unlocked while not locked.
- added registerBuffer() and unregisterBuffer() to the gralloc module so that we can do some cleanup when a buffer is no longer needed. this became necessary after we removed map/unmap so we have a place to unmap buffers without the need of a kernel module.
- change the constants for GRALLOC_USAGE_SW_{READ|WRITE}_NEVER to 0, so that NOT specifying them means "NEVER".