Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sink / source API #7622

Merged
merged 10 commits into from
Jun 19, 2023
Merged

Commits on Jun 16, 2023

  1. buffer: don't access stream internals

    add more functions to audio_stream internals
    
    Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
    marcinszkudlinski committed Jun 16, 2023
    Configuration menu
    Copy the full SHA
    e153d75 View commit details
    Browse the repository at this point in the history
  2. stream: move all stream runtime parameters to a structure

    All stream parameters are now available as a single
    structure
    
    Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
    marcinszkudlinski committed Jun 16, 2023
    Configuration menu
    Copy the full SHA
    d92202b View commit details
    Browse the repository at this point in the history
  3. buffer: external modules use API to access buffer_fmt

    As no internals of audio_stream nor comp_buffer should be
    accessible directly, move all calls to buffer_fmt to API
    In addition, to let sink/source interface working,
    move the parameter to audio_stream structure
    
    Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
    marcinszkudlinski committed Jun 16, 2023
    Configuration menu
    Copy the full SHA
    b6a10bb View commit details
    Browse the repository at this point in the history

Commits on Jun 19, 2023

  1. pipeline2.0: introduce a source API

    this is a definition of API to source of audio data
    
    THE SOURCE is any component in the system that have data
    stored somehow and can give the data outside at request.
    The source API does not define who and how has produced
    the data
      The user - a module - sees this as a producer that
                 PROVIDES data for processing
      The IMPLEMENTATION - audio_stream, DP Queue - sees
                 this API as a destination it must send data to
    
    Examples of components that should expose source API:
      - DMIC. Data are coming from the outside world,
              stores in tmp buffer and can be presented
    	  to the rest of the system using source_api
      - a memory ring buffer
    	Data are coming from other module
            (usually using sink_api, but it does not matter in fact)
    
    Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
    marcinszkudlinski committed Jun 19, 2023
    Configuration menu
    Copy the full SHA
    d93b0a4 View commit details
    Browse the repository at this point in the history
  2. pipeline2.0: introduce a sink API

    this is a definition of API to sink of audio data
    
    THE SINK is any component that can store data somehow
    and provide a buffer to be filled with data at request.
    The sink API does not define how the data will be processed/used
    
     The user - a module - sees this API as a destination
                it must send data to
     The IMPLEMENTATION - audio_stream, DP Queue -
                sees this as a producer that PROVIDES data for processing
    
    Examples of components that should expose SINK api
     - /dev/null
         all the data stored in sink buffer are just simply discarded
     - I2S sender
         Data stored in sink buffer will be sent to the external world
     - a memory ring buffer
         data stored in the buffer will be sent to another module
         (usually using source API, but it does not matter in fact).
    
    Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
    marcinszkudlinski committed Jun 19, 2023
    Configuration menu
    Copy the full SHA
    b11045c View commit details
    Browse the repository at this point in the history
  3. pipeline2.0: introduce sink/source utilities

    There are many operations on sink/source that may be put into a
    common library. This is the place for it.
    
    Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
    marcinszkudlinski committed Jun 19, 2023
    Configuration menu
    Copy the full SHA
    8e4ec75 View commit details
    Browse the repository at this point in the history
  4. pipeline2.0: add source/sink api to audio_stream

    Make audio_stream capable of using pipeline2.0
    sink and source API
    This change makes integration of sink/src api
    possible in incremental way
    
    Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
    marcinszkudlinski committed Jun 19, 2023
    Configuration menu
    Copy the full SHA
    0c025db View commit details
    Browse the repository at this point in the history
  5. Pipeline2.0: change module API to use various data

    Target is to make all modules use sink/source API as
    data source and destination.
    However, current implementation of module adapter
    allows 2 other completely different interfaces to be used:
    
    "simple_copy"
      modules receive output_stream_buffer and
      input_stream_buffer table. void * data pointers
      from both structures point to audio_stream
      other fields in the structures are in fact not needed
      but are used
    
    "! simple_copy"
      modules receive output_stream_buffer and
      input_stream_buffer table. void * data pointers
      from both structures point to raw linear data
    
    to make transition smooth and easy, both
    legacy ways have been kept, just to make the code
    more clear - put at separate module API calls,
    
    Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
    marcinszkudlinski committed Jun 19, 2023
    Configuration menu
    Copy the full SHA
    88af408 View commit details
    Browse the repository at this point in the history
  6. pipeline2.0: change module prepare API to use sink/src.c

    Module prepare is an operation that needs to set up sink
    and source according to needs.
    Therefore it must have access to sink/source handlers
    This commit adds handlers to API. In case the module uses
    legacy audio stream sink/source pointers will be NULLs
    and number of sinks/sources will be zero
    
    Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
    marcinszkudlinski committed Jun 19, 2023
    Configuration menu
    Copy the full SHA
    5fdf11e View commit details
    Browse the repository at this point in the history
  7. src: POC - change src module to use sink/source API

    This is a porting of SRC module to use sink/src API
    To have src fully ported there's a need to get 100%
    independent of audio_stream and buffer.c
    This step is necessary because other implementations of
    sink/src, like DP Queue, may not be based on buffer
    implementation
    
    Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
    marcinszkudlinski committed Jun 19, 2023
    Configuration menu
    Copy the full SHA
    b900d5e View commit details
    Browse the repository at this point in the history