Skip to content

Add compress interface to SOF - #2703

Closed
dbaluta wants to merge 1 commit into
thesofproject:topic/sof-devfrom
dbaluta:sof-dev
Closed

Add compress interface to SOF#2703
dbaluta wants to merge 1 commit into
thesofproject:topic/sof-devfrom
dbaluta:sof-dev

Conversation

@dbaluta

@dbaluta dbaluta commented Jan 19, 2021

Copy link
Copy Markdown
Collaborator

This will allow playback of compressed files using SOF. This is still work in progress but I wanted to send the patches for early review to understand if I'm following a correct direction.

First 4 patches can be separately be merged and they are needed to make space for introducing the compress interface. There are a lot of similarities between compr and PCM and will try to make a common abstraction when possible.

With current patches I'm able to use compress interface to play PCM samples using dummy codec from SOF.

cplay -v -c 3 -d 0 -I PCM -b 65536 -f 2 sample.wav

First step in trying to unify PCM / compr handling is adding snd_compr_stream filed to snd_sof_pcm_stream:

--- a/sound/soc/sof/sof-audio.h
+++ b/sound/soc/sof/sof-audio.h
@@ -34,6 +34,7 @@ struct snd_sof_pcm_stream {
        struct snd_pcm_substream *substream;
+       struct snd_compr_stream *cstream;

Next is having a common snd_sof_period_elapsed function for both PCM / compr.

Looking at snd_compress_ops and sof_pcm* there are some common part (with particular stress on sof_pcm_hw_params and sof_compr_set_params but I preferred for now to keep the changes separate (even if there is some duplicate code).

Please have a look and let me know what you think at first glance. More patches will come in the next days as I'm trying to support a real codec.

Cc: @paulstelian97 @iuliana-prodan @TE-N-ShengjiuWang

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants