Detailed changes v1.2.12 v1.2.13

From AlsaProject
Jump to navigation Jump to search

Detailed changelog between 1.2.12 and 1.2.13 releases

Changelog between 1.2.11 and 1.2.13 releases

alsa-lib

Core

- Release v1.2.13 - configure: do allow to use --with-pic for static build

Closes: https://github.com/alsa-project/alsa-lib/issues/411

- configure: bumb version to 1.2.13pre1 (for alsa-utils) - github: use upload-artifacts@v4 - src/Versions.in: Add the new snd_pcm_hw_params_get_sync for 1.2.13 - seq: Add snd_seq_{get|set}_ump_is_midi1() API functions

Implement the API function calls corresponding to the new sequencer
port flag bit that has been added recently to the kernel.
A UMP MIDI 2.0 device allow to have an optional MIDI 1.0 port while
speaking in MIDI 2.0 protocol for other UMP Groups.  The new seq port
flag indicates that.

This is rather a minor difference, and since ALSA sequencer core
covers the all conversions, usually you don't have to worry about it
at all.

- seq: Add API functions to set different tempo base values

MIDI2 Set Tempo message uses 10ns-based values, and we need to update
the API to change the base time unit.

This patch adds a few new API functions:
- snd_seq_has_queue_tempo_base() returns 1 if the client supports a
  new tempo-base value; if 0, it's an old system and application has
  to use the tempo in the fixed 1us unit
- the tempo base can be changed with
  snd_seq_queue_tempo_set_tempo_base(), provided in nsec unit;
  the value has to be either 10 or 1000 (or 0 as default, equivalent
  with 1000)

The protocol version is checked and fallback to the fixed 1us base for
the old clients.

- ump: Add a function to provide the packet word length of a UMP type

Add a helper function to return the number of words of a given UMP
packet type.  Used for parsing MIDI Clip File stream, for example.

- src/Versions.in: Add guards for sequencer and rawmidi syms

Similarly like PCM and others, add the ifdef guards for new symbols
for sequencer and rawmidi interfaces.

- src/Versions.in: Add new seq / rawmidi functions for UMP

Control API

- control: remap - clarify comments and docs

Fix copy-n-paste errors.

- control: remap - fix copy-n-paste in _snd_ctl_remap_open's comment - Fix TLV dB parser in case of used container

In case when dB information does not appear as the only TLV type in the
stream (it might be wrapped in a container, but the container can not
have any other type), the TLV parser fails to get the dB TLV pointer.

This commit fixes it by distinguishing between TLV parse error and dB
information not being found in a container (-ENOENT), so the parser can iterate
over all elements in the container.

Also, it fixes out-of-bounds read in case of malicious TLV record.

Closes: https://github.com/alsa-project/alsa-lib/pull/409

- control: Make ump_{endpoint|block}_info calls optional

Add the NULL check for ump_endpoint_info and ump_block_info calls.
Those can be NULl depending on the target.

PCM API

- pcm: close - deactivate async handler before snd_pcm_drop()

It reduces probablity to activate the async handler when snd_pcm_close() is called.

Link: https://github.com/alsa-project/alsa-lib/issues/394

- pcm: dmix: Don't clear scpm->info flag

spcm->info bits should be a copy of the slave PCM info as is.
While we clear the unsupported SND_PCM_INFO_PAUSE bit there, it should
be rather cleared only for the exposed info to apps, not spcm->info.

- pcm: dmix: Fix resume with multiple instances

The fix for PCM dmix suspend/resume checks spcm->info bit of
SND_PCM_INFO_RESUME for applying a workaround for drivers with the
full resume support.  This assumed that scpm->info is exposed from the
underlying slave PCM device.

The above is true for the first opened instance, but for the second
opened instance, it's a copy from the saved data in shmem.  And, we
dropped SND_PCM_INFO_RESUME bit there to assure not to expose the full
resume capability to applications.  This resulted in the
inconsistencies, and when the second instance is resumed at first, it
misses the snd_pcm_resume() call, hence the driver doesn't react
properly any longer.

For addressing it, we keep SND_PCM_INFO_RESUME bit in shmptr->s.info
bits as is, while dropping the bit exposed to apps in
snd_pcm_direct_hw_refine() and *_hw_params() callbacks.

Reported-and-tested-by: Chancel Liu <chancel.liu@nxp.com>
Closes: https://lore.kernel.org/DB9PR04MB94988752ED7C43B399E0BC00E3942@DB9PR04MB9498.eurprd04.prod.outlook.com

- pcm: implement snd_pcm_hw_params_get_sync() and obsolete snd_pcm_info_get_sync()

Use the new clock source mechanism to get information about
similar PCM clock sources for PCM streams.

Link: https://lore.kernel.org/linux-sound/20240625172836.589380-1-perex@perex.cz/

RawMidi API

- ump: Add a function to provide the packet word length of a UMP type

Add a helper function to return the number of words of a given UMP
packet type.  Used for parsing MIDI Clip File stream, for example.

- ump: Add descriptions for UMP RawMidi interface

Also update doxygen config accordingly.

- ump: Fix doxygen error for snd_ump_endpoint_info_set_protocol()

Fix a typo that caused a doxygen error.

- ump: Add missing *_set variants for snd_ump_endpoint_info and snd_ump_block_info

The API functions to fill the data on snd_ump_endpoint_info and
snd_ump_block_info were missing.  Let's add them.

They can be used to construct a virtual UMP endpoint and block.

Sequencer API

- seq: Correct a typo in documentation

The right function name is snd_seq_has_queue_tempo_base().

- seq: Add snd_seq_{get|set}_ump_is_midi1() API functions

Implement the API function calls corresponding to the new sequencer
port flag bit that has been added recently to the kernel.
A UMP MIDI 2.0 device allow to have an optional MIDI 1.0 port while
speaking in MIDI 2.0 protocol for other UMP Groups.  The new seq port
flag indicates that.

