Commit graph

83 commits

Author SHA1 Message Date
wynnfeng
8c8d6941f2 hdspmixer: fix core dump
Initialize the name pointer to NULL.

Fixes: https://github.com/alsa-project/alsa-tools/pull/14
Signed-off-by: wynnfeng <wynnfeng@tencent.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2023-05-03 16:45:49 +02:00
Jasmin Fazlic
3e4fd7dffb hdspmixer: add output loopback buttons
This patch adds "LPBK" buttons to the output strip
channels allowing to toggle the hardware output
loopback state.

Efforts were made to hide the buttons for not yet
enabled devices but due to difficulties in implementation
was cancelled for the time being. Should it be a no-go
efforts should be made to fix this and hide them,
although I would think fixing the driver for other
devices would be an effort with much more merit.

This is currently only enabled for HDSP9632 devices
with following driver patch:
da2a040ee7

We check whether the system has the kernel patch
applied by calling `HDSPMixerCard::supportsLoopback()`
and if not these buttons remain gray (off) and do
nothing when clicked.

Signed-off-by: Jasmin Fazlic <superfassl@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-02-27 09:24:53 +01:00
Jasmin Fazlic
c0e69055fa hdspmixer: enhance saving of presets
Changing the version in the file header would make
a preset file not readable by older versions of the
tool. If we just append new data always at the end
of the save procedure we should have no problems
reading them with different versions, as they all
just read to a certain point and ignore the rest
of the file.

This patch implements the logic to save the presets
first to a file called file_name.tmp and appends any
extra data that would come after in a possibly present
file_name file.

Any data written by newer versions would remain in
the preset file and from now on no old version should
remove data written by newer versions.

Also since we write to a temporary file and rename
afterwards an extra feature is gained of not corrupting
the preset should we crash.

Signed-off-by: Jasmin Fazlic <superfassl@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-02-27 09:24:08 +01:00
Takashi Iwai
534e7fac80 hdspmixer: Use __u32 and __u64 for RMS array types
Some variable types are referring to the field in ioctl struct, which
are actually __u32 or __u64 instead of uint32_t or uint64_t.
This inconsistency may result in the compile error.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-12-20 16:42:30 +01:00
Jaroslav Kysela
962a07911c hdspmixer: move .desktop and icon files to desktop, use modern destination for icons
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2017-11-15 10:34:54 +01:00
Jaroslav Kysela
089e69d880 hdspconf, hdspmixer: validate the .desktop files
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2017-11-14 17:37:58 +01:00
Jaroslav Kysela
38f7504af2 Change FSF address (Franklin Street)
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2017-11-14 14:47:19 +01:00
Michel Normand
70118f5f93 gcc6 narrowing error
gcc6 narrowing error compiling for PowerPC archi
===
[   51s] Cus428Midi.cc: At global scope:
[   51s] Cus428Midi.cc:83:1: error: narrowing conversion of '-1' from 'int' to 'char' inside { } [-Wnarrowing]
[   51s]  };
===

proposed patch as suggested in
https://gcc.gnu.org/gcc-6/porting_to.html

Signed-off-by: Michel Normand <normand@linux.vnet.ibm.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-06-20 15:30:47 +02:00
Jaroslav Kysela
07896d3d16 Modernize configure.ac 2014-06-12 11:28:22 +02:00
Adrian Knoth
f3c2688f9d hdspmixer: Add support for RME AIO AEB boards
AIO allows to connect Analogue Extension Boards (4in/4out).

Provide those channels in hdspmixer, too.

The channel maps were copied from the driver, hence the changed casing
in the comments.

Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-01-05 12:01:44 +01:00
Jordi Mallach
472c414744 Add AM_MAINTAINER_MODE([enable]) macro to all configure scripts.
Signed-off-by: Jordi Mallach <jordi@debian.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-05-16 10:40:12 +02:00
Jaroslav Kysela
3375a08a4c More build fixes (gtk1 check removal from echomixer), cvscompile removal
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2012-01-23 11:40:34 +01:00
Adrian Knoth
15aaaba184 hdspmixer: Fix temporary RPM constant
RPM in hdsp.h's HDSP_IO_Type is 4, not 5. This patch isn't exactly
necessary here, because the constant is only used internally, but to
avoid confusion if somebody ever reads the code, let's use the correct
value.

