summaryrefslogtreecommitdiff
path: root/include/sound/seq_kernel.h
AgeCommit message (Collapse)Author
2023-05-23ALSA: seq: Add UMP supportTakashi Iwai
Starting from this commit, we add the basic support of UMP (Universal MIDI Packet) events on ALSA sequencer infrastructure. The biggest change here is that, for transferring UMP packets that are up to 128 bits, we extend the data payload of ALSA sequencer event record when the client is declared to support for the new UMP events. A new event flag bit, SNDRV_SEQ_EVENT_UMP, is defined and it shall be set for the UMP packet events that have the larger payload of 128 bits, defined as struct snd_seq_ump_event. For controlling the UMP feature enablement in kernel, a new Kconfig, CONFIG_SND_SEQ_UMP is introduced. The extended event for UMP is available only when this Kconfig item is set. Similarly, the size of the internal snd_seq_event_cell also increases (in 4 bytes) when the Kconfig item is set. (But the size increase is effective only for 32bit architectures; 64bit archs already have padding there.) Overall, when CONFIG_SND_SEQ_UMP isn't set, there is no change in the event and cell, keeping the old sizes. For applications that want to access the UMP packets, first of all, a sequencer client has to declare the user-protocol to match with the latest one via the new SNDRV_SEQ_IOCTL_USER_PVERSION; otherwise it's treated as if a legacy client without UMP support. Then the client can switch to the new UMP mode (MIDI 1.0 or MIDI 2.0) with a new field, midi_version, in snd_seq_client_info. When switched to UMP mode (midi_version = 1 or 2), the client can write the UMP events with SNDRV_SEQ_EVENT_UMP flag. For reads, the alignment size is changed from snd_seq_event (28 bytes) to snd_seq_ump_event (32 bytes). When a UMP sequencer event is delivered to a legacy sequencer client, it's ignored or handled as an error. Conceptually, ALSA sequencer client and port correspond to the UMP Endpoint and Group, respectively; each client may have multiple ports and each port has the fixed number (16) of channels, total up to 256 channels. As of this commit, ALSA sequencer core just sends and receives the UMP events as-is from/to clients. The automatic conversions between the legacy events and the new UMP events will be implemented in a later patch. Along with this commit, bump the sequencer protocol version to 1.0.3. Reviewed-by: Jaroslav Kysela <perex@perex.cz> Link: https://lore.kernel.org/r/20230523075358.9672-26-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2023-05-23ALSA: seq: Add snd_seq_expand_var_event_at() helperTakashi Iwai
Create a new variant of snd_seq_expand_var_event() for expanding the data starting from the given byte offset. It'll be used by the new UMP sequencer code later. Reviewed-by: Jaroslav Kysela <perex@perex.cz> Link: https://lore.kernel.org/r/20230523075358.9672-19-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2019-05-30treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156Thomas Gleixner
Based on 1 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license as published by the free software foundation either version 2 of the license or at your option any later version this program is distributed in the hope that it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details you should have received a copy of the gnu general public license along with this program if not write to the free software foundation inc 59 temple place suite 330 boston ma 02111 1307 usa extracted by the scancode license scanner the SPDX license identifier GPL-2.0-or-later has been chosen to replace the boilerplate/reference in 1334 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Allison Randal <allison@lohutok.net> Reviewed-by: Richard Fontana <rfontana@redhat.com> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190527070033.113240726@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-12ALSA: seq: Simplify snd_seq_kernel_client_enqueue() helperTakashi Iwai
We have two helpers for queuing a sequencer event from the kernel client, and both are used only from OSS sequencer layer without any hop and atomic set. Let's simplify and unify two helpers into one. No functional change, just a call pattern change. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-11-06ALSA: seq: Avoid invalid lockdep class warningTakashi Iwai
The recent fix for adding rwsem nesting annotation was using the given "hop" argument as the lock subclass key. Although the idea itself works, it may trigger a kernel warning like: BUG: looking up invalid subclass: 8 .... since the lockdep has a smaller number of subclasses (8) than we currently allow for the hops there (10). The current definition is merely a sanity check for avoiding the too deep delivery paths, and the 8 hops are already enough. So, as a quick fix, just follow the max hops as same as the max lockdep subclasses. Fixes: 1f20f9ff57ca ("ALSA: seq: Fix nested rwsem annotation for lockdep splat") Reported-by: syzbot <syzkaller@googlegroups.com> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-02-12ALSA: seq: Drop snd_seq_autoload_lock() and _unlock()Takashi Iwai
The autoload lock became already superfluous due to the recent rework of autoload code. Let's drop them now. This allows us to simplify a few codes nicely. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-01-26ALSA: seq: increase the maximum number of queuesClemens Ladisch
Queues are used both for scheduling playback events and for assigning timestamps to recorded events, so it is easy to need quite a lot of them, especially on a multi-user system. Additionally, the actual queue objects are allocated dynamically, so it does not really make sense to have a low limit. Increase it to something still sane. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-01-26ALSA: seq: remove unused callback_all fieldClemens Ladisch
Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2015-01-26ALSA: seq: remove unused symbolsClemens Ladisch
Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-10-18ALSA: seq: bind seq driver automaticallyTakashi Iwai
Currently the sequencer module binding is performed independently from the card module itself. The reason behind it is to keep the sequencer stuff optional and allow the system running without it (e.g. for using PCM or rawmidi only). This works in most cases, but a remaining problem is that the binding isn't done automatically when a new driver module is probed. Typically this becomes visible when a hotplug driver like usb audio is used. This patch tries to address this and other potential issues. First, the seq-binder (seq_device.c) tries to load a missing driver module at creating a new device object. This is done asynchronously in a workq for avoiding the deadlock (modprobe call in module init path). This action, however, should be enabled only when the sequencer stuff was already initialized, i.e. snd-seq module was already loaded. For that, a new function, snd_seq_autoload_init() is introduced here; this clears the blocking of autoloading, and also tries to load all pending driver modules. Reported-by: Adam Goode <agoode@chromium.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-10-02UAPI: (Scripted) Convert #include "..." to #include <path/...> in kernel ↵David Howells
system headers Convert #include "..." to #include <path/...> in kernel system headers. Signed-off-by: David Howells <dhowells@redhat.com> Acked-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Acked-by: Dave Jones <davej@redhat.com>
2011-10-31treewide: use __printf not __attribute__((format(printf,...)))Joe Perches
Standardize the style for compiler based printf format verification. Standardized the location of __printf too. Done via script and a little typing. $ grep -rPl --include=*.[ch] -w "__attribute__" * | \ grep -vP "^(tools|scripts|include/linux/compiler-gcc.h)" | \ xargs perl -n -i -e 'local $/; while (<>) { s/\b__attribute__\s*\(\s*\(\s*format\s*\(\s*printf\s*,\s*(.+)\s*,\s*(.+)\s*\)\s*\)\s*\)/__printf($1, $2)/g ; print; }' [akpm@linux-foundation.org: revert arch bits] Signed-off-by: Joe Perches <joe@perches.com> Cc: "Kirill A. Shutemov" <kirill@shutemov.name> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-07-10ALSA: remove CONFIG_KMOD from soundJohannes Berg
A bunch of things in alsa depend on CONFIG_KMOD, use CONFIG_MODULES instead where the dependency is needed at all. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2006-01-03[ALSA] seq: set client name in snd_seq_create_kernel_client()Clemens Ladisch
All users of snd_seq_create_kernel_client() have to set the client name anyway, so we can just pass the name as parameter. This relieves us from having to muck around with a struct snd_seq_client_info in these cases. Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2006-01-03[ALSA] seq: remove struct snd_seq_client_callbackClemens Ladisch
The fields of struct snd_seq_client_callback either aren't used or are always set to the same value, so we can get rid of it altogether. Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2006-01-03[ALSA] Remove xxx_t typedefs: SequencerTakashi Iwai
Modules: ALSA sequencer Remove xxx_t typedefs from the core sequencer codes. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2004-10-07Merge suse.cz:/home/perex/bk/linux-sound/linux-soundJaroslav Kysela
into suse.cz:/home/perex/bk/linux-sound/work
2004-10-07[ALSA] Fix typoJaroslav Kysela
ALSA sequencer Fixed a typo for snd_seq_autoload_lock() in the last change (only for the case without CONFIG_KMOD). Signed-off-by: Takashi Iwai <tiwai@suse.de>
2004-10-07[ALSA] Fix dead blocking during module_init()Jaroslav Kysela
ALSA sequencer,ALSA<-OSS sequencer Fixed the auto-loading of modules during module_init(). Signed-off-by: Takashi Iwai <tiwai@suse.de>
2004-10-05Fix up signed one-bit bitfields in core sound codeLinus Torvalds
2004-06-16Merge suse.cz:/home/perex/bk/linux-sound/linux-2.5Jaroslav Kysela
into suse.cz:/home/perex/bk/linux-sound/linux-sound
2004-06-03[PATCH] sparse: rest of sound/coreAlexander Viro
The rest of sond/core annotated; reverted bogus addition of __user in snd_seq_kernel_client_ctl() - I should've guessed from the name alone ;-)
2004-05-28ALSA CVS update - Clemens Ladisch <clemens@ladisch.de>Jaroslav Kysela
ALSA sequencer,ALSA<-OSS sequencer export snd_seq_set_queue_tempo() for OSS to prevent calling snd_seq_kernel_client_ctl() (using copy_from_user()) in interrupt context
2004-01-08ALSA CVS update - Takashi Iwai <tiwai@suse.de>Jaroslav Kysela
ALSA sequencer - new e-mail address of Frank van de Pol.
2003-05-13Add a few initial user pointer annotations to sound driver.Linus Torvalds
Quite a few suspicious places here that pass kernel pointers to the internal ioctl engine.
2003-03-20ALSA update (0.9.2)Jaroslav Kysela
- created snd-page-alloc module - moved all page allocation code there - preserves preallocated DMA buffers for devices - USB audio driver updated - AC'97 - better modem initialization code - timer API - enhanced (added pause and more event notifications) - splitted ice1724 code from ice1712 to own module - general - timerstamp cleanups (timeval -> timespec) - C99-like cleanups - trident driver - more workaround for wrong IRQ acks - OSS sequencer emulation - fixed OOPS (wrong free order) - more compatible with level 1 of sequencer (/dev/sequencer) - CS46xx driver updated - intel8x0 driver updated - emu10k1 driver updated
2003-02-08ALSA updateJaroslav Kysela
- cmipci driver cleanups (ac3 & surround) - replaced snd_dma_residue() with snd_dma_pointer() - GCC 3.3 warnings removal - timer interface - recoded using tasklet - improved slave timer locking (should be much faster) - added async support - improved ioctl32 wrapper functions - fixed Makefile problems (synth modules were build for not selected driver) - AC97 codec - improved SPSA control - moved reset function outside the main init code - improved ALC650 initialization - USB driver - added quirk for Roland XV-2020
2002-04-28[PATCH] ALSA PATCH against ChangeSet 1.567Jaroslav Kysela
Hello, this ALSA patch contains: - fixed sound_core.c - devfs names - added ARM driver for H3x00 iPaq handhelds from Compaq - added RME Digi32 driver - increased number of RawMidi devices per card to 8 - removed unimplemented IPC definitions from asequencer.h - compilation fixes for snd_printk/snd_printd - added snd_midi_event_no_status() function to seq_midi_event.c - used in OSS emulation code to follow OSS/Lite behaviour - fixed snd_pcm_playback_silence() function (possible memory leak) - fixed endless loop in snd_pcm_playback_drain() - OSS applications using mmap() should end correctly now - fixed autoloading of sequencer clients (oops) - fixed virmidi code (emu10k1) - improved OPL4 chip detection - fixed deadlock in sound/i2c.h - improved cs8427 chip support (proper initialization) - improved CMI8330 detection - improved S/PDIF detection in ENS1371 driver - fixed possible NULL pointer dereference in FM801 driver - added ICH4 to intel8x0 driver - fixed port names allocation in intel8x0 driver - fixed rate detection in intel8x0 driver - AC97 code - better initialization for wolfson codecs - improved CS4205 support (special S/PDIF handling) - emu10k1/audigy updates Jaroslav
2002-02-18[PATCH] ALSA update for 2.5.5-pre1Jaroslav Kysela
this is a sync with the current ALSA CVS tree (last code modification: (Sun Feb 17 17:46:41 2002 UTC)) and 2.5.5-pre1 code and contains: - ALSA code version 0.9.0beta11 - Config.in files updated (separated associated drivers to submenus) - global sound/Makefile fixes - added inclusion of missing header files for alpha architecture - fixed power functions (bad locking) - fixed copy_to_user calls (removed them from spinlocks) - fixed freeing of resource structures - fixed AD1816A driver (inverted volume controls) - added new functions to allocate ISA DMA memory (cleanups in ISA drivers) - updated ISA PnP detection in wavefront driver - added joystick support for VIA686 - updated ES1968 (Maestro2) driver - moved joystick support for YMFPCI to the control interface - updated Korg1212 driver
2002-02-12[PATCH] ALSA patch for 2.5.4Jaroslav Kysela
Integrate ALSA into v2.5.4 Jaroslav