This is rather a minor difference, and since ALSA sequencer core
covers the all conversions, usually you don't have to worry about it
at all.

- seq: Avoid strlcat()

strlcat() isn't available in every system, so better to avoid it.
Rewrite the code without strlcat().

Link: https://lore.kernel.org/0796c157-1ac3-47a3-9d54-ba86f59d64d5@linux.intel.com

- seq: Fix wrong FB direction at snd_seq_create_ump_block()

snd_seq_create_ump_block() receives a snd_ump_block_info_t data at the
creation of a FB and updates its associated sequencer port, but it
handled the port direction incorrectly.  The UMP / port direction
means the connectivity, but the current code translated other way
round.  The correct translation should be that input = receiver, i.e.
a writable port for applications, and output = source, a readable port
for applications.

This patch corrects the translation, and add more comments to the
direction definition.

- seq: Add API functions to set different tempo base values

MIDI2 Set Tempo message uses 10ns-based values, and we need to update
the API to change the base time unit.

This patch adds a few new API functions:
- snd_seq_has_queue_tempo_base() returns 1 if the client supports a
  new tempo-base value; if 0, it's an old system and application has
  to use the tempo in the fixed 1us unit
- the tempo base can be changed with
  snd_seq_queue_tempo_set_tempo_base(), provided in nsec unit;
  the value has to be either 10 or 1000 (or 0 as default, equivalent
  with 1000)

The protocol version is checked and fallback to the fixed 1us base for
the old clients.

- seq: Correct section descriptions for UMP

The usage of \section and \subsection were wrong in the previous
commit, where the tags were missing.

- seq: Add description about MIDI 2.0 and UMP handling

Add more description of the new ALSA sequencer features for MIDI 2.0
and UMP handling.

- seq: Add API helper functions for creating UMP Endpoint and Blocks

For making it easer for applications to create a virtual UMP Endpoint
and UMP blocks, add two API helper functions.

snd_seq_create_ump_endpoint() creates (unsurprisingly) a UMP Endpoint,
based on the given snd_ump_endpoint_info_t information.  The number of
(max) UMP groups belonging to this Endpoint has to be specified.
This function sets up the Endpoint info on the sequencer client, and
creates a MIDI 2.0 UMP port as well as UMP Group ports automatically.
The name of the sequencer client is updated from the Endpoint name,
too.

After creating a UMP Endpoint, create each UMP Block via
snd_seq_create_ump_block() function with a snd_ump_block_info_t info.
The associated groups for each block have to be specified there.
The port names and capability bits are updated accordingly after
setting each block information.

/src/Makefile.am

- src/Versions.in: Add guards for sequencer and rawmidi syms

Similarly like PCM and others, add the ifdef guards for new symbols
for sequencer and rawmidi interfaces.

Async helpers

- Fixes: 5600b901 ("async: snd_async_del_handler - move clear signal using sigaction as last")

A wrong list head is used to check if the given list with async handlers
is empty. Correct this.

Link: https://github.com/alsa-project/alsa-lib/issues/394

Configuration

- conf: fix snd_config_substitute (for src->parent)

If source configuration node has a parent set, it must be always
detached to avoid memory corruptions.

Documentation

- ump: Add descriptions for UMP RawMidi interface

Also update doxygen config accordingly.

Kernel Headers

- Sync UAPI asound.h and asequencer.h with 6.12 kernel

The recent upstream kernel received a few features and extended /
cleaned up the asound.h and asequencer.h uapi files:
- ALSA: pcm: Introduce MSBITS subformat interface
- ALSA: pcm: clarify and fix default msbits value for all formats
- ALSA: pcm: reinvent the stream synchronization ID API
- ALSA: timer: Introduce virtual userspace-driven timers

- pcm: implement snd_pcm_hw_params_get_sync() and obsolete snd_pcm_info_get_sync()

Use the new clock source mechanism to get information about
similar PCM clock sources for PCM streams.

Link: https://lore.kernel.org/linux-sound/20240625172836.589380-1-perex@perex.cz/

- seq: Add snd_seq_{get|set}_ump_is_midi1() API functions

Implement the API function calls corresponding to the new sequencer
port flag bit that has been added recently to the kernel.
A UMP MIDI 2.0 device allow to have an optional MIDI 1.0 port while
speaking in MIDI 2.0 protocol for other UMP Groups.  The new seq port
flag indicates that.

This is rather a minor difference, and since ALSA sequencer core
covers the all conversions, usually you don't have to worry about it
at all.

- seq: Add API functions to set different tempo base values

MIDI2 Set Tempo message uses 10ns-based values, and we need to update
the API to change the base time unit.

This patch adds a few new API functions:
- snd_seq_has_queue_tempo_base() returns 1 if the client supports a
  new tempo-base value; if 0, it's an old system and application has
  to use the tempo in the fixed 1us unit
- the tempo base can be changed with
  snd_seq_queue_tempo_set_tempo_base(), provided in nsec unit;
  the value has to be either 10 or 1000 (or 0 as default, equivalent
  with 1000)

The protocol version is checked and fallback to the fixed 1us base for
the old clients.

MIDI 2.0 (UMP)

- ump_msg: Add missing definition for Set Key Signature Message

The Set Key Signature message was missing at the time we defined
for Flex Data types.

- ump_msg: Define types for UMP Mixed Data Set messages

Mixed Data Set messages is another messages of the type 5
(SND_UMP_MSG_TYPE_EXTENDED_DATA) with the status 8 and 9.

- ump_msg: Add a new helper snd_ump_get_byte()

For making it easier to extract a byte from the UMP packet no matter
which endian is used, introduce a new helper function
snd_ump_get_byte().  It'll be useful for retrieving SysEx byte or a
name string.

- ump_msg: Correct a typo in snd_ump_msg_flex_data_t definition.

There was a typo in snd_ump_msg_flex_data_t definition; it should be
"set_metronome".

- ump: Add a function to provide the packet word length of a UMP type

