mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
spa: fix ALSA UMP support detection in meson
This commit is contained in:
parent
2167945eff
commit
4f077e1f27
3 changed files with 15 additions and 9 deletions
|
|
@ -46,6 +46,10 @@ if get_option('spa-plugins').allowed()
|
||||||
alsa_dep = dependency('alsa', version : '>=1.2.6', required: get_option('alsa'))
|
alsa_dep = dependency('alsa', version : '>=1.2.6', required: get_option('alsa'))
|
||||||
summary({'ALSA': alsa_dep.found()}, bool_yn: true, section: 'Backend')
|
summary({'ALSA': alsa_dep.found()}, bool_yn: true, section: 'Backend')
|
||||||
|
|
||||||
|
if alsa_dep.version().version_compare('>=1.2.10')
|
||||||
|
cdata.set('HAVE_ALSA_UMP', true)
|
||||||
|
endif
|
||||||
|
|
||||||
bluez_dep = dependency('bluez', version : '>= 4.101', required: get_option('bluez5'))
|
bluez_dep = dependency('bluez', version : '>= 4.101', required: get_option('bluez5'))
|
||||||
bluez_gio_dep = dependency('gio-2.0', required : get_option('bluez5'))
|
bluez_gio_dep = dependency('gio-2.0', required : get_option('bluez5'))
|
||||||
bluez_gio_unix_dep = dependency('gio-unix-2.0', required : get_option('bluez5'))
|
bluez_gio_unix_dep = dependency('gio-unix-2.0', required : get_option('bluez5'))
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ static int seq_open(struct seq_state *state, struct seq_conn *conn, bool with_qu
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef ALSA_UMP
|
#ifdef HAVE_ALSA_UMP
|
||||||
res = snd_seq_set_client_midi_version(conn->hndl, SND_SEQ_CLIENT_UMP_MIDI_2_0);
|
res = snd_seq_set_client_midi_version(conn->hndl, SND_SEQ_CLIENT_UMP_MIDI_2_0);
|
||||||
#else
|
#else
|
||||||
res = -EOPNOTSUPP;
|
res = -EOPNOTSUPP;
|
||||||
|
|
@ -223,7 +223,7 @@ static void alsa_seq_on_sys(struct spa_source *source)
|
||||||
const snd_seq_addr_t *addr;
|
const snd_seq_addr_t *addr;
|
||||||
|
|
||||||
if (state->ump) {
|
if (state->ump) {
|
||||||
#if ALSA_UMP
|
#ifdef HAVE_ALSA_UMP
|
||||||
snd_seq_ump_event_t *ump_ev;
|
snd_seq_ump_event_t *ump_ev;
|
||||||
|
|
||||||
res = snd_seq_ump_event_input(state->sys.hndl, &ump_ev);
|
res = snd_seq_ump_event_input(state->sys.hndl, &ump_ev);
|
||||||
|
|
@ -583,7 +583,7 @@ static int process_read(struct seq_state *state)
|
||||||
struct seq_port *port;
|
struct seq_port *port;
|
||||||
uint64_t ev_time, diff;
|
uint64_t ev_time, diff;
|
||||||
uint32_t offset;
|
uint32_t offset;
|
||||||
#ifdef ALSA_UMP
|
#ifdef HAVE_ALSA_UMP
|
||||||
snd_seq_ump_event_t *ump_ev;
|
snd_seq_ump_event_t *ump_ev;
|
||||||
#endif
|
#endif
|
||||||
uint8_t *midi1_ptr;
|
uint8_t *midi1_ptr;
|
||||||
|
|
@ -591,7 +591,7 @@ static int process_read(struct seq_state *state)
|
||||||
uint64_t ump_state = 0;
|
uint64_t ump_state = 0;
|
||||||
|
|
||||||
if (state->ump) {
|
if (state->ump) {
|
||||||
#ifdef ALSA_UMP
|
#ifdef HAVE_ALSA_UMP
|
||||||
res = snd_seq_ump_event_input(state->event.hndl, &ump_ev);
|
res = snd_seq_ump_event_input(state->event.hndl, &ump_ev);
|
||||||
if (res <= 0)
|
if (res <= 0)
|
||||||
break;
|
break;
|
||||||
|
|
@ -627,7 +627,7 @@ static int process_read(struct seq_state *state)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (state->ump) {
|
if (state->ump) {
|
||||||
#ifdef ALSA_UMP
|
#ifdef HAVE_ALSA_UMP
|
||||||
data = (uint32_t*)&ump_ev->ump[0];
|
data = (uint32_t*)&ump_ev->ump[0];
|
||||||
size = spa_ump_message_size(snd_ump_msg_hdr_type(ump_ev->ump[0])) * 4;
|
size = spa_ump_message_size(snd_ump_msg_hdr_type(ump_ev->ump[0])) * 4;
|
||||||
#else
|
#else
|
||||||
|
|
@ -783,7 +783,7 @@ static int process_write(struct seq_state *state)
|
||||||
SPA_POD_SEQUENCE_FOREACH(pod, c) {
|
SPA_POD_SEQUENCE_FOREACH(pod, c) {
|
||||||
snd_seq_event_t *ev;
|
snd_seq_event_t *ev;
|
||||||
snd_seq_event_t midi1_ev;
|
snd_seq_event_t midi1_ev;
|
||||||
#ifdef ALSA_UMP
|
#ifdef HAVE_ALSA_UMP
|
||||||
snd_seq_ump_event_t ump_ev;
|
snd_seq_ump_event_t ump_ev;
|
||||||
#endif
|
#endif
|
||||||
size_t body_size;
|
size_t body_size;
|
||||||
|
|
@ -796,7 +796,7 @@ static int process_write(struct seq_state *state)
|
||||||
body_size = SPA_POD_BODY_SIZE(&c->value);
|
body_size = SPA_POD_BODY_SIZE(&c->value);
|
||||||
|
|
||||||
if (state->ump) {
|
if (state->ump) {
|
||||||
#ifdef ALSA_UMP
|
#ifdef HAVE_ALSA_UMP
|
||||||
spa_zero(ump_ev);
|
spa_zero(ump_ev);
|
||||||
memcpy(ump_ev.ump, body, SPA_MIN(sizeof(ump_ev.ump), (size_t)body_size));
|
memcpy(ump_ev.ump, body, SPA_MIN(sizeof(ump_ev.ump), (size_t)body_size));
|
||||||
ev = (snd_seq_event_t *)&ump_ev;
|
ev = (snd_seq_event_t *)&ump_ev;
|
||||||
|
|
@ -835,7 +835,7 @@ static int process_write(struct seq_state *state)
|
||||||
ev->type, out_time, c->offset, body_size, port->addr.client, port->addr.port);
|
ev->type, out_time, c->offset, body_size, port->addr.client, port->addr.port);
|
||||||
|
|
||||||
if (state->ump) {
|
if (state->ump) {
|
||||||
#ifdef ALSA_UMP
|
#ifdef HAVE_ALSA_UMP
|
||||||
if ((err = snd_seq_ump_event_output(state->event.hndl, &ump_ev)) < 0) {
|
if ((err = snd_seq_ump_event_output(state->event.hndl, &ump_ev)) < 0) {
|
||||||
spa_log_warn(state->log, "failed to output event: %s",
|
spa_log_warn(state->log, "failed to output event: %s",
|
||||||
snd_strerror(err));
|
snd_strerror(err));
|
||||||
|
|
|
||||||
|
|
@ -12,8 +12,10 @@ extern "C" {
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
#include <alsa/asoundlib.h>
|
#include <alsa/asoundlib.h>
|
||||||
#ifdef ALSA_UMP
|
#ifdef HAVE_ALSA_UMP
|
||||||
#include <alsa/ump_msg.h>
|
#include <alsa/ump_msg.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue