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.
Fixes: 6d1d620ead ("pcm: dmix: resume workaround for buggy driver")
Reported-and-tested-by: Chancel Liu <chancel.liu@nxp.com>
Closes: https://lore.kernel.org/DB9PR04MB94988752ED7C43B399E0BC00E3942@DB9PR04MB9498.eurprd04.prod.outlook.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
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
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Add the NULL check for ump_endpoint_info and ump_block_info calls.
Those can be NULl depending on the target.
Fixes: 81b0cf46d1 ("control: Add UMP Endpoint and Block info query support")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The right function name is snd_seq_has_queue_tempo_base().
Fixes: 24c7f42733 ("seq: Add API functions to set different tempo base values")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
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.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Mixed Data Set messages is another messages of the type 5
(SND_UMP_MSG_TYPE_EXTENDED_DATA) with the status 8 and 9.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
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.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
There was a typo in snd_ump_msg_flex_data_t definition; it should be
"set_metronome".
Fixes: 30f8ba74c5 ("ump_msg: Add definitions for Utility, Stream and Flex Data messages")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
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.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
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.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
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.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This patch provides more struct / union definitions for UMP Utility,
Stream and Flex Data messages, provided in the new UMP v1.1
specification.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
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.
Fixes: 040356ecf0 ("ump: Add helpers to parse / set UMP packet data")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Correct the lack of markers and missing comments for some unions.
Fixes: 040356ecf0 ("ump: Add helpers to parse / set UMP packet data")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The usage of \section and \subsection were wrong in the previous
commit, where the tags were missing.
Fixes: 3390f31664 ("seq: Add description about MIDI 2.0 and UMP handling")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Fix a typo that caused a doxygen error.
Fixes: 6767f623ca ("ump: Add missing *_set variants for snd_ump_endpoint_info and snd_ump_block_info")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
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.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
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.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
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.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Improve the shutdown order for the asynchronous users. There may be
unhandled signals, because the signal is reset before signal deactivation
using fnctl (O_ASYNC).
Closes: https://github.com/alsa-project/alsa-lib/issues/394
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Use the appropriate variable for access/eaccess call.
Fixes: https://github.com/alsa-project/alsa-lib/issues/395
Fixes: ef6463a2 ("ucm: fix Path condition - substitute Path and Mode fields")
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
The hdmi.conf contains the high level macro to be used by cards to create
the hdmi: device.
Instead of including it in different config files, include it in the main
aliases.conf and remove it's inclusion by other config files.
This change is needed to add support for the hdmi: device mapping via UCM.
Closes: https://github.com/alsa-project/alsa-lib/pull/393
Suggested-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This device is just an external USB soundcard with a female 3.5mm jack
for a headset, no S/PDIF | IEC958 connector. Add it to the blacklist to
prevent it being opened.
Link: https://lore.kernel.org/alsa-devel/ZeWGbxZIc7AF96h0@m.b4.vu/
Signed-off-by: David Senoner <seda18@rolmail.net>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Try to explain more the output value and its relation between
format and sample bits defined by the format.
Link: https://github.com/larsimmisch/pyalsaaudio/pull/146
Signed-off-by: Jaroslav Kysela <perex@perex.cz>