Add a helper function to return the number of words of a given UMP
packet type.  Used for parsing MIDI Clip File stream, for example.

- ump_msg: Drop unsuitable comments

There were some leftover comments from the old code that don't fit any
longer.  Drop them.

- ump_msg: Add definitions for Utility, Stream and Flex Data messages

This patch provides more struct / union definitions for UMP Utility,
Stream and Flex Data messages, provided in the new UMP v1.1
specification.

- ump_msg: Fix the wrong snd_ump_msg_system_t argument in little-endian

For the little-endian format, the parameters are stored incorrectly
in snd_ump_msg_system_t type.  Swap the both parameter positions to
correct to the right positions.

- ump: Add descriptions for UMP RawMidi interface

Also update doxygen config accordingly.

- ump_msg.h: Fix doxygen comments

Correct the lack of markers and missing comments for some unions.

- seq: Add API helper functions for creating UMP Endpoint and Blocks

For making it easer for applications to create a virtual UMP Endpoint
and UMP blocks, add two API helper functions.

snd_seq_create_ump_endpoint() creates (unsurprisingly) a UMP Endpoint,
based on the given snd_ump_endpoint_info_t information.  The number of
(max) UMP groups belonging to this Endpoint has to be specified.
This function sets up the Endpoint info on the sequencer client, and
creates a MIDI 2.0 UMP port as well as UMP Group ports automatically.
The name of the sequencer client is updated from the Endpoint name,
too.

After creating a UMP Endpoint, create each UMP Block via
snd_seq_create_ump_block() function with a snd_ump_block_info_t info.
The associated groups for each block have to be specified there.
The port names and capability bits are updated accordingly after
setting each block information.

- ump: Add missing *_set variants for snd_ump_endpoint_info and snd_ump_block_info

The API functions to fill the data on snd_ump_endpoint_info and
snd_ump_block_info were missing.  Let's add them.

They can be used to construct a virtual UMP endpoint and block.

Test/Example code

- test: Add an example program to inquire UMP Endpoint and Block info

Provide an example program to inquire UMP Endpoint and Block info in
various APIs.

- test: Add an example program to create a virtual UMP Endpoint

Provide an example program to demonstrate how to create a UMP Endpoint
and Blocks, i.e. a virtual UMP device.

It's a simple filtering application that just haves the incoming note
on/off velocity and sends out to the output.  The UMP Endpoint and
Block attributes can be adjusted via command-line options.

alsa-utils

Core

- Release v1.2.13 - alsactl: 90-alsa-restore.rules - add support for AMD ACP digital microphone

The UCM configuration for AMD ACP digital microphones combines HDA analog card
with ASoC AMD ACP digital microphone card. When the ACP microphone card
is detected later than HDA analog card, the UCM initialization for HDA
analog card should be executed again.

Additional changes:

Added --with-alsactl-udev-extra-test argument to handle the tests for
directories. The default value was kept.

Added --alsactl-udev-args argument to pass extra arguments to alsactl
in the udev rule.

Note: The autoconf does not handle correctly spaces so configure
call like 'configure --alsactl-udev-args="-E ENV=abcd"' is not allowed.
Substitue '__' string as ' ' for this reason.

Example:

   configure --with-alsactl-udev-args="-E__ENV=abcd" \
             --with-alsactl-udev-extra-test='TEST=="/abcd",__TEST=="/xyz",'

Closes: https://github.com/alsa-project/alsa-utils/issues/278

- configure: bumb required alsa-lib version to 1.2.13

Code requires new sequencer API extensions.

- github: use upload-artifacts@v4 - configure: Drop unused conditionals

Since the required alsa-lib version was bumped and the relevant code
cleanup, some conditionals are no longer referred.  Drop them.

- configure: Requires the latest ALSA-lib release 1.2.12

New features such as MIDI 2.0 should be always enabled for the
builds.  Update the dependency to alsa-lib 1.2.12.

- aplaymidi2: Add initial version

aplaymidi2 is a program similar like aplaymidi, but intended for
playing back a MIDI Clip file that was introduced for handling UMP.
MIDI Clip file contains UMP packets, and its structure is much simpler
than SMF.

The options are mostly same as aplaymidi, but I omitted -l option for
simplifying the code.

/seq/Makefile.am

- aplaymidi2: Add initial version

aplaymidi2 is a program similar like aplaymidi, but intended for
playing back a MIDI Clip file that was introduced for handling UMP.
MIDI Clip file contains UMP packets, and its structure is much simpler
than SMF.

The options are mostly same as aplaymidi, but I omitted -l option for
simplifying the code.

ALSA Control (alsactl)

- alsactl: 90-alsa-restore.rules - add support for AMD ACP digital microphone

The UCM configuration for AMD ACP digital microphones combines HDA analog card
with ASoC AMD ACP digital microphone card. When the ACP microphone card
is detected later than HDA analog card, the UCM initialization for HDA
analog card should be executed again.

Additional changes:

Added --with-alsactl-udev-extra-test argument to handle the tests for
directories. The default value was kept.

Added --alsactl-udev-args argument to pass extra arguments to alsactl
in the udev rule.

Note: The autoconf does not handle correctly spaces so configure
call like 'configure --alsactl-udev-args="-E ENV=abcd"' is not allowed.
Substitue '__' string as ' ' for this reason.

Example:

   configure --with-alsactl-udev-args="-E__ENV=abcd" \
             --with-alsactl-udev-extra-test='TEST=="/abcd",__TEST=="/xyz",'

Closes: https://github.com/alsa-project/alsa-utils/issues/278

- alsactl: state: verify only control count not numids

The numids may change. Verify if a control is added or removed.

- alsactl: state: recode set_control() to use newer functions

The goal is to make the code more clean and separate elem id parsing.

aconnect

- aconnect: Drop superfluous ifdefs

Now that the latest alsa-lib 1.2.12 became mandatory, all ugly ifdefs
can be dropped.

