Loading audio/2.0/IStream.hal +52 −0 Original line number Diff line number Diff line Loading @@ -227,4 +227,56 @@ interface IStream { * @param fd dump file descriptor. */ debugDump(handle fd); /* * Called by the framework to start a stream operating in mmap mode. * createMmapBuffer() must be called before calling start(). * Function only implemented by streams operating in mmap mode. * * @return retval OK in case the success. * NOT_SUPPORTED on non mmap mode streams * INVALID_STATE if called out of sequence */ start() generates (Result retval); /** * Called by the framework to stop a stream operating in mmap mode. * Function only implemented by streams operating in mmap mode. * * @return retval OK in case the succes. * NOT_SUPPORTED on non mmap mode streams * INVALID_STATE if called out of sequence */ stop() generates (Result retval) ; /* * Called by the framework to retrieve information on the mmap buffer used for audio * samples transfer. * Function only implemented by streams operating in mmap mode. * * @param minSizeFrames minimum buffer size requested. The actual buffer * size returned in struct MmapBufferInfo can be larger. * @return retval OK in case the success. * NOT_SUPPORTED on non mmap mode streams * NOT_INITIALIZED in case of memory allocation error * INVALID_ARGUMENTS if the requested buffer size is too large * INVALID_STATE if called out of sequence * @return info a MmapBufferInfo struct containing information on the MMMAP buffer created. */ createMmapBuffer(int32_t minSizeFrames) generates (Result retval, MmapBufferInfo info); /* * Called by the framework to read current read/write position in the mmap buffer * with associated time stamp. * Function only implemented by streams operating in mmap mode. * * @return retval OK in case the success. * NOT_SUPPORTED on non mmap mode streams * INVALID_STATE if called out of sequence * @return position a MmapPosition struct containing current HW read/write position in frames * with associated time stamp. */ getMmapPosition() generates (Result retval, MmapPosition position); }; audio/2.0/types.hal +19 −0 Original line number Diff line number Diff line Loading @@ -70,3 +70,22 @@ struct DeviceAddress { string busAddress; // used for BUS string rSubmixAddress; // used for REMOTE_SUBMIX }; /* * Mmap buffer descriptor returned by IStream.createMmapBuffer(). * Used by streams opened in mmap mode. */ struct MmapBufferInfo { memory sharedMemory; // mmap memory buffer int32_t bufferSizeFrames; // total buffer size in frames int32_t burstSizeFrames; // transfer size granularity in frames }; /* * Mmap buffer read/write position returned by IStream.getMmapPosition(). * Used by streams opened in mmap mode. */ struct MmapPosition { int64_t timeNanoseconds; // time stamp in ns, CLOCK_MONOTONIC int32_t positionFrames; // increasing 32 bit frame count reset when IStream.stop() is called }; Loading
audio/2.0/IStream.hal +52 −0 Original line number Diff line number Diff line Loading @@ -227,4 +227,56 @@ interface IStream { * @param fd dump file descriptor. */ debugDump(handle fd); /* * Called by the framework to start a stream operating in mmap mode. * createMmapBuffer() must be called before calling start(). * Function only implemented by streams operating in mmap mode. * * @return retval OK in case the success. * NOT_SUPPORTED on non mmap mode streams * INVALID_STATE if called out of sequence */ start() generates (Result retval); /** * Called by the framework to stop a stream operating in mmap mode. * Function only implemented by streams operating in mmap mode. * * @return retval OK in case the succes. * NOT_SUPPORTED on non mmap mode streams * INVALID_STATE if called out of sequence */ stop() generates (Result retval) ; /* * Called by the framework to retrieve information on the mmap buffer used for audio * samples transfer. * Function only implemented by streams operating in mmap mode. * * @param minSizeFrames minimum buffer size requested. The actual buffer * size returned in struct MmapBufferInfo can be larger. * @return retval OK in case the success. * NOT_SUPPORTED on non mmap mode streams * NOT_INITIALIZED in case of memory allocation error * INVALID_ARGUMENTS if the requested buffer size is too large * INVALID_STATE if called out of sequence * @return info a MmapBufferInfo struct containing information on the MMMAP buffer created. */ createMmapBuffer(int32_t minSizeFrames) generates (Result retval, MmapBufferInfo info); /* * Called by the framework to read current read/write position in the mmap buffer * with associated time stamp. * Function only implemented by streams operating in mmap mode. * * @return retval OK in case the success. * NOT_SUPPORTED on non mmap mode streams * INVALID_STATE if called out of sequence * @return position a MmapPosition struct containing current HW read/write position in frames * with associated time stamp. */ getMmapPosition() generates (Result retval, MmapPosition position); };
audio/2.0/types.hal +19 −0 Original line number Diff line number Diff line Loading @@ -70,3 +70,22 @@ struct DeviceAddress { string busAddress; // used for BUS string rSubmixAddress; // used for REMOTE_SUBMIX }; /* * Mmap buffer descriptor returned by IStream.createMmapBuffer(). * Used by streams opened in mmap mode. */ struct MmapBufferInfo { memory sharedMemory; // mmap memory buffer int32_t bufferSizeFrames; // total buffer size in frames int32_t burstSizeFrames; // transfer size granularity in frames }; /* * Mmap buffer read/write position returned by IStream.getMmapPosition(). * Used by streams opened in mmap mode. */ struct MmapPosition { int64_t timeNanoseconds; // time stamp in ns, CLOCK_MONOTONIC int32_t positionFrames; // increasing 32 bit frame count reset when IStream.stop() is called };