Note that we'll drop it after the next alsa-lib release.

Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-07-29 19:23:42 +02:00
Adrian Knoth
53bcd9d16c hdspmixer: Add support for RME RPM
This patch adds support for the RME RPM devices. It's mostly based on
Florian Faber's previous patch against hdspmixer 1.0.23,
forwarded-ported to the current hdspmixer code.

Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-07-29 07:39:35 +02:00
Adrian Knoth
cb40769c93 hdspmixer: Handle preset files used in 1.0.24 and 1.0.24.1
As an addition to the previous commit, let's also cover the 3rd case
when a preset file was written with hdspmixer v1.0.24 or v1.0.24.1.

In this case, no magic header will be present, but the file size would
differ from the pre 1.0.24 format.

Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-04-14 12:01:04 +02:00
Adrian Knoth
7c6912449a hdspmixer: Handle channel count in old (v1.0.23) preset file format
When reading a preset file, v1.0.23 only used 26 channels instead of 64.
Reading 64 channels from a 26 channel file won't work, hence set it
depending on the file format version.

Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-04-14 12:00:52 +02:00
Adrian Knoth
25bd81562a hdspmixer: Fix read/write from/to preset files on MADI-like cards
The old hdspmixer (prior to e24e56795e,
that is pre-1.0.24) has used the hard-coded value "14" for
reading/storing 14 ints from/to preset files, however, it's actually
HDSP_MAX_DEST that should be used.

HDSP_MAX_DEST was bumped from 14 to 32 to allow for MADI cards (32
stereo pairs equal 64 output channels on MADI cards)

Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-04-14 12:00:26 +02:00
Adrian Knoth
f9147bfc2c hdspmixer: Initialize headphones out in presets
Cards like the multiface/digiface have additional headphones out. Those
were not initialized in the presets due to wrong loop boundaries:
maxdest represents the amount of physical stereo pairs, and chnls is
either equal or less, so the output fader array needs more iterations
than the playback section.

Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-04-06 08:22:41 +02:00
Adrian Knoth
92413b739e hdspmixer: Recall 1st preset on all cards, not just on the first
With the new "store current settings to the virtual 9th preset" before
switching cards code, one needs to make sure the actual mixer state is
loaded with sane values, either from the preset file or a generic
builtin preset.

Calling preset_change(1) is sufficient, setting all the required data.
However, in case of more than one RME card in the system, one needs to
call this function for each card, otherwise, some of the cards store
uninitialized data to the 9th preset, resulting in a weird mixer state
afterwards.

Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-04-06 08:22:33 +02:00
Adrian Knoth
7a865ce040 hdspmixer: Save preset before switching cards
When running with more than one card, switching cards would lose any
changes made to the current card. To avoid this inconvenience, save the
current settings to the virtual 9th preset and restore them when
switching back.

Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-04-06 08:22:15 +02:00
Adrian Knoth
0b018d9a23 hdspmixer: Add a 9th pseudo preset
When switching cards, all current settings are lost. To have a place
where to store them, let's add a virtual 9th preset which can be used as
a temporary scratch pad.

Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-04-06 08:22:06 +02:00
Tim Blechmann
c975369874 hdspmixer: fix drawing problems with black background
- use foreground color instead of black
- HDSPMixerSelector: set colors before setting labels

Signed-off-by: Tim Blechmann <tim@klingt.org>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-04-06 08:20:50 +02:00
Adrian Knoth
8f446f99e5 hdspmixer: Update NEWS file.
Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-03-22 13:03:04 +01:00
Adrian Knoth
287bc091e9 hdspmixer: Save and restore level meter settings
Each preset can have a different level meter setting (FS samples for
OVR, release rate, minimum level and so on).

These settings were not saved/restore to/from the on-disk file. This
patch adds the missing functionality.

Unfortunately, the current on-disk format is a 1:1 binary dump from
memory without any header information. In other words, this commit will
break backward compatibility with older hdspmixers, that is, new preset
files cannot be read by older versions of hdspmixer. However, we can
still read the old mix files and save them in the new format.