- aconnect: Fix the indication of inactive ports

The inactive port should have been shown in each port line instead of
the client name line.

alsatplg (topology)

- topology: Fix strcat() to uninitialized memory in

If *defs == NULL the realloc() will be a simple malloc() and return a
pointer to uninitialized memory. Doing a strcat() to this is bad, so in
that case strcpy() the string into the newly allocated buffer.

This fixes the buffer overflow bug, such as:

*** buffer overflow detected ***: terminated
Program received signal SIGABRT, Aborted.
__pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:44
warning: 44     ./nptl/pthread_kill.c: No such file or directory
(gdb) bt
    at ../sysdeps/posix/libc_fatal.c:132
    at ./debug/fortify_fail.c:24
    dest=dest@entry=0x5555555682c0 "hUUU\005PLATFORM=mtl,PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-mtl-sdw-cs42l42-l0-max98363-l2-4ch-48k-96k.bin,NUM_DMICS=4,PDM1_MIC_A_ENABLE=1,PDM1_MIC_B_ENABLE=1,DMIC0_ID=3,DMIC1_ID=4,DMIC1_ENABLE=passth"...,
    src=src@entry=0x7fffffffe0fa "PLATFORM=mtl,PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-mtl-sdw-cs42l42-l0-max98363-l2-4ch-48k-96k.bin,NUM_DMICS=4,PDM1_MIC_A_ENABLE=1,PDM1_MIC_B_ENABLE=1,DMIC0_ID=3,DMIC1_ID=4,DMIC1_ENABLE=passthrough"..., destlen=<optimized out>) at ./debug/strcat_chk.c:34
    __src=0x7fffffffe0fa "PLATFORM=mtl,PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-mtl-sdw-cs42l42-l0-max98363-l2-4ch-48k-96k.bin,NUM_DMICS=4,PDM1_MIC_A_ENABLE=1,PDM1_MIC_B_ENABLE=1,DMIC0_ID=3,DMIC1_ID=4,DMIC1_ENABLE=passthrough"...,
    __dest=<optimized out>) at /usr/include/x86_64-linux-gnu/bits/string_fortified.h:130
    d=0x7fffffffe0fa "PLATFORM=mtl,PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-mtl-sdw-cs42l42-l0-max98363-l2-4ch-48k-96k.bin,NUM_DMICS=4,PDM1_MIC_A_ENABLE=1,PDM1_MIC_B_ENABLE=1,DMIC0_ID=3,DMIC1_ID=4,DMIC1_ENABLE=passthrough"...,
    defs=<synthetic pointer>) at topology.c:400

Closes: https://github.com/alsa-project/alsa-utils/pull/277

- Topology: NHLT: Intel: SSP: Handle differences for ACE3.x

- The SSC1 bits 21 and 20, TSRE and RSRE, do not exist.
- The SSC0 bit 30 ACS does not exist.
- The SSC0 bit 6 ECS does not exist but needs to be set, add note.
- The MDIVXCTRL bits 20:21 MNDSS does not exist.

Closes: https://github.com/alsa-project/alsa-utils/pull/276

- Topology: NHLT: Intel: SSP: Always set SSC0 Network mode

The MOD = 1 is the only allowed setting for SSC0(31) bit for
cAVS 2.x and all ACE versions 1.x, 2.x, and 3.x

Closes: https://github.com/alsa-project/alsa-utils/pull/276

- Topology: NHLT: Intel: SSP: Add support for blob format

This patch adds the 3.0 format that is used for the PTL
ACE3.x platform. Blob 3.0 is based on blob 1.5 but it adds
DMA control registers settings and has some changes in
registers bitfields.

This patch also fixes some compile warnings when NHLT_DEBUG is
set for comparing int with unsigned in ssp-debug.c for code for
all blobs variants.

Closes: https://github.com/alsa-project/alsa-utils/pull/276

- topology: pre_process_create_items - remove useless class_id_local

This variable was not freed correctly on function return.

- topology: pre-processor: Introduce a new feature for subtree

Introduce a new kyword "SubTreeCopy" for extneding existing conf nodes
with additional nodes. This feature is useful for extending previous
pipeline class definitions with the addition of one or more widgets
without having to duplicate everything in the new class definition.

For example: Consider a pipeline class definition as below. Note that
only the widgets & routes are shown here.

Class.Pipeline.mixout-gain-dai-copier-playback {
        Object.Widget {
                mixout."1" {}
                dai-copier."1" {}
                gain."1" {}
                pipeline."1" {}
        }

        Object.Base {
                !route [
                        {
                                source mixout.$index.1
                                sink    gain.$index.1
                        }
                ]
        }
}

If we want to extend this pipeline with the addition of an eqiir/eqfir,
we can create a SubTreeCopy node with type extend as follows:

Class.Pipeline.mixout-gain-eqiir-eqfir-dai-copier-playback {
        SubTreeCopy.baseclass {
                source "Class.Pipeline.mixout-gain-dai-copier-playback"
                type extend

                tree {
                        Object.Widget {
                                eqiir.1 {}
                                eqfir.1 {}
                        }

                        Object.Base {
                                !route [
                                        {
                                                source gain.$index.1
                                                sink   eqiir.$index.1
                                        }
                                        {
                                                source eqiir.$index.1
                                                sink   eqfir.$index.1
                                        }
                                ]
                        }
                }
        }
}

Note that the target is left undefined, which means that the newly
created subtree will be merged to the parent node that contains the
"SubTreeCopy" node i.e. in this case
Class.Pipeline.mixout-gain-eqiir-eqfir-dai-copier-playback".

But if we want to modify an existing pipeline class while modifying the
order of widgets and/or inserting new widgets, we should use the type
"override" instead. This allows for adding new widgets to the list of
widgets in the base class definition while also allowing overriding the
routes to allow inserting the new widgets and reordering the widgets in
the base class. For example, if we want to add a drc widget between the
gain and the eqiir modules in the above class, we can do the following:

