Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
167 lines (130 sloc) 6.41 KB

% Untitled presentation % Takashi SAKAMOTO (坂本 貴史) % \today

This is written for Audio Mini conference 2018. For my convenience, this presentation includes two themes.

  1. Integrating the ALSA control core
  2. Another approach to produce language bindings by GObject Introspection.

This presentation is available in my github repository.

Integrating the ALSA control core

issues for which I work

  • Obsolete 'dimen' member in container for information to an element
  • Limitation on a container for value array to an element
  • User-defined element set left by finished process
  • Restriction for the number of user-defined control element set per sound card

Obsolete 'dimen' member in container for information to an element

Limitation on a container for value array to an element

  • The number of items in value array of struct snd_ctl_elem_value has limitation.
    • 64: for integer64 type
    • 128: integer/enumerated type
    • 512: bytes type
  • Some developers would like to program their drivers to handle more number of items.
  • Stop abusing TLV feature, developers in ALSA SoC part

Planned roadmap 1/4

Planned roadmap 2/4

Planned roadmap 3/4

  • Handle larger data via ELEM_READ/ELEM_WRITE
    • Not yet prepared.
    • use kernel virtual space, instead of kernel logical space
      • currently memdup_user() is used (slab allocator in kernel logical space)
      • page fault is allowed in process context
    • structure layout issue
      • unused tstamp member in tail of the structure, can be obsoleted
      • unused SNDRV_CTL_ELEM_ACCESS_TIMESTAMP flag can be obsoleted

struct snd_ctl_elem_value

struct snd_ctl_elem_value {
  struct snd_ctl_elem_id id;
  unsigned int indirect: 1;
  union {
    ...
  } value;
  struct timespec tstamp;
  unsigned char reserved[128-sizeof(struct timespec)];
};

Planned roadmap 4/4

  • band-aid for ALSA SoC part
  • it's the worst idea to upload binary blob via ALSA control character device
    • even if it includes initialization data for coefficiencies
    • use hwdep interface for this purpose, anyway

User-defined element set left by finished process

Restriction for the number of user-defined control element set per sound card

  • As of v4.20, one sound card instance can have 32 sets of control element set
  • This is a bit small to register control element sets required for some devices
    • audio and music units on IEEE 1394 bus for studio purpose; e.g. solo/mute/gain/balance for multiplexer inputs to multiplexer outputs up to 32 channels

Another approach to produce language bindings by GObject Introspection.

PyAlsa

GObject Introspection (gi)

  • https://gi.readthedocs.io/en/latest/
  • GObject introspection is a middleware layer between C libraries (using GObject) and language bindings.
  • The C library can be scanned at compile time and generate metadata files, in addition to the actual native C library.
  • Then language bindings can read this metadata and automatically provide bindings to call into the C library.

Existent bindings for any languages based on g-i

An example; libhinawa and hinawa-utils

  • I'm an author of modules in ALSA firewire stack (sound/firewire/*)
    • Application of IEEE 1394, IEEE 1212, IEC 61883-1/6, AV/C commands defined by 1394TA and many vendor-specific protocols
  • There's few tools to assist my work
  • I need to build tools to assist this work.
  • [alsa-devel] hinawa-utils v0.1.0 and libhinawa v1.0.0 release

mockup; alsa-gi

  • https://github.com/takaswie/alsa-gi
  • an application of asound.h and asequencer.h in Linux UAPI
  • I developed this to test my work to fix ALSA ctl/seq core
  • I'm not active because no time to it
You can’t perform that action at this time.