I hence bumped the version, so users know to re-create their files after
upgrading to 1.11.

Bug discovered by Raphaël Doursenaud from ematech.fr.

Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-03-22 13:01:45 +01:00
Adrian Knoth
6cc4d395f4 hdspmixer: Use constant instead of hardcoded number of cards.
Again, use MAX_CARDS instead of "3", just in case MAX_CARDS should
change some day.

Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-03-22 13:01:32 +01:00
Adrian Knoth
015579556d hdspmixer: Improve pixmaps
- Added tick marks at 4dB intervals
- Small fixes and cleanup to buttons
- Better ALSA branding

All pixmaps provided by Reuben Martin.

Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-03-22 13:01:19 +01:00
Adrian Knoth
5e77f279ba hdspmixer: Fix toggle of master mute and solo buttons
The sensitive area for master mute and solo buttons was slightly off.
Discovered and fixed by Reuben Martin. Thanks for the patch.

Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-03-22 13:01:05 +01:00
Adrian Knoth
3771b825c8 hdspmixer: New pixmaps
Reuben Martin has provided me with an updated pixmap set to replace
RME's 1998 style no longer in use by the corresponding Win32 tools.

The Linux pixmaps are based on ardour2. Likewise hdspmixer, ardour2 is
GPLv2.

Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2011-03-14 10:32:49 +01:00
Adrian Knoth
7416c3a83c hdspmixer: Show cardname in window title
When running with more than one card, it isn't obvious which card is
shown.

Store the ALSA cardname in the corresponding class and show it in the
window title upon switching cards.

Also, don't show "(null)" but "(unsaved)" in case the user hasn't
selected a preset file.

Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-03-08 13:04:56 +01:00
Adrian Knoth
1669acbe34 hdspmixer: [cosmetics] Break code into logic blocks
Convert the if-then-else-if chain into standalone if-then blocks to
improve readability. A switch-case statement would also do the trick,
but it's less readable.

No (intended) semantic change.

Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-03-08 13:04:36 +01:00
Adrian Knoth
27f5bbfd9e hdspmixer: Fix code indentation
Only cosmetics, no changed semantics. Indent the whole function to get
rid of a mixture of tabs and spaces.

Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-03-08 13:04:29 +01:00
Adrian Knoth
24832bf340 hdspmixer: Provide headphones out on Multiface/Digiface
Both, Multiface and Digiface feature a separate headphone submix, so
reflect this additional pair of channels in the corresponding maps.

Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-03-08 13:04:19 +01:00
Adrian Knoth
455a06756f hdspmixer: Introduce output channel count for all cards.
Some cards (like multiface) have more physical output ports than
playback ports, mostly because of additional headphones out.

For those cards, the old abstraction model of channels_input and
channels_output doesn't fit, so let's introduce channels_output.

Of course, channels_output is always 2*max_dest at the given speed_mode
(SS/DS/QS), so one could extend this idea, store all destination
settings in channels_output[3] (one for each speed mode) and rip off the
massive code duplication for setting maxdest or max_dest respectively.

Note that dest_map_whatever_speed_mode's array size indirectly defines
the right value for channels_output (read: even more unwanted
redundancy)

Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-03-08 13:04:12 +01:00
Adrian Knoth
53e4a1a44e hdspmixer: Adjust playback channel count on Multiface.
The multiface has 18/14 (SS/DS) playback channels, matching the native
18/14 I/O ports. Headphones don't count (only for #destinations).

Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-03-08 13:04:02 +01:00
Adrian Knoth
2b10cb8be8 hdspmixer: Fix preset activation segfault on AES(32)
When selecting preset 6 or 7 on AES(32), hdspmixer has caused a segfault
due to indirect out of bound access on the destination label array.