Class.Pipeline.mixout-efx-dai-copier-playback {
        # This copy will override all widgets/routes in the base class
        SubTreeCopy.baseclass {
                source "Class.Pipeline.mixout-gain-eqiir-eqfir-dai-copier-playback"
                target "Class.Pipeline"
                type override

                tree {
                        Object.Widget {
                                drc.1 {}
                        }

                        Object.Base {
                                !route [
                                        {
                                                source mixout.$index.1
                                                sink    gain.$index.1
                                        }
                                        {
                                                source gain.$index.1
                                                sink    drc.$index.1
                                        }
                                        {
                                                source  drc.$index.1
                                                sink    eqiir.$index.1
                                        }
                                        {
                                                source  eqiir.$index.1
                                                sink    eqfir.$index.1
                                        }
                                ]
                        }
                }
        }

        # Explicitly copy the widgets from the base class now
        SubTreeCopy.widgets {
                source "Class.Pipeline.mixout-gain-eqiir-eqfir-dai-copier-playback.Object.Widget"
                target "Class.Pipeline.mixout-efx-dai-copier-playback.Object.Widget"
        }
}

Closes: https://github.com/alsa-project/alsa-utils/pull/268

- Topology: NHLT: Intel: Fix compile warning in dmic-process.c

This patch fixes warnings like:

intel/dmic/dmic-process.c: In function 'select_mode':
intel/dmic/dmic-process.c:498:35: warning:
format '%s' expects a matching 'char *' argument [-Wformat=]

The intended __func__ string is missing from the two fprintf()
prints for errors.

Closes: https://github.com/alsa-project/alsa-utils/pull/270

aplay/arecord

- aplay: Print '=== PAUSE ===' only if it is supported

Instead of printing the '=== PAUSE ===' unconditionally before calling
do_pause(), move it to the function and only print it if the stream can
be paused.

If the stream cannot be paused that the '=== PAUSE ===' will be replaced
by `PAUSE command ignored (no hw support)` immediately, which is not
observable by users but automation scripts will catch the '=== PAUSE ==='
and might think that the stream is indeed got paused.

Move the print into do_pause() function after the snd_pcm_pause() have
returned without error to make sure it is only printed if the stream is
paused and we are waiting for the pause release from user to proceed.

Closes: https://github.com/alsa-project/alsa-utils/pull/271

aplaymidi/arecordmidi

- aplaymidi: Allow to pass 0 to -u option, too

Specifying -u 0 shouldn't be treated as an error but it should mean
the legacy MIDI 1.0 handling.

- aplaymidi: Drop ifdef for UMP support

Now that the latest alsa-lib 1.2.12 became mandatory, all ugly ifdefs
can be dropped.

aplaymidi2/arecordmidi2 (MIDI v2.0)

- aplaymidi2: Use snd_ump_get_byte() helper

For simplifying code, use snd_ump_get_byte() to retrieve the meta text
data.

- aplaymidi2: Add -a option to pass all UMP packets

So far, aplaymidi2 passes the MIDI1/MIDI2 channel voice UMP messages
to the target while processing other UMP messages internally.  But
sometimes we'd like to pass all UMP messages as is and let the
receiver processes.

This patch adds a new option -a (or --passall) to pass the all UMP
packets included in the given MIDI Clip file to the target as-is.

- aplaymidi2: Fix --silent option handling

The --silent option takes no argument.  Correct the wrong setup.

- arecordmidi2: Fix truncated text in meta data text handling

The current code didn't proceed the text position buffer and the text
was always truncated in 12 bytes.  Let's fix it.

- arecordmidi2: Add options to put meta data texts

For convenience, add more options to embed the meta data texts given
via command line.  The song name etc can be given directly via the
respective option directly, e.g. --song="text..."

- arecordmidi2: Add --profile option

Allow to add arbitrary profile UMP data to be put into the
configuration of the recorded stream via --profile option.
The file must contain valid UMP data encoded in big-endian.

- arecordmidi2: Add stdout output and --silent option

When the output file is '-', it's recorded to stdout.

For avoiding the corruption, this mode also suppresses the messages to
stdout, too, which can be enabled also via -s / --silent option.

- aplaymidi2: Add --silent option

For suppressing the messages, add -s / --silent option.

- Revert "arecordmidi2: Correct the MIDI FB direction"

This reverts commit e609d66807589caad6d38bd2c848fc571675ef62.

It turned out that the failure was rather in alsa-lib API; the
input and output have been incorrectly implemented.
Now that the alsa-lib code got fixed, let's revert the bad fix.

- aplaymidi2: Show meta data texts

Now aplaymidi2 shows the meta data texts embedded in Flex Data
messages such as copyright and lyrics.  The text output isn't
synchronized yet with the actual position, though.

- arecordmidi2: Fix the tick in 1us tempo-base

The recorded tick is incorrectly converted for 1us tempo-base on the
old kernels.  Since we correct the queue tempo, we don't have to
adjust the returned tick value any longer.  The current code applies
it doubly, resulting in 100 times slower.

- arecordmidi2: Correct the MIDI FB direction

The direction was wrongly passed to the FB setup.  It has to be
"OUTPUT" instead of "INPUT, so that other applications can write to
arecordmidi2 port.

- arecordmidi2: Start queue at starting the stream

The queue should be started at the very same time of the start of the
stream itself in the interactive mode.  Otherwise it'll get bogus long
waits until the start of the clip.

Move the code to start the queue in start_bar(), so that it's always
tied with the start sequence.

- arecordmidi2: Add passive mode and interactive mode

Allow arecordmidi2 running without specifying the source ports via -p
option.  This will create a UMP Endpoint with the full 16 FBs, and
simply reads from the input ports via subscribers.  User needs to
connect to the ports manually, though.

Also, add -r option to run in the interactive mode.  In the
interactive mode, arecordmidi2 waits for the RETURN key entered from
the terminal to start the recording, and the recording ends after
another RETURN key.

