2000-08-31 11:21:05 +00:00
|
|
|
/*
|
|
|
|
* ALSA client/server header file
|
|
|
|
* Copyright (c) 2000 by Abramo Bagnara <abramo@alsa-project.org>
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or modify
|
2001-12-30 09:22:54 +00:00
|
|
|
* it under the terms of the GNU Lesser General Public License as
|
|
|
|
* published by the Free Software Foundation; either version 2.1 of
|
2000-08-31 11:21:05 +00:00
|
|
|
* 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
|
2001-12-30 09:22:54 +00:00
|
|
|
* GNU Lesser General Public License for more details.
|
2000-08-31 11:21:05 +00:00
|
|
|
*
|
2001-12-30 09:22:54 +00:00
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
2000-08-31 11:21:05 +00:00
|
|
|
* License along with this library; if not, write to the Free Software
|
2017-11-14 13:29:26 +00:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
2000-08-31 11:21:05 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2000-10-14 10:31:34 +00:00
|
|
|
#include "../src/pcm/pcm_local.h"
|
2001-02-12 23:51:49 +00:00
|
|
|
#include "../src/control/control_local.h"
|
2024-05-16 09:35:05 +00:00
|
|
|
#include <netdb.h>
|
2000-10-14 10:31:34 +00:00
|
|
|
|
2002-09-19 16:12:13 +00:00
|
|
|
int snd_receive_fd(int sock, void *data, size_t len, int *fd);
|
2001-03-29 17:50:28 +00:00
|
|
|
|
2001-02-05 15:44:42 +00:00
|
|
|
typedef enum _snd_dev_type {
|
|
|
|
SND_DEV_TYPE_PCM,
|
|
|
|
SND_DEV_TYPE_CONTROL,
|
|
|
|
SND_DEV_TYPE_RAWMIDI,
|
|
|
|
SND_DEV_TYPE_TIMER,
|
|
|
|
SND_DEV_TYPE_HWDEP,
|
|
|
|
SND_DEV_TYPE_SEQ,
|
|
|
|
} snd_dev_type_t;
|
|
|
|
|
|
|
|
typedef enum _snd_transport_type {
|
|
|
|
SND_TRANSPORT_TYPE_SHM,
|
|
|
|
SND_TRANSPORT_TYPE_TCP,
|
|
|
|
} snd_transport_type_t;
|
|
|
|
|
2002-10-12 11:49:53 +00:00
|
|
|
#define SND_PCM_IOCTL_HWSYNC _IO ('A', 0x22)
|
2000-12-22 14:03:01 +00:00
|
|
|
#define SND_PCM_IOCTL_STATE _IO ('A', 0xf1)
|
|
|
|
#define SND_PCM_IOCTL_MMAP _IO ('A', 0xf2)
|
|
|
|
#define SND_PCM_IOCTL_MUNMAP _IO ('A', 0xf3)
|
2001-04-13 15:40:53 +00:00
|
|
|
#define SND_PCM_IOCTL_MMAP_COMMIT _IO ('A', 0xf4)
|
2000-12-22 14:03:01 +00:00
|
|
|
#define SND_PCM_IOCTL_AVAIL_UPDATE _IO ('A', 0xf5)
|
|
|
|
#define SND_PCM_IOCTL_ASYNC _IO ('A', 0xf6)
|
|
|
|
#define SND_PCM_IOCTL_CLOSE _IO ('A', 0xf7)
|
|
|
|
#define SND_PCM_IOCTL_POLL_DESCRIPTOR _IO ('A', 0xf8)
|
2002-04-23 15:51:29 +00:00
|
|
|
#define SND_PCM_IOCTL_HW_PTR_FD _IO ('A', 0xf9)
|
|
|
|
#define SND_PCM_IOCTL_APPL_PTR_FD _IO ('A', 0xfa)
|
2003-02-22 17:19:02 +00:00
|
|
|
#define SND_PCM_IOCTL_FORWARD _IO ('A', 0xfb)
|
2002-04-23 15:51:29 +00:00
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
snd_pcm_uframes_t ptr;
|
|
|
|
int use_mmap;
|
|
|
|
off_t offset; /* for mmap */
|
|
|
|
int changed;
|
|
|
|
} snd_pcm_shm_rbptr_t;
|
2000-08-31 11:21:05 +00:00
|
|
|
|
|
|
|
typedef struct {
|
2000-09-26 09:46:05 +00:00
|
|
|
long result;
|
2000-08-31 11:21:05 +00:00
|
|
|
int cmd;
|
2002-04-23 15:51:29 +00:00
|
|
|
snd_pcm_shm_rbptr_t hw;
|
|
|
|
snd_pcm_shm_rbptr_t appl;
|
2000-08-31 11:21:05 +00:00
|
|
|
union {
|
2000-10-11 12:37:27 +00:00
|
|
|
struct {
|
|
|
|
int sig;
|
|
|
|
pid_t pid;
|
|
|
|
} async;
|
2000-08-31 11:21:05 +00:00
|
|
|
snd_pcm_info_t info;
|
2000-12-21 20:44:10 +00:00
|
|
|
snd_pcm_hw_params_t hw_refine;
|
2000-11-20 20:10:46 +00:00
|
|
|
snd_pcm_hw_params_t hw_params;
|
|
|
|
snd_pcm_sw_params_t sw_params;
|
2000-08-31 11:21:05 +00:00
|
|
|
snd_pcm_status_t status;
|
2002-10-12 10:38:43 +00:00
|
|
|
struct {
|
|
|
|
snd_pcm_uframes_t frames;
|
|
|
|
} avail;
|
2000-10-14 18:34:51 +00:00
|
|
|
struct {
|
2001-01-15 13:17:18 +00:00
|
|
|
snd_pcm_sframes_t frames;
|
2000-10-14 18:34:51 +00:00
|
|
|
} delay;
|
|
|
|
struct {
|
|
|
|
int enable;
|
|
|
|
} pause;
|
2000-08-31 11:21:05 +00:00
|
|
|
snd_pcm_channel_info_t channel_info;
|
2000-10-14 18:34:51 +00:00
|
|
|
struct {
|
2001-01-15 13:17:18 +00:00
|
|
|
snd_pcm_uframes_t frames;
|
2000-10-14 18:34:51 +00:00
|
|
|
} rewind;
|
2003-02-22 17:19:02 +00:00
|
|
|
struct {
|
|
|
|
snd_pcm_uframes_t frames;
|
|
|
|
} forward;
|
2000-10-14 18:34:51 +00:00
|
|
|
struct {
|
|
|
|
int fd;
|
|
|
|
} link;
|
|
|
|
struct {
|
2001-04-13 15:40:53 +00:00
|
|
|
snd_pcm_uframes_t offset;
|
2001-01-15 13:17:18 +00:00
|
|
|
snd_pcm_uframes_t frames;
|
2001-04-13 15:40:53 +00:00
|
|
|
} mmap_commit;
|
2002-04-23 15:51:29 +00:00
|
|
|
struct {
|
|
|
|
char use_mmap;
|
|
|
|
int shmid;
|
|
|
|
off_t offset;
|
|
|
|
} rbptr;
|
2000-08-31 11:21:05 +00:00
|
|
|
} u;
|
|
|
|
char data[0];
|
2000-10-14 10:31:34 +00:00
|
|
|
} snd_pcm_shm_ctrl_t;
|
2000-08-31 11:21:05 +00:00
|
|
|
|
2000-10-14 10:31:34 +00:00
|
|
|
#define PCM_SHM_SIZE sizeof(snd_pcm_shm_ctrl_t)
|
2000-08-31 11:21:05 +00:00
|
|
|
|
2000-12-22 14:03:01 +00:00
|
|
|
#define SND_CTL_IOCTL_READ _IOR('U', 0xf1, snd_ctl_event_t)
|
|
|
|
#define SND_CTL_IOCTL_CLOSE _IO ('U', 0xf2)
|
|
|
|
#define SND_CTL_IOCTL_POLL_DESCRIPTOR _IO ('U', 0xf3)
|
2001-02-09 11:20:31 +00:00
|
|
|
#define SND_CTL_IOCTL_ASYNC _IO ('U', 0xf4)
|
2000-09-11 15:49:10 +00:00
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
int result;
|
|
|
|
int cmd;
|
|
|
|
union {
|
2001-02-09 11:20:31 +00:00
|
|
|
struct {
|
|
|
|
int sig;
|
|
|
|
pid_t pid;
|
|
|
|
} async;
|
2000-11-30 19:17:55 +00:00
|
|
|
int device;
|
2001-02-13 21:29:30 +00:00
|
|
|
int subscribe_events;
|
|
|
|
snd_ctl_card_info_t card_info;
|
2001-02-09 11:20:31 +00:00
|
|
|
snd_ctl_elem_list_t element_list;
|
|
|
|
snd_ctl_elem_info_t element_info;
|
2001-02-11 15:45:35 +00:00
|
|
|
snd_ctl_elem_value_t element_read;
|
|
|
|
snd_ctl_elem_value_t element_write;
|
2001-04-19 13:53:08 +00:00
|
|
|
snd_ctl_elem_id_t element_lock;
|
|
|
|
snd_ctl_elem_id_t element_unlock;
|
2000-09-11 15:49:10 +00:00
|
|
|
snd_hwdep_info_t hwdep_info;
|
|
|
|
snd_pcm_info_t pcm_info;
|
|
|
|
int pcm_prefer_subdevice;
|
|
|
|
snd_rawmidi_info_t rawmidi_info;
|
2000-10-30 12:15:18 +00:00
|
|
|
int rawmidi_prefer_subdevice;
|
2001-09-26 13:57:04 +00:00
|
|
|
unsigned int power_state;
|
2000-09-11 15:49:10 +00:00
|
|
|
snd_ctl_event_t read;
|
|
|
|
} u;
|
|
|
|
char data[0];
|
2000-10-14 10:31:34 +00:00
|
|
|
} snd_ctl_shm_ctrl_t;
|
2000-09-11 15:49:10 +00:00
|
|
|
|
|
|
|
#define CTL_SHM_SIZE 65536
|
2000-10-14 10:31:34 +00:00
|
|
|
#define CTL_SHM_DATA_MAXLEN (CTL_SHM_SIZE - offsetof(snd_ctl_shm_ctrl_t, data))
|
2000-09-11 15:49:10 +00:00
|
|
|
|
2000-08-31 11:21:05 +00:00
|
|
|
typedef struct {
|
|
|
|
unsigned char dev_type;
|
|
|
|
unsigned char transport_type;
|
|
|
|
unsigned char stream;
|
|
|
|
unsigned char mode;
|
|
|
|
unsigned char namelen;
|
|
|
|
char name[0];
|
|
|
|
} snd_client_open_request_t;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
long result;
|
2000-08-31 13:31:46 +00:00
|
|
|
int cookie;
|
2000-08-31 11:21:05 +00:00
|
|
|
} snd_client_open_answer_t;
|
|
|
|
|