Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3ce2258c authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge changes...

Merge changes Iacfc18af,Id8a0b8c3,I0b31a4ba,Ib1b9100a,I4b6b37c0,Iac8c3a3d,I68d40daa,I301c3fac,I1c46befc,Ifb06674c,I22b7cf38,Ie4dfa630,If3915565,Ibd4a9b24,I92d0f301 into msm-next

* changes:
  ASoc: msm: qdspv2: Clock recovery support in compress driver
  ASoC: msm: qdsp6v2: Add TrueHD HDMI compress pass-though
  ASoC: msm: qdsp6v2: Support to set session start delay
  ASoC: msm: qdsp6v2: Support to configure render window
  ASoC: msm: qdsp6v2: Support to configure clk recovery mode
  ASoC: msm: qdsp6v2: Support to configure render mode
  ASoC: msm: qdsp6v2: Get path delay support in compress path
  ALSA: compress: Add APTX format support in ALSA
  msm: qdsp6v2: Add timestamp support for compress capture
  ALSA: compress: Add DSD format support for ALSA
  ASoC: msm: qdsp6v2: add support for ALAC and APE offload
  ASoC: msm: fix integer overflow for long duration offload playback
  ASoC: msm-compr: Fix possible array out of bounds
  ASoC: msm: qdsp6v2: Handles additional flac metadata
  ASoC: msm: Add compressed TX and passthrough support