- arecordmidi2: Add initial version

arecordmidi2 is a similar program like arecordmidi for recording the
incoming MIDI events, but storing in a MIDI Clip file for MIDI 2.0.

Most options are kept from arecordmidi, but some are dropped: namely,
the -l, -m and -f options are dropped for code simplicity.
Also -s option is dropped as well, as there is no need for split for
MIDI Clip file unlike SMF.

- aplaymidi2: Add initial version

aplaymidi2 is a program similar like aplaymidi, but intended for
playing back a MIDI Clip file that was introduced for handling UMP.
MIDI Clip file contains UMP packets, and its structure is much simpler
than SMF.

The options are mostly same as aplaymidi, but I omitted -l option for
simplifying the code.

aseqdump

- aseqdump: Add missing dump of UMP Set Key Signature Message

The handling of Set Key Signature message of the Flex Data type was
missing by some reason.  Now the definition was added in alsa-lib
ump_msg.h, so let's show the contents.

- aseqdump: Add dump of UMP Mixed Data Set messages

Add the support for yet more UMP messages.  UMP Mixed Data Set
messages are the generic data containers withe the message type 5
(shared with 8-bit SysEx).

- aseqdump: Use snd_ump_get_byte() helper

For simplifying code, use the new helper function snd_ump_get_byte()
for extracting a byte data for SysEx and co.

- aseqdump: Correct the limit of UMP 7-bit SysEx bytes

UMP 7-bit SysEx can hold up to 6 bytes, not 14 bytes.

- aseqdump: Avoid OOB access with broken SysEx UMP packets

UMP SysEx messages have length field to specify the contained data
bytes, but they can be over the actual packet size.  Add the proper
size limit checks for avoiding the access overflow.

- aseqdump: Support of UMP 8-bit SysEx messages

Add the support to dump UMP 8-bit SysEx messages.
A slight code refactoring to share the code snippet between 7bit and
8bit SysEx handling, too.

- aseqdump: Show SysEx prefix to UMP SysEx data dump

Show the event prefix "SysEx" for UMP SysEx data.  Otherwise it's
difficult to know what it is.

- aseqdump: Check the -u option value properly

Instead of passing the value as is, check the value passed to -u
option and bail out for bad values.

- aseqdump: Drop ifdef for UMP support

Now that the latest alsa-lib 1.2.12 is mandatory, drop the ugly
ifdefs.

- aseqdump: Fix bogus velocity value output in UMP MIDI2 mode

The printf format for a normalized velocity in MIDI2 mode had a typo,
resulting in a bogus value.  Fix it.

- aseqdump: Support of UMP Stream and Flex Data message types

Enhance aseqdump to interpret more UMP messages.  Now it includes the
standard  Stream messages and Flex Data messages.

- aseqdump: Refactor UMP SysEx dump

A slightly better version.  The extraction of a SysEx byte from a UMP
packet is more complicated than wished, in anyway.

- aseqdump: Show UMP SysEx messages

Dump the 7bit SysEx messages from UMP packets as well.

aseqsend

- change getopt_long return variable from char to int

Closes: https://github.com/alsa-project/alsa-utils/pull/275

- aseqsend: Simplify using the standard helper function

Use the standard MIDI event encoder function provided in alsa-lib and
simplify the code.  We can reduce a lot of lines.

- aseqsend: Move snd_seq_set_client_midi_version() call out of main()

Move the low-level API function call to init_seq() instead of calling
directly from main().  Just a code refactoring.

- aseqsend: Refine man page

Make man page a bit nicer; reformatting and setting bold/italic
properly, typo fixes, and adding a few more words and sections.

- aseqsend: Update the help texts for long options

The help text was forgotten to be updated for the new long options.
Updated now.

- aseqsend: Support long options

Add the support for long-style options such as --verbose.

- aseqsend: Support UMP mode

Add a new option -u to specify the UMP MIDI1 or MIDI2 mode.  As
default (-u 0), the program reads the legacy MIDI 1.0 byte stream,
while in UMP mode, it reads as UMP packets and send to the target.
The UMP packet bytes are encoded in big endian.

- aseqsend: Support realtime / system messages

The realtime / system messages (0xFx) wasn't handled properly.
Add the code to support those messages.

- aseqdump: White-space and slight code refactoring

Fix white spaces and applied a slight code refactoring to reduce the
indentation levels.  No code functionality changes.

gitcompile

- gitcompile: restore ACLOCAL_FLAGS ability to use

Fixes cryptic "error macro 'AM_PATH_ALSA' not found in library
configure.ac:22" when attempting a local install as described at
https://thesofproject.github.io/latest/getting_started/build-guide/build-from-scratch.html#build-alsa-lib-and-alsa-utils-from-source

