[PATCH 06/11] ALSA: firewire-motu: parse messages for output parameters in register DSP model

Takashi Sakamoto o-takashi at sakamocchi.jp
Fri Oct 15 10:08:21 CEST 2021


This commit parses message and cache current parameters of output
function, commonly available for all of register DSP model.

Signed-off-by: Takashi Sakamoto <o-takashi at sakamocchi.jp>
---
 include/uapi/sound/firewire.h                         | 10 ++++++++++
 .../firewire/motu/motu-register-dsp-message-parser.c  | 11 ++++++++++-
 2 files changed, 20 insertions(+), 1 deletion(-)

diff --git a/include/uapi/sound/firewire.h b/include/uapi/sound/firewire.h
index f663a26c5205..16ca7b43568b 100644
--- a/include/uapi/sound/firewire.h
+++ b/include/uapi/sound/firewire.h
@@ -160,6 +160,10 @@ struct snd_firewire_motu_register_dsp_meter {
  *			       Audio Express.
  * @mixer.output.paired_volume: The volume of paired output from mixer.
  * @mixer.output.paired_flag: The flag of paired output from mixer.
+ * @output.main_paired_volume: The volume of paired main output.
+ * @output.hp_paired_volume: The volume of paired hp output.
+ * @output.hp_paired_assignment: The source assigned to paired hp output.
+ * @output.reserved: Padding for 32 bit alignment for future extension.
  *
  * The structure expresses the set of parameters for DSP controlled by register access.
  */
@@ -177,6 +181,12 @@ struct snd_firewire_motu_register_dsp_parameter {
 			__u8 paired_flag[SNDRV_FIREWIRE_MOTU_REGISTER_DSP_MIXER_COUNT];
 		} output;
 	} mixer;
+	struct {
+		__u8 main_paired_volume;
+		__u8 hp_paired_volume;
+		__u8 hp_paired_assignment;
+		__u8 reserved[5];
+	} output;
 };
 
 // In below MOTU models, software is allowed to control their DSP by command in frame of
diff --git a/sound/firewire/motu/motu-register-dsp-message-parser.c b/sound/firewire/motu/motu-register-dsp-message-parser.c
index 867cb09a3521..244f7ada851f 100644
--- a/sound/firewire/motu/motu-register-dsp-message-parser.c
+++ b/sound/firewire/motu/motu-register-dsp-message-parser.c
@@ -54,7 +54,7 @@ enum register_dsp_msg_type {
 	MIXER_OUTPUT_PAIRED_FLAG = 0x06,
 	MAIN_OUTPUT_PAIRED_VOLUME = 0x07,
 	HP_OUTPUT_PAIRED_VOLUME = 0x08,
-	HP_OUTPUT_ASSIGN = 0x09,
+	HP_OUTPUT_PAIRED_ASSIGNMENT = 0x09,
 	// Transferred by all models but the purpose is still unknown.
 	UNKNOWN_0 = 0x0a,
 	// Specific to 828mk2, 896hd, Traveler.
@@ -210,6 +210,15 @@ void snd_motu_register_dsp_message_parser_parse(struct snd_motu *motu, const str
 				}
 				break;
 			}
+			case MAIN_OUTPUT_PAIRED_VOLUME:
+				parser->param.output.main_paired_volume = val;
+				break;
+			case HP_OUTPUT_PAIRED_VOLUME:
+				parser->param.output.hp_paired_volume = val;
+				break;
+			case HP_OUTPUT_PAIRED_ASSIGNMENT:
+				parser->param.output.hp_paired_assignment = val;
+				break;
 			case METER:
 			{
 				u8 pos;
-- 
2.30.2



More information about the Alsa-devel mailing list