History log of /linux-master/sound/core/seq/seq_ump_client.c
Revision Date Author Comments
# 6487e363 27-Feb-2024 Takashi Iwai <tiwai@suse.de>

ALSA: seq: ump: Use guard() for locking

We can simplify the code gracefully with new guard() macro and co for
automatic cleanup of locks.

Only the code refactoring, and no functional changes.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20240227085306.9764-19-tiwai@suse.de


# 316e38ef 21-Feb-2024 Takashi Iwai <tiwai@suse.de>

ALSA: seq: ump: Use automatic cleanup of kfree()

There are common patterns where a temporary buffer is allocated and
freed at the exit, and those can be simplified with the recent cleanup
mechanism via __free(kfree).

No functional changes, only code refactoring.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20240222111509.28390-9-tiwai@suse.de


# 0d422608 15-Sep-2023 Takashi Iwai <tiwai@suse.de>

ALSA: seq: ump: Fix -Wformat-truncation warning

The filling of a port name string got a warning with W=1 due to the
potentially too long group name. Add the string precision to limit
the size.

Fixes: 81fd444aa371 ("ALSA: seq: Bind UMP device")
Link: https://lore.kernel.org/r/20230915082802.28684-2-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 22eefaea 12-Sep-2023 Takashi Iwai <tiwai@suse.de>

ALSA: seq: Avoid delivery of events for disabled UMP groups

ALSA sequencer core still delivers events to the disabled UMP Group,
leaving this handling to the device. But it's rather risky and it's
easy to imagine that such an unexpected event may screw up the device
firmware.

This patch avoids the superfluous event deliveries by setting the
group_filter of the UMP client as default, and evaluate the
group_filter properly at delivery from non-UMP clients.

The grouop_filter is updated upon the dynamic UMP Function Block
updates, so that it follows the change of the disabled UMP Groups,
too.

Fixes: d2b706077792 ("ALSA: seq: Add UMP group filter")
Link: https://lore.kernel.org/r/20230912085144.32534-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 59ea9138 21-Jul-2023 Wang Weiyang <wangweiyang2@huawei.com>

ALSA: seq: remove redundant unsigned comparison to zero

Since struct snd_ump_block_info::first_group is unsigned char, comparison
to zero is redundant

Signed-off-by: Wang Weiyang <wangweiyang2@huawei.com>
Fixes: 81fd444aa371 ("ALSA: seq: Bind UMP device")
Link: https://lore.kernel.org/r/20230721103124.18522-1-wangweiyang2@huawei.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 6a8b4800 12-Jun-2023 Takashi Iwai <tiwai@suse.de>

ALSA: seq: ump: Notify UMP protocol change to sequencer

UMP v1.1 supports the protocol switch via a UMP Stream message. When
it's received, we need to take care of the midi_version field in the
corresponding sequencer client, too.

This patch introduces a new ops to notify the protocol change to
snd_seq_ump_ops for handling it.

Link: https://lore.kernel.org/r/20230612081054.17200-9-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 174a6dfb 12-Jun-2023 Takashi Iwai <tiwai@suse.de>

ALSA: seq: ump: Notify port changes to system port

For allowing applications to track the FB active changes, this patch
adds the notification from the system port at each time a FB change is
handled and the active flag or re-grouping happens.

Link: https://lore.kernel.org/r/20230612081054.17200-8-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 4a16a3af 12-Jun-2023 Takashi Iwai <tiwai@suse.de>

ALSA: seq: ump: Handle FB info update

This patch implements the handling of the dynamic update of FB info.

When the FB info update is received after the initial parsing, it
means the dynamic FB info update. We compare the result, and if the
actual update is detected, it's notified via a new ops,
notify_fb_change, to the sequencer client, and the corresponding
sequencer ports are updated accordingly.

Link: https://lore.kernel.org/r/20230612081054.17200-7-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 5437ac9b 12-Jun-2023 Takashi Iwai <tiwai@suse.de>

ALSA: seq: ump: Handle groupless messages

The UMP Utility and Stream messages are "groupless", i.e. an incoming
groupless packet should be sent only to the UMP EP port, and the event
with the groupless message is sent to UMP EP as is without the group
translation per port.

Also, the former reserved bit 0 for the client group filter is now
used for groupless events. When the bit 0 is set, the groupless
events are filtered out and skipped.

Link: https://lore.kernel.org/r/20230612081054.17200-6-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# d2d247e3 23-May-2023 Takashi Iwai <tiwai@suse.de>

ALSA: seq: Add ioctls for client UMP info query and setup

Add new ioctls for sequencer clients to query and set the UMP endpoint
and block information.

As a sequencer client corresponds to a UMP Endpoint, one UMP Endpoint
information can be assigned at most to a single sequencer client while
multiple UMP block infos can be assigned by passing the type with the
offset of block id (i.e. type = block_id + 1).

For the kernel client, only SNDRV_SEQ_IOCTL_GET_CLIENT_UMP_INFO is
allowed.

Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Link: https://lore.kernel.org/r/20230523075358.9672-35-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 4025f0e6 23-May-2023 Takashi Iwai <tiwai@suse.de>

ALSA: seq: ump: Create UMP Endpoint port for broadcast

Create a sequencer port for broadcasting the all group inputs at the
port number 0. This corresponds to a UMP Endpoint connection;
application can read all UMP events from this port no matter which
group the UMP packet belongs to.

Unlike seq ports for other UMP groups, a UMP Endpoint port has no
SND_SEQ_PORT_TYPE_MIDI_GENERIC bit, so that it won't be treated as a
normal MIDI 1.0 device from legacy applications.

The port is named as "MIDI 2.0" to align with representations on other
operation systems.

Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Link: https://lore.kernel.org/r/20230523075358.9672-34-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# 81fd444a 23-May-2023 Takashi Iwai <tiwai@suse.de>

ALSA: seq: Bind UMP device

This patch introduces a new ALSA sequencer client for the kernel UMP
object, snd-seq-ump-client. It's a UMP version of snd-seq-midi
driver, while this driver creates a sequencer client per UMP endpoint
which contains (fixed) 16 ports.

The UMP rawmidi device is opened in APPEND mode for output, so that
multiple sequencer clients can share the same UMP endpoint, as well as
the legacy UMP rawmidi devices that are opened in APPEND mode, too.
For input, on the other hand, the incoming data is processed on the
fly in the dedicated hook, hence it doesn't open a rawmidi device.

The UMP packet group is updated upon delivery depending on the target
sequencer port (which corresponds to the actual UMP group).

Each sequencer port sets a new port type bit,
SNDRV_SEQ_PORT_TYPE_MIDI_UMP, in addition to the other standard
types for MIDI.

Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Link: https://lore.kernel.org/r/20230523075358.9672-33-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>