linux_dsm_epyc7002/sound/pci/echoaudio
Takashi Sakamoto 51db452df0 Revert "ALSA: echoaudio: purge contradictions between dimension matrix members and total number of members"
This reverts commit 275353bb68 to fix a regression which can abort
'alsactl' program in alsa-utils due to assertion in alsa-lib.

alsactl: control.c:2513: snd_ctl_elem_value_get_integer: Assertion `idx < sizeof(obj->value.integer.value) / sizeof(obj->value.integer.value[0])' failed.

alsactl: control.c:2976: snd_ctl_elem_value_get_integer: Assertion `idx < ARRAY_SIZE(obj->value.integer.value)' failed.

This commit is a band-aid. In a point of usage of ALSA control interface,
the drivers still bring an issue that they prevent userspace applications
to have a consistent way to parse each levels of the dimension information
via ALSA control interface.

Let me investigate this issue. Current implementation of the drivers
have three control element sets with dimension information:
 * 'Monitor Mixer Volume' (type: integer)
 * 'VMixer Volume' (type: integer)
 * 'VU-meters' (type: boolean)

Although the number of elements named as 'Monitor Mixer Volume' differs
depending on drivers in this group, it can be calculated by macros
defined by each driver (= (BX_NUM - BX_ANALOG_IN) * BX_ANALOG_IN). Each
of the elements has one member for value and has dimension information
with 2 levels (= BX_ANALOG_IN * (BX_NUM - BX_ANALOG_IN)). For these
elements, userspace applications are expected to handle the dimension
information so that all of the elements construct a matrix where the
number of rows and columns are represented by the dimension information.

The same way is applied to elements named as 'VMixer Volume'. The number
of these elements can also be calculated by macros defined by each
drivers (= PX_ANALOG_IN * BX_ANALOG_IN). Each of the element has one
member for value and has dimension information with 2 levels
(= BX_ANALOG_IN * PX_ANALOG_IN). All of the elements construct a matrix
with the dimension information.

An element named as 'VU-meters' gets a different way in a point of
dimension information. The element includes 96 members for value. The
element has dimension information with 3 levels (= 3 or 2 * 16 * 2). For
this element, userspace applications are expected to handle the dimension
information so that all of the members for value construct a matrix
where the number of rows and columns are represented by the dimension
information. This is different from the way for the former.

As a summary, the drivers were not designed to produce a consistent way to
parse the dimension information. This makes it hard for general userspace
applications such as amixer to parse the information by a consistent way,
and actually no userspace applications except for 'echomixer' utilize the
dimension information. Additionally, no drivers excluding this group use
the information.

