include/sound/soc-dpcm.h 참고

 

enum 정리

snd_soc_dpcm_update : 실행할 runtime_update 값. 업데이트를 안할 것인지, BE 혹인 FE 를 업데이트할 것인지 나타냄
 - SND_SOC_DPCM_UPDATE_NO
 - SND_SOC_DPCM_UPDATE_BE
 - SND_SOC_DPCM_UPDATE_FE

snd_soc_dpcm_link_state : 새로운 링크를 만들 것인지, 만들어진 링크를 분해할 것인지 나타냄
 - SND_SOC_DPCM_LINK_STATE_NEW
 - SND_SOC_DPCM_LINK_STATE_FREE

snd_soc_dpcm_state : PCM 프론트엔트에서 PCM 백엔드의 상태를 나타냄
 - SND_SOC_DPCM_STATE_NEW
 - SND_SOC_DPCM_STATE_OPEN
 - SND_SOC_DPCM_STATE_HW_PARAMS
 - SND_SOC_DPCM_STATE_PREPARE
 - SND_SOC_DPCM_STATE_START
 - SND_SOC_DPCM_STATE_STOP
 - SND_SOC_DPCM_STATE_PAUSED
 - SND_SOC_DPCM_STATE_SUSPEND
 - SND_SOC_DPCM_STATE_HW_FREE
 - SND_SOC_DPCM_STATE_CLOSE

snd_soc_dpcm_trigger : trigger 가 발생했을 때 어떤 trigger 가 발생했는지 나타냄
 - SND_SOC_DPCM_TRIGGER_PRE
 - SND_SOC_DPCM_TRIGGER_HOST
 - SND_SOC_DPCM_TRIGGER_BESPOKE

 

Dynamic PCM link 구조체

이 구조체는 FE DAI 와 BE DAI 를 runtime 에 연결하고, link 상태와 hw_params 정보를 저장한다.

struct snd_soc_dpcm {
        /* FE and BE DAIs*/
        struct snd_soc_pcm_runtime *be;
        struct snd_soc_pcm_runtime *fe;

        /* link state */
        enum snd_soc_dpcm_link_state state;

        /* list of BE and FE for this DPCM link */
        struct list_head list_be;
        struct list_head list_fe;

        /* hw params for this link - may be different for each link */
        struct snd_pcm_hw_params hw_params;
#ifdef CONFIG_DEBUG_FS
        struct dentry *debugfs_state;
#endif
};
struct snd_soc_dpcm_runtime {
        struct list_head be_clients;
        struct list_head fe_clients;

        int users;
        struct snd_pcm_runtime *runtime;
        struct snd_pcm_hw_params hw_params;

        /* state and update */
        enum snd_soc_dpcm_update runtime_update;
        enum snd_soc_dpcm_state state;

        int trigger_pending; /* trigger cmd + 1 if pending, 0 if not */
};

 

궁금증 .. dpcm API 들도 snd_soc_pcm_runtime 을 쓰는데, snd_soc_dpcm_runtime 은 언제 쓰이는지...? 

 -> 쫓아가봤는데 쓰이질 않음..

 

DPCM APIs

/* can this BE stop and free */
int snd_soc_dpcm_can_be_free_stop(struct snd_soc_pcm_runtime *fe,
                struct snd_soc_pcm_runtime *be, int stream);

/* can this BE perform a hw_params() */
int snd_soc_dpcm_can_be_params(struct snd_soc_pcm_runtime *fe,
                struct snd_soc_pcm_runtime *be, int stream);

/* is the current PCM operation for this FE ? */
int snd_soc_dpcm_fe_can_update(struct snd_soc_pcm_runtime *fe, int stream);

/* is the current PCM operation for this BE ? */
int snd_soc_dpcm_be_can_update(struct snd_soc_pcm_runtime *fe,
                struct snd_soc_pcm_runtime *be, int stream);

/* get the substream for this BE */
struct snd_pcm_substream *
        snd_soc_dpcm_get_substream(struct snd_soc_pcm_runtime *be, int stream);

/* get the BE runtime state */
enum snd_soc_dpcm_state
        snd_soc_dpcm_be_get_state(struct snd_soc_pcm_runtime *be, int stream);

/* set the BE runtime state */
void snd_soc_dpcm_be_set_state(struct snd_soc_pcm_runtime *be, int stream,
        enum snd_soc_dpcm_state state);

+ Recent posts