The amount of destinations is the number of physical stereo
pairs, so it's usually half the channel count, in some cases one more if
there are additional headphone jacks.

Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-03-08 13:03:43 +01:00
Adrian Knoth
92e0a21b89 hdspmixer: Replace hardcoded 3 by MAX_CARDS
We have a define for the number of cards. Use it.

Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-03-08 13:03:26 +01:00
Adrian Knoth
863c47cebe hdspmixer: Fix labels on H9652
The H9652 uses the same layout as the Digiface, except Digiface features
an additional headphones out. That's why the channel mappings are the
same, but Digiface has mexdest=14 while H9652 has maxdest=13 (12 ADAT
pairs, another pair for S/PDIF and headphone-L/R on Digiface)

Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-03-01 13:48:13 +01:00
Adrian Knoth
05d6bc9728 hdspmixer: Lower nesting depth in label assignment
This fix is mostly cosmetic, the long if-then-else-if-chain was rather
confusing. To improve code readability, use simple if-then statements
and leave the function as soon as a match is found.

Clear code would probably use a two-dimensional map, but it seems rather
overengineered.

Last but not least, the non-matching case was augmented by assigning a
generic "1", "2", "3" .. channel naming schema to prevent hdspmixer from
crashing.

Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-03-01 13:47:21 +01:00
Adrian Knoth
042363a429 hdspmixer: Make static destination maps extern
To prevent multiple inclusion, make the destmaps global and only
reference them via extern.

Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-03-01 13:46:50 +01:00
Adrian Knoth
e728f0d073 hdspmixer: Don't use hardcoded number of cards.
We have introduced MAX_CARDS before to make the code more safe and
extendable, so it's just sane to use it all over the place.

Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-02-28 15:55:23 +01:00
Adrian Knoth
c3349a84ea hdspmixer: Fix compiler warnings.
All compiler warnings were caused by a conversion from "foo" to a
char pointer. Given that the string itself really is constant, simply
add the keyword to make g++ happy.

Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-02-28 15:55:14 +01:00
Adrian Knoth
646eacb626 hdspmixer: Fix metering for non-MADI cards
Currently, hdsp and hdspm use different ioctls. Consequently, the metering
is wrong. To avoid code duplication, use pointers to the corresponding
struct members.

Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-02-28 11:11:19 +01:00
Adrian Knoth
97e96addff hdspmixer: Fix ALSA snd_ctl_open error when running with three cards.
If three (or more) RME cards are installed in one box, hdspmixer will
try to open a non-existing 4th card, causing an error in snd_ctl_open
and finally terminates itself.

cards[] is a static array, and one must not read beyond the last
element. The solution is far from elegant, however, it's a rather
unintrusive change.

Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-02-28 11:11:13 +01:00
Adrian Knoth
3506d3d9a7 hdspmixer: Bump version number to 1.10
Florian Faber's last hdspmixer64 version was 1.9, so let's make this the
successor (contains everything that was in 1.9 and also Fredrik's work
on AES(32) support)

Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-02-28 11:11:05 +01:00
Adrian Knoth
3f34b2c0f2 hdspmixer: Increase height of about window.
The copyright list got longer, so we need more vertical space.

Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-02-28 11:10:58 +01:00
Adrian Knoth
073fad25cb hdspmixer: Update FSF address.
The FSF has moved, so reflect this change in the about dialogue.

See also http://www.fsf.org/about/contact/

Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-02-28 11:10:52 +01:00
Adrian Knoth
9ea2fb1f88 hdspmixer: Improve code coherency
Move channelmappings into one place (channelmap.h). Also, use "aes32"
when referring to the card itself to avoid confusion and to be coherent
with the remaining naming scheme.

This work has mainly been done by Fredrik Lingvall.

Signed-off-by: Fredrik Lingvall <fredrik.lingvall@gmail.com>
Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-02-28 11:10:43 +01:00
Adrian Knoth
0201fd1778 hdspmixer: Style and purity fixes for name arrays.
Contribution by Fredrik Lingvall <fredrik.lingvall@gmail.com>

Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-02-10 18:58:37 +01:00
Adrian Knoth
69991756aa hdspmixer: Add RME HDSPe AES and AES32 support.
Code provided by  Fredrik Lingvall <fredrik.lingvall@gmail.com>

It seems the PCIe (AES) and PCI (AES32) versions behave the same, so we
can kill two birds with one stone.

Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-02-10 18:58:21 +01:00
Adrian Knoth
cef20c040c hdspmixer: Break overlong line and don't plenken.
Pure code beautification, just in case somebody ever needs to touch this
again.

Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-02-07 14:55:23 +01:00