summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2020-03-16 21:07:42 +0300
committerMark Brown <broonie@kernel.org>2020-03-16 21:07:42 +0300
commiteff4d9ecd05934ba95fca40952bd613d3e594d4e (patch)
tree3885933fd734896e0505d6f987d5c1fe03f23465 /include
parent308811a327c38364fff7752d3009160632f5dd5e (diff)
parent54ce83a3080c3d06b14faa7533a9adb4e158dcea (diff)
downloadlinux-eff4d9ecd05934ba95fca40952bd613d3e594d4e.tar.xz
Merge series "ALSA: compress: Add wma, alac and ape support" from Vinod Koul <vkoul@kernel.org>:
This series adds more WMA profiles and WMA decoder parameters to UAPI and then support for these in qcom driver. It also adds FLAC and APE IDs and decoder parameters to UAPI and then support in qcom driver This was tested on Dragon board RB3. Last, bump up the compressed version so that userspace can check for the support. Since the series touches compress uapi and asoc, it would make sense to go thru asoc tree with acks. Changes in v3: - add r-b from Srini - use macros for FLAC channel layout tags Changes in v2: - use bitflags for wma profiles Vinod Koul (9): ALSA: compress: add wma codec profiles ALSA: compress: Add wma decoder params ASoC: qcom: q6asm: pass codec profile to q6asm_open_write ASoC: qcom: q6asm: add support to wma config ASoC: qcom: q6asm-dai: add support to wma decoder ALSA: compress: add alac & ape decoder params ASoC: qcom: q6asm: add support for alac and ape configs ASoC: qcom: q6asm-dai: add support for ALAC and APE decoders ALSA: compress: bump the version include/uapi/sound/compress_offload.h | 2 +- include/uapi/sound/compress_params.h | 37 +++- sound/soc/qcom/qdsp6/q6asm-dai.c | 139 ++++++++++++++- sound/soc/qcom/qdsp6/q6asm.c | 243 +++++++++++++++++++++++++- sound/soc/qcom/qdsp6/q6asm.h | 51 +++++- 5 files changed, 465 insertions(+), 7 deletions(-) -- 2.24.1
Diffstat (limited to 'include')
-rw-r--r--include/uapi/sound/compress_offload.h2
-rw-r--r--include/uapi/sound/compress_params.h37
2 files changed, 37 insertions, 2 deletions
diff --git a/include/uapi/sound/compress_offload.h b/include/uapi/sound/compress_offload.h
index 56d95673ce0f..7184265c0b0d 100644
--- a/include/uapi/sound/compress_offload.h
+++ b/include/uapi/sound/compress_offload.h
@@ -31,7 +31,7 @@
#include <sound/compress_params.h>
-#define SNDRV_COMPRESS_VERSION SNDRV_PROTOCOL_VERSION(0, 1, 2)
+#define SNDRV_COMPRESS_VERSION SNDRV_PROTOCOL_VERSION(0, 2, 0)
/**
* struct snd_compressed_buffer - compressed buffer
* @fragment_size: size of buffer fragment in bytes
diff --git a/include/uapi/sound/compress_params.h b/include/uapi/sound/compress_params.h
index 9c96fb0e4d90..79b14389ae41 100644
--- a/include/uapi/sound/compress_params.h
+++ b/include/uapi/sound/compress_params.h
@@ -75,7 +75,9 @@
#define SND_AUDIOCODEC_G723_1 ((__u32) 0x0000000C)
#define SND_AUDIOCODEC_G729 ((__u32) 0x0000000D)
#define SND_AUDIOCODEC_BESPOKE ((__u32) 0x0000000E)
-#define SND_AUDIOCODEC_MAX SND_AUDIOCODEC_BESPOKE
+#define SND_AUDIOCODEC_ALAC ((__u32) 0x0000000F)
+#define SND_AUDIOCODEC_APE ((__u32) 0x00000010)
+#define SND_AUDIOCODEC_MAX SND_AUDIOCODEC_APE
/*
* Profile and modes are listed with bit masks. This allows for a
@@ -142,6 +144,9 @@
#define SND_AUDIOPROFILE_WMA8 ((__u32) 0x00000002)
#define SND_AUDIOPROFILE_WMA9 ((__u32) 0x00000004)
#define SND_AUDIOPROFILE_WMA10 ((__u32) 0x00000008)
+#define SND_AUDIOPROFILE_WMA9_PRO ((__u32) 0x00000010)
+#define SND_AUDIOPROFILE_WMA9_LOSSLESS ((__u32) 0x00000020)
+#define SND_AUDIOPROFILE_WMA10_LOSSLESS ((__u32) 0x00000040)
#define SND_AUDIOMODE_WMA_LEVEL1 ((__u32) 0x00000001)
#define SND_AUDIOMODE_WMA_LEVEL2 ((__u32) 0x00000002)
@@ -326,6 +331,33 @@ struct snd_dec_flac {
__u16 reserved;
} __attribute__((packed, aligned(4)));
+struct snd_dec_wma {
+ __u32 encoder_option;
+ __u32 adv_encoder_option;
+ __u32 adv_encoder_option2;
+ __u32 reserved;
+} __attribute__((packed, aligned(4)));
+
+struct snd_dec_alac {
+ __u32 frame_length;
+ __u8 compatible_version;
+ __u8 pb;
+ __u8 mb;
+ __u8 kb;
+ __u32 max_run;
+ __u32 max_frame_bytes;
+} __attribute__((packed, aligned(4)));
+
+struct snd_dec_ape {
+ __u16 compatible_version;
+ __u16 compression_level;
+ __u32 format_flags;
+ __u32 blocks_per_frame;
+ __u32 final_frame_blocks;
+ __u32 total_frames;
+ __u32 seek_table_present;
+} __attribute__((packed, aligned(4)));
+
union snd_codec_options {
struct snd_enc_wma wma;
struct snd_enc_vorbis vorbis;
@@ -333,6 +365,9 @@ union snd_codec_options {
struct snd_enc_flac flac;
struct snd_enc_generic generic;
struct snd_dec_flac flac_d;
+ struct snd_dec_wma wma_d;
+ struct snd_dec_alac alac_d;
+ struct snd_dec_ape ape_d;
} __attribute__((packed, aligned(4)));
/** struct snd_codec_desc - description of codec capabilities