The reverted commit was written based on the latter way. A commit
860c1994a7 ('ALSA: control: add dimension validator for userspace
elements') is written based on the latter way, too. The patch should be
reconsider too in the same time to re-define a consistent way to parse the
dimension information.

Reported-by: Mark Hills <mark@xwax.org>
Reported-by: S. Christian Collins <s.chriscollins@gmail.com>
Fixes: 275353bb68 ('ALSA: echoaudio: purge contradictions between dimension matrix members and total number of members')
Cc: <stable@vger.kernel.org> # v4.8+
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-10-02 14:30:43 +02:00
..
darla20_dsp.c ALSA: echoaudio: Use standard C definitions of true and false 2015-08-10 14:27:16 +02:00
darla20.c ALSA: Include linux/io.h instead of asm/io.h 2015-01-28 16:49:33 +01:00
darla24_dsp.c ALSA: echoaudio: Use standard C definitions of true and false 2015-08-10 14:27:16 +02:00
darla24.c ALSA: Include linux/io.h instead of asm/io.h 2015-01-28 16:49:33 +01:00
echo3g_dsp.c ALSA: echoaudio: Use standard C definitions of true and false 2015-08-10 14:27:16 +02:00
echo3g.c ALSA: Include linux/io.h instead of asm/io.h 2015-01-28 16:49:33 +01:00
echoaudio_3g.c ALSA: echoaudio: Use standard C definitions of true and false 2015-08-10 14:27:16 +02:00
echoaudio_dsp.c ALSA: echoaudio: Use standard C definitions of true and false 2015-08-10 14:27:16 +02:00
echoaudio_dsp.h ALSA: Echoaudio: add support for Indigo express cards 2009-03-19 08:17:57 +01:00
echoaudio_gml.c ALSA: echoaudio: Use standard C definitions of true and false 2015-08-10 14:27:16 +02:00
echoaudio.c Revert "ALSA: echoaudio: purge contradictions between dimension matrix members and total number of members" 2017-10-02 14:30:43 +02:00
echoaudio.h ALSA: echoaudio: Use standard C definitions of true and false 2015-08-10 14:27:16 +02:00
gina20_dsp.c ALSA: echoaudio: Use standard C definitions of true and false 2015-08-10 14:27:16 +02:00
gina20.c ALSA: echoaudio: Use standard C definitions of true and false 2015-08-10 14:27:16 +02:00
gina24_dsp.c ALSA: echoaudio: Use standard C definitions of true and false 2015-08-10 14:27:16 +02:00
gina24.c ALSA: Include linux/io.h instead of asm/io.h 2015-01-28 16:49:33 +01:00
indigo_dsp.c ALSA: echoaudio: Use standard C definitions of true and false 2015-08-10 14:27:16 +02:00
indigo_express_dsp.c ALSA: echoaudio: remove all snd_printk 2014-11-03 14:07:25 +01:00
indigo.c ALSA: Include linux/io.h instead of asm/io.h 2015-01-28 16:49:33 +01:00
indigodj_dsp.c ALSA: echoaudio: Use standard C definitions of true and false 2015-08-10 14:27:16 +02:00
indigodj.c ALSA: Include linux/io.h instead of asm/io.h 2015-01-28 16:49:33 +01:00
indigodjx_dsp.c ALSA: echoaudio: Use standard C definitions of true and false 2015-08-10 14:27:16 +02:00
indigodjx.c PCI: Remove DEFINE_PCI_DEVICE_TABLE macro use 2014-08-12 12:15:14 -06:00
indigoio_dsp.c ALSA: echoaudio: Use standard C definitions of true and false 2015-08-10 14:27:16 +02:00
indigoio.c ALSA: Include linux/io.h instead of asm/io.h 2015-01-28 16:49:33 +01:00
indigoiox_dsp.c ALSA: echoaudio: Use standard C definitions of true and false 2015-08-10 14:27:16 +02:00
indigoiox.c PCI: Remove DEFINE_PCI_DEVICE_TABLE macro use 2014-08-12 12:15:14 -06:00
layla20_dsp.c ALSA: echoaudio: Use standard C definitions of true and false 2015-08-10 14:27:16 +02:00
layla20.c ALSA: echoaudio: Use standard C definitions of true and false 2015-08-10 14:27:16 +02:00
layla24_dsp.c ALSA: echoaudio: Fix improper return value in function load_asic 2016-11-29 19:59:57 +01:00
layla24.c ALSA: Include linux/io.h instead of asm/io.h 2015-01-28 16:49:33 +01:00
Makefile ALSA: Echoaudio: add support for Indigo express cards 2009-03-19 08:17:57 +01:00
mia_dsp.c ALSA: echoaudio: Use standard C definitions of true and false 2015-08-10 14:27:16 +02:00
mia.c ALSA: echoaudio: Use standard C definitions of true and false 2015-08-10 14:27:16 +02:00
midi.c ALSA: pci: Constify snd_rawmidi_ops 2017-01-12 12:50:26 +01:00
mona_dsp.c ALSA: echoaudio: Use standard C definitions of true and false 2015-08-10 14:27:16 +02:00
mona.c ALSA: Include linux/io.h instead of asm/io.h 2015-01-28 16:49:33 +01:00