summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/uapi/sound/firewire.h8
-rw-r--r--sound/firewire/motu/motu-command-dsp-message-parser.c7
2 files changed, 10 insertions, 5 deletions
diff --git a/include/uapi/sound/firewire.h b/include/uapi/sound/firewire.h
index 68eb0e43c052..39cf6eb75940 100644
--- a/include/uapi/sound/firewire.h
+++ b/include/uapi/sound/firewire.h
@@ -248,12 +248,14 @@ struct snd_firewire_motu_register_dsp_parameter {
*
* The structure expresses the part of DSP status for hardware meter. The 32 bit storage is
* estimated to include IEEE 764 32 bit single precision floating point (binary32) value. It is
- * expected to be linear value (not logarithm) for audio signal level between 0.0 and +1.0. However,
- * the last two quadlets (data[398] and data[399]) are filled with 0xffffffff since they are the
- * marker of one period.
+ * expected to be linear value (not logarithm) for audio signal level between 0.0 and +1.0.
*/
struct snd_firewire_motu_command_dsp_meter {
+#ifdef __KERNEL__
__u32 data[SNDRV_FIREWIRE_MOTU_COMMAND_DSP_METER_COUNT];
+#else
+ float data[SNDRV_FIREWIRE_MOTU_COMMAND_DSP_METER_COUNT];
+#endif
};
#endif /* _UAPI_SOUND_FIREWIRE_H_INCLUDED */
diff --git a/sound/firewire/motu/motu-command-dsp-message-parser.c b/sound/firewire/motu/motu-command-dsp-message-parser.c
index 18689fcfb288..9efe4d364baf 100644
--- a/sound/firewire/motu/motu-command-dsp-message-parser.c
+++ b/sound/firewire/motu/motu-command-dsp-message-parser.c
@@ -141,12 +141,15 @@ void snd_motu_command_dsp_message_parser_parse(struct snd_motu *motu, const stru
++parser->fragment_pos;
if (parser->fragment_pos == 4) {
+ // Skip the last two quadlets since they could be
+ // invalid value (0xffffffff) as floating point
+ // number.
if (parser->value_index <
- SNDRV_FIREWIRE_MOTU_COMMAND_DSP_METER_COUNT) {
+ SNDRV_FIREWIRE_MOTU_COMMAND_DSP_METER_COUNT - 2) {
u32 val = (u32)(parser->value >> 32);
parser->meter.data[parser->value_index] = val;
- ++parser->value_index;
}
+ ++parser->value_index;
parser->fragment_pos = 0;
}