From 54f6e3268c2c1f383b7f496241b4b9002befd69e Mon Sep 17 00:00:00 2001 From: mocchi Date: Tue, 6 May 2014 04:17:05 +0000 Subject: [PATCH] fireworks: Improve a workaround for AudioFire12 with recent firmwares Firmware version 5.0 or later for AudioFire12 has quirks. One of the quirks is to return invalid values in content of response against command of polled values. Acording to ticket #360, this causes assertion which prevents from buffer-over-run: http://subversion.ffado.org/ticket/360 Revision 2451 removes this assertion and adds a prevention of buffer-over-run. http://subversion.ffado.org/changeset/2451 But this is not enough as a workaround because it returns false. This commit allows to continue process after compensating these values. git-svn-id: svn+ssh://ffado.org/ffado/trunk@2514 2be59082-3212-0410-8809-b0798e1608f0 --- libffado/src/fireworks/efc/efc_cmds_hardware.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/libffado/src/fireworks/efc/efc_cmds_hardware.cpp b/libffado/src/fireworks/efc/efc_cmds_hardware.cpp index 2e4d460e..74859eb4 100644 --- a/libffado/src/fireworks/efc/efc_cmds_hardware.cpp +++ b/libffado/src/fireworks/efc/efc_cmds_hardware.cpp @@ -213,14 +213,19 @@ EfcPolledValuesCmd::deserialize( Util::Cmd::IISDeserialize& de ) if (!result) return result; + /* + * NOTE: + * Firmware version 5.0 or later for AudioFire12 returns invalid values to + * contents of response against this command. Currently apply a workaround + * to compensate the value because this value is not re-used again. + */ nb_meters = m_nb_output_meters + m_nb_input_meters; if (nb_meters > POLLED_MAX_NB_METERS) { m_nb_output_meters = 0; m_nb_input_meters = 0; - return false; + nb_meters = 0; } - result = true; for (i = 0; i < nb_meters; i++) EFC_DESERIALIZE_AND_SWAP(de, (uint32_t *)&m_meters[i], result); -- 2.11.4.GIT