Jack audio connection kit linux

Jack

JACK (https://jackaudio.org/) — сервер звуковых соединений, используемый при профессиональной работе со звуком. JACK позволяет разным приложениям обмениваться потоками звука с низкой задержкой в режиме «реального времени». Многие приложения для обработки звука поддерживают или даже требуют JACK. Например, наличие работающего JACK очень желательно при работе с DAW Ardour.

Одновременная работа JACK и PulseAudio невозможна и вряд ли будет возможна в обозримом будущем.

Установка JACK

$ sudo apt-get install jack-audio-connection-kit

Запуск JACK

Можно запустить JACK из командной строки, например, так:

jackd -dalsa -dhw:SB -r48000 -p1024 -n2

но лучше воспользоваться программой QJackCtl, предоставляющей дружественный к пользователю интерфейс для запуска и остановки JACK и имеющей разумные настройки «по умолчанию».

Управление соединениями JACK

Из визуальных редакторов соединений JACK в AltLinux есть Patchage. Кроме того, в QJackCtl встроен свой редактор графа соединений JACK, хотя и не такой красивый и удобный.

Альтоспецифичные проблемы

Cannot create RT messagebuffer thread: Operation not permitted (1)

Иногда запуск JACK сопровождается сообщениями: Cannot create RT messagebuffer thread: Operation not permitted (1)

Это означает, что у JACK нет возможности использовать режим «реального времени». Некоторые приложения (например, Ardour) без режима реального времени просто не будут работать.

Скорее всего, это связано с тем, что ядро собрано с настройкой CONFIG_RT_GROUP_SCHED=y (на момент создания страницы с этой опцией собирается, например, альтовое ядро std-def). В таких ядрах у приложений, запускаемых от непривилегированного пользователя, нет доступа к RT-возможностям планировщика, даже если соответствующее разрешение прописано через механизм limits, пока эта возможность явно не делегирована пользователю через механизм cgroups.

Проверить, какое у вас ядро, можно так:

sudo cat /boot/config-`uname -r` | grep CONFIG_RT_GROUP_SCHED

На проблемных ядрах эта команда выдаст

Убедиться, что cgroups не настроены и доступа к RT нет можно так:

(убедимся, что нет других причин, по которым мы не сможем работать в режиме «реального времени»),

(попробуем поменять приоритет).

На ядрах без CONFIG_RT_GROUP_SCHED=y пользователь увидит сообщение

а на ядрах с CONFIG_RT_GROUP_SCHED=y ошибку:

chrt: failed to set pid 0’s policy: Операция не позволена

Настроим через cgroups доступ к RT-возможностям планировщика ядра с помощью сервиса cgconfig (именно это решение рекомендуется авторами JACK). Для этого нужно поставить пакет cgroup, если он ещё не поставлен:

$ sudo apt-get install cgroup

дописать в /etc/cgconfig.conf:

после чего сделать сервисы cgred и cgconfig стартующими при запуске системы и перезагрузиться:

$ sudo systemctl enable cgred $ sudo systemctl enable cgconfig $ systemctl reboot

Теперь от пользователей, входящих в группу audio (убедитесь, что ваш пользователь в неё входит с помощью команды groups) JACK можно запускать в режиме «реального времени».

Источник

Downloading JACK

Nightly builds are available through JACK2 GitHub actions.

Читайте также:  Эмулятор старых консолей linux

Windows

  • 32bit installer: JACK 1.9.22 win32.
  • 64bit installer: JACK 1.9.22 win64.
  • Source tarball: JACK 1.9.22.

For Windows 7 or higher. 64bit builds provide mixed 32/64bit support.

Nightly builds are available through JACK2 GitHub actions.

JACK Source Code Repository

JACK uses Git as its source control system. Our central git repository is hosted by GitHub. We are currently working toward linking the repositories for JACK1 and JACK2 but this work is not complete, so for now the commands to get a copy of the source are a little different depending on which tree/version you want.

JACK2 Git Repository

Those without write access can access the repository with this command:

git clone https://github.com/jackaudio/jack2.git 

You can also point a web browser at

https://github.com/jackaudio/jack2 

to be able to browse current source code and full history with all the usual GitHub goodies.

Write Access

Those who have been granted write access and have supplied a public key can get to the repository with the following command:

git clone git@github.com:jackaudio/jack2.git 

JACK1 Git Repository

Those without write access can access the repository with these commands:

git clone https://github.com/jackaudio/jack1.git cd jack1 git submodule init git submodule update 

You can also point a web browser at

https://github.com/jackaudio/jack1 

to be able to browse current source code and full history with all the usual GitHub goodies.

Write Access

Those who have been granted write access and have supplied a public key can clone the repository with the following commands:

git clone git@github.com:jackaudio/jack1.git cd jack1 git submodule init git submodule update 

You must then edit the .git/config file within jack1 so that the submodule entries correctly reference the write-access URL. They should look like this:

[submodule "example-clients"] url = git@github.com:jackaudio/example-clients.git [submodule "jack"] url = git@github.com:jackaudio/headers.git [submodule "tools"] url = git@github.com:jackaudio/tools.git 

Eventually the same setup for the submodules will be required for both JACK2 and JACK1, but this is only the case for JACK1 at this time.

Slate theme maintained by pages-themes This site is open source. Improve this page

Источник

Introduction

JACK is a low-latency audio server, written for any operating system that is reasonably POSIX compliant. It currently exists for Linux, OS X, Solaris, FreeBSD and Windows. It can connect several client applications to an audio device, and allow them to share audio with each other. Clients can run as separate processes like normal applications, or within the JACK server as «plugins».

JACK was designed from the ground up for professional audio work, and its design focuses on two key areas: synchronous execution of all clients, and low latency operation.

JACK Overview

Traditionally it has been hard if not impossible to write audio applications that can share data with each other. In addition, configuring and managing audio interface hardware has often been one of the most complex aspect of writing audio software.

Читайте также:  Метка загрузочный astra linux

JACK changes all this by providing an API that does several things:

1. provides a high level abstraction for programmers that removes the audio interface hardware from the picture and allows them to concentrate on the core functionality of their software. 2. allows applications to send and receive audio data to/from each other as well as the audio interface. There is no difference in how an application sends or receives data regardless of whether it comes from/goes to another application or an audio interface.

For programmers with experience of several other audio APIs such as PortAudio, Apple’s CoreAudio, Steinberg’s VST and ASIO as well as many others, JACK presents a familiar model: your program provides a «callback» function that will be executed at the right time. Your callback can send and receive data as well as do other signal processing tasks. You are not responsible for managing audio interfaces or threading, and there is no «format negotiation»: all audio data within JACK is represented as 32 bit floating point values.

For those with experiences rooted in the Unix world, JACK presents a somewhat unfamiliar API. Most Unix APIs are based on the read/write model spawned by the «everything is a file» abstraction that Unix is rightly famous for. The problem with this design is that it fails to take the realtime nature of audio interfaces into account, or more precisely, it fails to force application developers to pay sufficient attention to this aspect of their task. In addition, it becomes rather difficult to facilitate inter-application audio routing when different programs are not all running synchronously.

Using JACK within your program is very simple, and typically consists of just:

  • calling jack_client_open() to connect to the JACK server.
  • registering «ports» to enable data to be moved to and from your application.
  • registering a «process callback» which will be called at the right time by the JACK server.
  • telling JACK that your application is ready to start processing data.

There is a lot more that you can do with JACK’s interfaces, but for many applications, this is all that is needed. The simple_client.c example demonstrates a complete (simple!) JACK application that just copies the signal arriving at its input port to its output port. Similarly, inprocess.c shows how to write an internal client «plugin» that runs within the JACK server process.

Reference

The JACK programming interfaces are described in several header files. We present them here broken into useful categories to make the API a little clearer:

  • Creating & manipulating clients
  • Setting Client Callbacks
  • Creating and managing client threads
  • Controlling & querying JACK server operation
  • Creating & manipulating ports
  • Looking up ports
  • Managing and determining latency
  • Handling time
  • Transport and Timebase control
  • Controlling error/information output
  • The non-callback API
  • Reading and writing MIDI data
  • Session API for clients.
  • managing support for newer/older versions of JACK
  • the API for starting and controlling a JACK server
  • Metadata API.
Читайте также:  Linux mint графический драйвер

The full API is described in:

  • is the main JACK interface.
  • provides interfaces for monitoring the performance of a running JACK server.
  • allows loading and unloading JACK internal clients.
  • defines a simple API for using lock-free ringbuffers. These are a good way to pass data between threads, when streaming realtime data to slower media, like audio file playback or recording.
  • defines a simple transport control mechanism for starting, stopping and repositioning clients. This is described in the JACK Transport Design document.
  • defines the main JACK data types.
  • functions standardize thread creation for JACK and its clients.
  • functions to handle reading and writing of MIDI data to a port
  • functions that form the JACK session API
  • the API for starting and controlling a JACK server
  • the API for managing metadata about objects within JACK (clients and ports)

In addition, the tools directory provides numerous examples of simple JACK clients that nevertheless use the API to do something useful. It includes

  • a metronome.
  • a recording client that can capture any number of channels from any JACK sources and store them as an audio file.
  • command line clients to control the transport mechanism, change the buffer size and more.
  • commands to load and unload JACK internal clients.
  • tools for checking the status of a running JACK system.

Porting

JACK is designed to be portable to any system supporting the relevant POSIX and ANSI C standards. It currently runs under GNU/Linux, Mac OS X and Berkeley Unix on several different processor architectures. If you want to port JACK to another platform, please read the Porting JACK document.

License

Copyright (C) 2001-2019 by Paul Davis, Stephane Letz, Jack O’Quinn, Torben Hohn, Filipe Coelho and others.

JACK is free software; you can redistribute it and/or modify it under the terms of the GNU GPL and LGPL licenses as published by the Free Software Foundation, http://www.gnu.org. The JACK server uses the GPL, as noted in the source file headers. However, the JACK library is licensed under the LGPL, allowing proprietary programs to link with it and use JACK services. You should have received a copy of these Licenses along with the program; if not, write to the Free Software Foundation, Inc., 59 Temple Place — Suite 330, Boston, MA 02111-1307, USA.

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.

Источник

Оцените статью
Adblock
detector