Fixes giant commit f9e6010d5ec7 ("topology: plugins - add Intel nhlt
encoder plugin") which added a second invocation of `aclocal` in 2021
but forgot the extra `$alsa_m4_flags`.

To avoid duplication, do not fix by adding the missing `$alsa_m4_flags`
to the second aclocal invocation. Instead, drop that variable and append
`-I ../alsa-lib/utils` directly to $ACLOCAL_FLAGS

Closes: https://github.com/alsa-project/alsa-utils/pull/272

alsa-ucm-conf

Core

- bug: Fix verbose logging in GitHub Workflow

Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/202

Configuration

- USB-Audio: ALC4080 - change ID 26ce:0a08 to list multiple motherboards

The hardware id '26ce:0a08' seems to be re-used by multiple motherboards at ASRock.

Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/461

- USB-Audio: ALC4080: Add support for MSI MPG X870E CARBON (ID: 0db0:0b58)

```
$ lsusb | ag audio
Bus 003 Device 007: ID 0db0:0b58 Micro Star International USB Audio
```

```
Audio   Realtek® ALC4080 Codec
```
https://www.msi.com/Motherboard/MPG-X870E-CARBON-WIFI/Specification

Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/460

- USB-Audio: fix bracket location for If.motu-D828 - USB-Audio: add missing bracket for If.motu-D828

Closes: https://github.com/alsa-project/alsa-ucm-conf/issues/458

- USB-Audio: ALC4080 - add MSI X870 Tomahawk motherboard (ID 0db0:cd0e)

Closes: https://github.com/alsa-project/alsa-ucm-conf/issues/455

- ucm2: MediaTek: mt8395-evk: Add headset jack detection

Add headphone and headset microphone jack detection support on
mt8395-evk.

Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/456

- ucm2: MediaTek: mt8390-evk: Add headset jack detection

Add headphone and headset microphone jack detection support on
mt8390-evk.

Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/456

- ucm2: MediaTek: mt8370-evk: Add headset jack detection

Add headphone and headset microphone jack detection support on
mt8370-evk.

Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/456

- ucm2: MediaTek: mt8395-evk: Add dynamic configuration for

If mt8395-evk doesn't load the HDMI/DP dtbo, the 'unknown'
available status will be shown on the Ubuntu GNOME.
To solve this issue, add the dynamic configuration to detect
whether the system is loading HDMI/DP dtbo or not.
The HDMI/DP device would be configured only if the related
dtbo has been loaded by the system.

Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/456

- ucm2: MediaTek: mt8390-evk: Add dynamic configuration for

If mt8390-evk doesn't load the HDMI/DP dtbo, the 'unknown'
available status will be shown on the Ubuntu GNOME.
To solve this issue, add the dynamic configuration to detect
whether the system is loading HDMI/DP dtbo or not.
The HDMI/DP device would be configured only if the related
dtbo has been loaded by the system.

Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/456

- ucm2: MediaTek: mt8370-evk: Add dynamic configuration for

If mt8370-evk doesn't load the HDMI/DP dtbo, the 'unknown'
available status will be shown on the Ubuntu GNOME.
To solve this issue, add the dynamic configuration to detect
whether the system is loading HDMI/DP dtbo or not.
The HDMI/DP device would be configured only if the related
dtbo has been loaded by the system.

Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/456

- USB-Audio: ALC4080 - add ASRock X870E Taichi (ID 26ce:0a0b)

Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/457

- ucm2: Qualcomm: sm8650-qrd: fix codec initialisation

The lazy include of the four codec initialisation files are incorrectly
specified using the same identifier which means that only the last one
is actually included.

This specifically means that the Speakers and Headphone stereo mixer
elements are never defined and cannot be used for hardware volume
control.

The default Speaker digital volume is also never set by the BootSequence
as intended.

Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/454

- ucm2: Qualcomm: sm8650-mtp: fix codec initialisation

The lazy include of the two codec initialisation files are incorrectly
specified using the same identifier which means that only the last one
is actually included.

This specifically means that the Speakers stereo mixer element is never
defined and cannot be used for hardware volume control.

Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/454

- ucm2: Qualcomm: sm8550-hdk: fix codec initialisation

The lazy include of the four codec initialisation files are incorrectly
specified using the same identifier which means that only the last one
is actually included.

This specifically means that the Speakers and Headphone stereo mixer
elements are never defined and cannot be used for hardware volume
control.

The default Speaker digital volume is also never set by the BootSequence
as intended.

Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/454

- Revert "ucm2: Qualcomm: x1e80100: add USB DisplayPort

This reverts commit 1dcb58e4fac989bafe0705e49a7f029727207fb3.

The recently added DisplayPort support depends on kernel changes that
never made it upstream and has some usability issues that remain to be
resolved.

Revert for now to avoid breaking existing setups.

Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/453

- acppdmmach: add support for ACP 7.0

Starting with ACP 7.0 there is a generic 'acppdmmach' driver that
will be utilized.

Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/452

- sof-soundwire: Add sequence for controlling Mic Mute LED

Also ensure the unused microphone is disabled so that currently used mic
can fully control the LED.

Link: https://lore.kernel.org/alsa-devel/20241017122027.1207373-2-mstrozek@opensource.cirrus.com/

- sof-soundwire: Change map control names to make them unique and user friendly

Both 'Speaker Digital' and 'cs42l43 PDM2' names were found in other alsa
controls, confusing the MixerElems paths. Make them unique to avoid errors for
hardware mutes. Also add 'Capture' string into microphone controls to make
them work properly.

Link: https://lore.kernel.org/alsa-devel/20241017122027.1207373-1-mstrozek@opensource.cirrus.com/

- rt722: add mic led support

Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/443

- ucm2: wsa884x: fix typo in mixer names

DTS fix for x1e80100-CRD will be submitted upstream separately

Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/450

- ucm2: USB-Audio: add Steinberg UR22C (USB0499:172f)

Similar to UR24C and UR44C, but with 2 inputs 2 outputs.

Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/446

- USB-Audio: Add Roland Bridge Cast V2

Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/445

- ucm2: sof-soundwire: add RT1320 amplifier

Add support for rt1320 amplifier

Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/439

- ucm2: sof-soundwire: add rt712 VA device

Add support headphone/headset mic/speaker/dmic for rt712 VA

Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/435

- USB-Audio: Add support for Focusrite 4th Gen devices

Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/438

- ucm2: Intel: avs_nau8825 - reuse configurations

Move identical pieces to one file.

BugLink: https://github.com/alsa-project/alsa-ucm-conf/pull/418

- ucm2: Intel: avs: Add UCM files for HDMI configuration

Add configs for devices using HDMI codec.

Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/418

- ucm2: Intel: avs: Add UCM files for ssm4567 configuration

Add configs for devices using ssm4567 codec.

Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/418

- ucm2: Intel: avs: Add UCM files for rt5663 configuration

Add configs for devices using rt5663 codec.

Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/418

- ucm2: Intel: avs: Add UCM files for rt5514 configuration

Add configs for devices using rt5514 codec.

Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/418

- ucm2: Intel: avs: Add UCM files for nau8825 configuration

Add configs for devices using nau8825 codec.

Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/418

- ucm2: Intel: avs: Add UCM files for max98927 configuration

Add configs for devices using max98927 codec.

Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/418

- ucm2: Intel: avs: Add UCM files for max98373 configuration

Add configs for devices using max98373 codec.

Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/418

- ucm2: Intel: avs: Add UCM files for max98357a configuration

Add configs for devices using max98357a codec.

Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/418

- ucm2: Intel: avs: Add UCM files for da7219 configuration

Add configs for devices using da7219 codec.

Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/418

- ucm2: Intel: avs: Add UCM files for DMIC configuration

Add configs for devices using DMIC codec.

Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/418

- ucm2: sof-soundwire: Use the HdmiDevice macro for hdmi device creation

The duplicated code for the hdmi device creation can be removed by using
the HdmiDevice macro.

The macro needs Syntax 7 to work (variable as parameter support), update
the Syntax version of the file as well.

Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/413

- ucm2: Intel/sof-hda-dsp: Use the HdmiDevice macro for

The duplicated code for the hdmi device creation can be removed by using
the HdmiDevice macro.

The macro needs Syntax 7 to work (variable as parameter support), update
the Syntax version of the file as well.

Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/413

- ucm2: common: pcm: hdmi: Add new macro to conditionally

The new HdmiDevice macro can be used to create the hdmi PCM device for a
hardware PCM whose ID can be found in the Iec61937Devices comma separated
device ID list.
It is the caller's responsibility to pass correct device id of an HDMI PCM
as Dev.

The new macro needs Syntax 7 support.

Example for a use by sof-hda-dsp where the HDMI devices are 3, 4 and 5

Macro.0.HdmiDevice { Iec61937Devices "${var:Iec61937Pcms1}" Dev 3 Idx 0 }
Macro.1.HdmiDevice { Iec61937Devices "${var:Iec61937Pcms1}" Dev 4 Idx 1 }
Macro.2.HdmiDevice { Iec61937Devices "${var:Iec61937Pcms1}" Dev 5 Idx 2 }

If.HdmiIec61937 {
        Condition {
                Type RegexMatch
                Regex "((^|,)[345](,|$))"
                String "${var:Iec61937Pcms1}"
        }
        True.Macro.save_hdmi_cfg.HdmiPCMSave { Name "42-sof-hdmi" }
}

The Iec61937Pcms1 contains a match string of "5,4,3"

Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/413

- USB-Audio: Add support for Motu 828

Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/416

- common: pcm/split: add support up to 32 / 8 channels

MOTU 828 has up to 32 hardware channels. Add support for this
configuration to common/pcm/split.conf.

Also, add support for up to 8 channels for the abstact devices
(like 7.1 surround).

Note that this change requires recent alsa-lib (Syntax 7).

Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/417
Link: https://github.com/alsa-project/alsa-ucm-conf/pull/416

- USB-Audio: Add support for MOTU Ultralite mk5

Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/422

- Qualcomm: Add SM8550 HDK HiFi config

Add UCM2 configs for the Qualcomm SM8550-HDK Board to handle:
- on-board Speakers
- Headphones speakers
- Headphones Microphones
- Top and Bottom on-board Microphones

Tested with PulseAudio 16.1

Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/393

- codes: wcd938x: Add Analog Microphones 1 & 5 Sequences

Add Enable and Disable sequences for Analog microphones connected
to WCD989x Inputs 1 & 5.

Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/393

- USB-Audio: Add 0582:01d8 BOSS Katana HEAD MkII support

Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/430

- USB-Audio: Add support for Solid State Labs SSL 2+

Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/429

- ucm2/conf.d: add symlink for Qualcomm DB820c

Since the release 6.3 Linux kernel uses driver name apq8096 for Qualcomm
Dragonboard 820c. This makes alsaucm look for conf.d/apq8096/DB820c.conf
and then for conf.d/apq8096/apq8096.conf, while alsa-ucm-conf has
historical conf.d/DB820c/DB820c.conf symlink. Add symlink to provide
correct configuration for the device.

Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/428

- ucm2: Qualcomm: x1e80100: add Headset capture

Add device for recording via headset (AMIC2 analogue microphone).

Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/423

- ucm2: codecs: wcd938x: correct 'cset' command

Intention was to use 'cset':

  ALSA lib parser.c:1224:(parse_sequence) error: sequence command 'set' is ignored

Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/423

- ucm2: Qualcomm: x1e80100: add USB DisplayPort playback

Add two DisplayPort (over USB) playback devices, conflicting with the
headset, because they use the same Multimedia1 frontend.

Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/423

- USB-Audio: ALC4080: Add 0db0:543d MSI TRX40 Pro 10G

Closes: https://github.com/alsa-project/alsa-ucm-conf/issues/427

- sof-soundwire: Add support for cs42l43/cs35l56 bridge configuration

The cs42l43 has both a SPI master and an I2S interface, in some
configurations 2 cs35l56 amplifiers are connected to these to provide
bass speakers whilst the cs42l43's internal speaker drivers are used for
the tweeters. Add UCM configuration for this type of system.

- sof-soundwire: Add missing match for cs42l43 speakers

The cs42l43 reports as cs42l43-spk in the speaker case, the regex in
sof-soundwire needs updated to recognise that.

- sof-hda-dsp: Fix the case where sysfs dmi sys_vendor attribute is not set

BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=2292583

Description

- Release v1.2.13 - README: document the ALSA state file clearing

Link: https://github.com/alsa-project/alsa-ucm-conf/issues/425

Detailed changelog between 1.2.11 and 1.2.13 releases

Changelog between 1.2.11 and 1.2.13 releases

tinycompress

Core

- Release v1.2.13

Utilities

- ffplay: Use new ffmpeg channel layout API

AVCodecParameters.channels got removed in ffmpeg 7 in favour of the new
channel layout API.

https://github.com/FFmpeg/FFmpeg/commit/65ddc74988245a01421a63c5cffa4d900c47117c

Co-Authored-By: Antonio Rojas <arojas@archlinux.org>