parents f615092c 8566d57b
Loading
Loading
Loading
Loading
+44 −1
Original line number Diff line number Diff line
@@ -68,7 +68,7 @@ struct snd_compr_params {
 */
struct snd_compr_tstamp {
	__u32 byte_offset;
	__u32 copied_total;
	__u64 copied_total;
	__u32 pcm_frames;
	__u32 pcm_io_frames;
	__u32 sampling_rate;
@@ -124,18 +124,61 @@ struct snd_compr_codec_caps {
	struct snd_codec_desc descriptor[MAX_NUM_CODEC_DESCRIPTORS];
} __attribute__((packed, aligned(4)));

/**
 * struct snd_compr_audio_info: compressed input audio information
 * @frame_size: legth of the encoded frame with valid data
 * @reserved: reserved for furture use
 */
struct snd_compr_audio_info {
	__u32 frame_size;
	__u32 reserved[15];
} __attribute__((packed, aligned(4)));

#define SNDRV_COMPRESS_RENDER_MODE_AUDIO_MASTER 0
#define SNDRV_COMPRESS_RENDER_MODE_STC_MASTER 1

#define SNDRV_COMPRESS_CLK_REC_MODE_NONE 0
#define SNDRV_COMPRESS_CLK_REC_MODE_AUTO 1

/**
 * enum sndrv_compress_encoder
 * @SNDRV_COMPRESS_ENCODER_PADDING: no of samples appended by the encoder at the
 * end of the track
 * @SNDRV_COMPRESS_ENCODER_DELAY: no of samples inserted by the encoder at the
 * beginning of the track
 * @SNDRV_COMPRESS_PATH_DELAY: dsp path delay in microseconds
 * @SNDRV_COMPRESS_RENDER_MODE: dsp render mode (audio master or stc)
 * @SNDRV_COMPRESS_CLK_REC_MODE: clock recovery mode ( none or auto)
 * @SNDRV_COMPRESS_RENDER_WINDOW: render window
 * @SNDRV_COMPRESS_START_DELAY: start delay
 * @SNDRV_COMPRESS_ENABLE_ADJUST_SESSION_CLOCK: enable dsp drift correction
 * @SNDRV_COMPRESS_ADJUST_SESSION_CLOCK: set drift correction value
 */
enum sndrv_compress_encoder {
	SNDRV_COMPRESS_ENCODER_PADDING = 1,
	SNDRV_COMPRESS_ENCODER_DELAY = 2,
	SNDRV_COMPRESS_MIN_BLK_SIZE = 3,
	SNDRV_COMPRESS_MAX_BLK_SIZE = 4,
	SNDRV_COMPRESS_PATH_DELAY = 5,
	SNDRV_COMPRESS_RENDER_MODE = 6,
	SNDRV_COMPRESS_CLK_REC_MODE = 7,
	SNDRV_COMPRESS_RENDER_WINDOW = 8,
	SNDRV_COMPRESS_START_DELAY = 9,
	SNDRV_COMPRESS_ENABLE_ADJUST_SESSION_CLOCK = 10,
	SNDRV_COMPRESS_ADJUST_SESSION_CLOCK = 11,
};

#define SNDRV_COMPRESS_MIN_BLK_SIZE SNDRV_COMPRESS_MIN_BLK_SIZE
#define SNDRV_COMPRESS_MAX_BLK_SIZE SNDRV_COMPRESS_MAX_BLK_SIZE
#define SNDRV_COMPRESS_PATH_DELAY SNDRV_COMPRESS_PATH_DELAY
#define SNDRV_COMPRESS_RENDER_MODE SNDRV_COMPRESS_RENDER_MODE
#define SNDRV_COMPRESS_CLK_REC_MODE SNDRV_COMPRESS_CLK_REC_MODE
#define SNDRV_COMPRESS_RENDER_WINDOW SNDRV_COMPRESS_RENDER_WINDOW
#define SNDRV_COMPRESS_START_DELAY SNDRV_COMPRESS_START_DELAY
#define SNDRV_COMPRESS_ENABLE_ADJUST_SESSION_CLOCK \
		SNDRV_COMPRESS_ENABLE_ADJUST_SESSION_CLOCK
#define SNDRV_COMPRESS_ADJUST_SESSION_CLOCK SNDRV_COMPRESS_ADJUST_SESSION_CLOCK

/**
 * struct snd_compr_metadata - compressed stream metadata
 * @key: key id
+78 −5
Original line number Diff line number Diff line
@@ -54,6 +54,8 @@

#include <linux/types.h>

#define SND_DEC_DDP_MAX_PARAMS 18

/* AUDIO CODECS SUPPORTED */
#define MAX_NUM_CODECS 32
#define MAX_NUM_CODEC_DESCRIPTORS 32
@@ -69,6 +71,11 @@
#define Q6_DTS		0x00010D88
#define Q6_DTS_LBR	0x00010DBB

/* Timestamp flsg */
/* Bit-0 - 1 : Enable Timestamp mode */
/* Bit-0 - 0 : Disable Timestamp mode */
#define COMPRESSED_TIMESTAMP_FLAG 0x0001

/* Codecs are listed linearly to allow for extensibility */
#define SND_AUDIOCODEC_PCM                   ((__u32) 0x00000001)
#define SND_AUDIOCODEC_MP3                   ((__u32) 0x00000002)
@@ -95,7 +102,12 @@
#define SND_AUDIOCODEC_WMA_PRO               ((__u32) 0x00000017)
#define SND_AUDIOCODEC_DTS                   ((__u32) 0x00000018)
#define SND_AUDIOCODEC_EAC3                  ((__u32) 0x00000019)
#define SND_AUDIOCODEC_MAX                   SND_AUDIOCODEC_EAC3
#define SND_AUDIOCODEC_ALAC                  ((__u32) 0x00000020)
#define SND_AUDIOCODEC_APE                   ((__u32) 0x00000021)
#define SND_AUDIOCODEC_DSD                   ((__u32) 0x00000022)
#define SND_AUDIOCODEC_APTX                  ((__u32) 0x00000023)
#define SND_AUDIOCODEC_TRUEHD                ((__u32) 0x00000024)
#define SND_AUDIOCODEC_MAX                   SND_AUDIOCODEC_TRUEHD

/*
 * Profile and modes are listed with bit masks. This allows for a
@@ -345,8 +357,8 @@ struct snd_enc_generic {

struct snd_dec_ddp {
	__u32 params_length;
	__u32 params_id[18];
	__u32 params_value[18];
	__u32 params_id[SND_DEC_DDP_MAX_PARAMS];
	__u32 params_value[SND_DEC_DDP_MAX_PARAMS];
} __attribute__((packed, aligned(4)));

struct snd_dec_flac {
@@ -357,6 +369,44 @@ struct snd_dec_flac {
	__u16 max_frame_size;
} __attribute__((packed, aligned(4)));

struct snd_dec_vorbis {
	__u32 bit_stream_fmt;
};

struct snd_dec_alac {
	__u32 frame_length;
	__u8 compatible_version;
	__u8 bit_depth;
	__u8 pb;
	__u8 mb;
	__u8 kb;
	__u8 num_channels;
	__u16 max_run;
	__u32 max_frame_bytes;
	__u32 avg_bit_rate;
	__u32 sample_rate;
	__u32 channel_layout_tag;
};

struct snd_dec_ape {
	__u16 compatible_version;
	__u16 compression_level;
	__u32 format_flags;
	__u32 blocks_per_frame;
	__u32 final_frame_blocks;
	__u32 total_frames;
	__u16 bits_per_sample;
	__u16 num_channels;
	__u32 sample_rate;
	__u32 seek_table_present;
};

struct snd_dec_aptx {
	__u32 lap;
	__u32 uap;
	__u32 nap;
};

union snd_codec_options {
	struct snd_enc_wma wma;
	struct snd_enc_vorbis vorbis;
@@ -365,7 +415,11 @@ union snd_codec_options {
	struct snd_enc_generic generic;
	struct snd_dec_ddp ddp;
	struct snd_dec_flac flac_dec;
} __attribute__((packed, aligned(4)));
	struct snd_dec_vorbis vorbis_dec;
	struct snd_dec_alac alac;
	struct snd_dec_ape ape;
	struct snd_dec_aptx aptx_dec;
};

/** struct snd_codec_desc - description of codec capabilities
 * @max_ch: Maximum number of audio channels
@@ -426,6 +480,7 @@ struct snd_codec_desc {
 * @align: Block alignment in bytes of an audio sample.
 *		Only required for PCM or IEC formats.
 * @options: encoder-specific settings
 * @compr_passthr: compressed bitstream passthrough
 * @reserved: reserved for future use
 */

@@ -442,7 +497,25 @@ struct snd_codec {
	__u32 format;
	__u32 align;
	union snd_codec_options options;
	__u32 reserved[3];
	__u32 compr_passthr;
	__u32 flags;
	__u32 reserved[1];
} __attribute__((packed, aligned(4)));


/** struct snd_codec_metadata
 * @length: Length of the encoded buffer.
 * @offset: Offset from the buffer address to the first byte of the first
 *		encoded frame. All encoded frames are consecutive starting
 *		from this offset.
 * @timestamp: Session time in microseconds of the first sample in the buffer.
 * @reserved: Reserved for future use.
 */
struct snd_codec_metadata {
	__u32 length;
	__u32 offset;
	__u64 timestamp;
	__u32 reserved[4];
};

#endif
+1 −1
Original line number Diff line number Diff line
@@ -186,7 +186,7 @@ static int snd_compr_update_tstamp(struct snd_compr_stream *stream,
	err = stream->ops->pointer(stream, tstamp);
	if (err)
		return err;
	pr_debug("dsp consumed till %d total %d bytes\n",
	pr_debug("dsp consumed till %d total %llu bytes\n",
		tstamp->byte_offset, tstamp->copied_total);
	if (stream->direction == SND_COMPRESS_PLAYBACK)
		stream->runtime->total_bytes_transferred = tstamp->copied_total;