mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-10 13:30:01 -05:00
First step toward encapsulation
This commit is contained in:
parent
d44c657826
commit
70809b1835
13 changed files with 997 additions and 391 deletions
|
|
@ -244,8 +244,8 @@ int snd_pcm_link(snd_pcm_t *pcm1, snd_pcm_t *pcm2)
|
|||
int fd2 = snd_pcm_link_descriptor(pcm2);
|
||||
if (fd1 < 0 || fd2 < 0)
|
||||
return -ENOSYS;
|
||||
if (ioctl(fd1, SND_PCM_IOCTL_LINK, fd2) < 0) {
|
||||
SYSERR("SND_PCM_IOCTL_LINK failed");
|
||||
if (ioctl(fd1, SNDRV_PCM_IOCTL_LINK, fd2) < 0) {
|
||||
SYSERR("SNDRV_PCM_IOCTL_LINK failed");
|
||||
return -errno;
|
||||
}
|
||||
return 0;
|
||||
|
|
@ -262,8 +262,8 @@ int snd_pcm_unlink(snd_pcm_t *pcm)
|
|||
default:
|
||||
return -ENOSYS;
|
||||
}
|
||||
if (ioctl(fd, SND_PCM_IOCTL_UNLINK) < 0) {
|
||||
SYSERR("SND_PCM_IOCTL_UNLINK failed");
|
||||
if (ioctl(fd, SNDRV_PCM_IOCTL_UNLINK) < 0) {
|
||||
SYSERR("SNDRV_PCM_IOCTL_UNLINK failed");
|
||||
return -errno;
|
||||
}
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -49,9 +49,9 @@ typedef struct {
|
|||
int shmid;
|
||||
} snd_pcm_hw_t;
|
||||
|
||||
#define SND_FILE_PCM_STREAM_PLAYBACK "/dev/snd/pcmC%iD%ip"
|
||||
#define SND_FILE_PCM_STREAM_CAPTURE "/dev/snd/pcmC%iD%ic"
|
||||
#define SND_PCM_VERSION_MAX SND_PROTOCOL_VERSION(2, 0, 0)
|
||||
#define SNDRV_FILE_PCM_STREAM_PLAYBACK "/dev/snd/pcmC%iD%ip"
|
||||
#define SNDRV_FILE_PCM_STREAM_CAPTURE "/dev/snd/pcmC%iD%ic"
|
||||
#define SNDRV_PCM_VERSION_MAX SNDRV_PROTOCOL_VERSION(2, 0, 0)
|
||||
|
||||
static int snd_pcm_hw_nonblock(snd_pcm_t *pcm, int nonblock)
|
||||
{
|
||||
|
|
@ -119,8 +119,8 @@ static int snd_pcm_hw_info(snd_pcm_t *pcm, snd_pcm_info_t * info)
|
|||
{
|
||||
snd_pcm_hw_t *hw = pcm->private;
|
||||
int fd = hw->fd;
|
||||
if (ioctl(fd, SND_PCM_IOCTL_INFO, info) < 0) {
|
||||
SYSERR("SND_PCM_IOCTL_INFO failed");
|
||||
if (ioctl(fd, SNDRV_PCM_IOCTL_INFO, info) < 0) {
|
||||
SYSERR("SNDRV_PCM_IOCTL_INFO failed");
|
||||
return -errno;
|
||||
}
|
||||
return 0;
|
||||
|
|
@ -130,8 +130,8 @@ static int snd_pcm_hw_hw_refine(snd_pcm_t *pcm, snd_pcm_hw_params_t *params)
|
|||
{
|
||||
snd_pcm_hw_t *hw = pcm->private;
|
||||
int fd = hw->fd;
|
||||
if (ioctl(fd, SND_PCM_IOCTL_HW_REFINE, params) < 0) {
|
||||
// SYSERR("SND_PCM_IOCTL_HW_REFINE failed");
|
||||
if (ioctl(fd, SNDRV_PCM_IOCTL_HW_REFINE, params) < 0) {
|
||||
// SYSERR("SNDRV_PCM_IOCTL_HW_REFINE failed");
|
||||
return -errno;
|
||||
}
|
||||
return 0;
|
||||
|
|
@ -141,8 +141,8 @@ static int snd_pcm_hw_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t * params)
|
|||
{
|
||||
snd_pcm_hw_t *hw = pcm->private;
|
||||
int fd = hw->fd;
|
||||
if (ioctl(fd, SND_PCM_IOCTL_HW_PARAMS, params) < 0) {
|
||||
SYSERR("SND_PCM_IOCTL_HW_PARAMS failed");
|
||||
if (ioctl(fd, SNDRV_PCM_IOCTL_HW_PARAMS, params) < 0) {
|
||||
SYSERR("SNDRV_PCM_IOCTL_HW_PARAMS failed");
|
||||
return -errno;
|
||||
}
|
||||
return 0;
|
||||
|
|
@ -152,8 +152,8 @@ static int snd_pcm_hw_hw_free(snd_pcm_t *pcm)
|
|||
{
|
||||
snd_pcm_hw_t *hw = pcm->private;
|
||||
int fd = hw->fd;
|
||||
if (ioctl(fd, SND_PCM_IOCTL_HW_FREE) < 0) {
|
||||
SYSERR("SND_PCM_IOCTL_HW_FREE failed");
|
||||
if (ioctl(fd, SNDRV_PCM_IOCTL_HW_FREE) < 0) {
|
||||
SYSERR("SNDRV_PCM_IOCTL_HW_FREE failed");
|
||||
return -errno;
|
||||
}
|
||||
return 0;
|
||||
|
|
@ -174,8 +174,8 @@ static int snd_pcm_hw_sw_params(snd_pcm_t *pcm, snd_pcm_sw_params_t * params)
|
|||
hw->mmap_control->avail_min = params->avail_min;
|
||||
return 0;
|
||||
}
|
||||
if (ioctl(fd, SND_PCM_IOCTL_SW_PARAMS, params) < 0) {
|
||||
SYSERR("SND_PCM_IOCTL_SW_PARAMS failed");
|
||||
if (ioctl(fd, SNDRV_PCM_IOCTL_SW_PARAMS, params) < 0) {
|
||||
SYSERR("SNDRV_PCM_IOCTL_SW_PARAMS failed");
|
||||
return -errno;
|
||||
}
|
||||
return 0;
|
||||
|
|
@ -187,8 +187,8 @@ static int snd_pcm_hw_channel_info(snd_pcm_t *pcm, snd_pcm_channel_info_t * info
|
|||
snd_pcm_hw_channel_info_t hw_info;
|
||||
int fd = hw->fd;
|
||||
hw_info.channel = info->channel;
|
||||
if (ioctl(fd, SND_PCM_IOCTL_CHANNEL_INFO, &hw_info) < 0) {
|
||||
SYSERR("SND_PCM_IOCTL_CHANNEL_INFO failed");
|
||||
if (ioctl(fd, SNDRV_PCM_IOCTL_CHANNEL_INFO, &hw_info) < 0) {
|
||||
SYSERR("SNDRV_PCM_IOCTL_CHANNEL_INFO failed");
|
||||
return -errno;
|
||||
}
|
||||
info->channel = hw_info.channel;
|
||||
|
|
@ -208,8 +208,8 @@ static int snd_pcm_hw_status(snd_pcm_t *pcm, snd_pcm_status_t * status)
|
|||
{
|
||||
snd_pcm_hw_t *hw = pcm->private;
|
||||
int fd = hw->fd;
|
||||
if (ioctl(fd, SND_PCM_IOCTL_STATUS, status) < 0) {
|
||||
SYSERR("SND_PCM_IOCTL_STATUS failed");
|
||||
if (ioctl(fd, SNDRV_PCM_IOCTL_STATUS, status) < 0) {
|
||||
SYSERR("SNDRV_PCM_IOCTL_STATUS failed");
|
||||
return -errno;
|
||||
}
|
||||
return 0;
|
||||
|
|
@ -225,8 +225,8 @@ static int snd_pcm_hw_delay(snd_pcm_t *pcm, snd_pcm_sframes_t *delayp)
|
|||
{
|
||||
snd_pcm_hw_t *hw = pcm->private;
|
||||
int fd = hw->fd;
|
||||
if (ioctl(fd, SND_PCM_IOCTL_DELAY, delayp) < 0) {
|
||||
SYSERR("SND_PCM_IOCTL_DELAY failed");
|
||||
if (ioctl(fd, SNDRV_PCM_IOCTL_DELAY, delayp) < 0) {
|
||||
SYSERR("SNDRV_PCM_IOCTL_DELAY failed");
|
||||
return -errno;
|
||||
}
|
||||
return 0;
|
||||
|
|
@ -236,8 +236,8 @@ static int snd_pcm_hw_prepare(snd_pcm_t *pcm)
|
|||
{
|
||||
snd_pcm_hw_t *hw = pcm->private;
|
||||
int fd = hw->fd;
|
||||
if (ioctl(fd, SND_PCM_IOCTL_PREPARE) < 0) {
|
||||
SYSERR("SND_PCM_IOCTL_PREPARE failed");
|
||||
if (ioctl(fd, SNDRV_PCM_IOCTL_PREPARE) < 0) {
|
||||
SYSERR("SNDRV_PCM_IOCTL_PREPARE failed");
|
||||
return -errno;
|
||||
}
|
||||
return 0;
|
||||
|
|
@ -247,8 +247,8 @@ static int snd_pcm_hw_reset(snd_pcm_t *pcm)
|
|||
{
|
||||
snd_pcm_hw_t *hw = pcm->private;
|
||||
int fd = hw->fd;
|
||||
if (ioctl(fd, SND_PCM_IOCTL_RESET) < 0) {
|
||||
SYSERR("SND_PCM_IOCTL_RESET failed");
|
||||
if (ioctl(fd, SNDRV_PCM_IOCTL_RESET) < 0) {
|
||||
SYSERR("SNDRV_PCM_IOCTL_RESET failed");
|
||||
return -errno;
|
||||
}
|
||||
return 0;
|
||||
|
|
@ -262,8 +262,8 @@ static int snd_pcm_hw_start(snd_pcm_t *pcm)
|
|||
assert(pcm->stream != SND_PCM_STREAM_PLAYBACK ||
|
||||
snd_pcm_mmap_playback_hw_avail(pcm) > 0);
|
||||
#endif
|
||||
if (ioctl(fd, SND_PCM_IOCTL_START) < 0) {
|
||||
SYSERR("SND_PCM_IOCTL_START failed");
|
||||
if (ioctl(fd, SNDRV_PCM_IOCTL_START) < 0) {
|
||||
SYSERR("SNDRV_PCM_IOCTL_START failed");
|
||||
return -errno;
|
||||
}
|
||||
return 0;
|
||||
|
|
@ -273,8 +273,8 @@ static int snd_pcm_hw_drop(snd_pcm_t *pcm)
|
|||
{
|
||||
snd_pcm_hw_t *hw = pcm->private;
|
||||
int fd = hw->fd;
|
||||
if (ioctl(fd, SND_PCM_IOCTL_DROP) < 0) {
|
||||
SYSERR("SND_PCM_IOCTL_DROP failed");
|
||||
if (ioctl(fd, SNDRV_PCM_IOCTL_DROP) < 0) {
|
||||
SYSERR("SNDRV_PCM_IOCTL_DROP failed");
|
||||
return -errno;
|
||||
}
|
||||
return 0;
|
||||
|
|
@ -284,8 +284,8 @@ static int snd_pcm_hw_drain(snd_pcm_t *pcm)
|
|||
{
|
||||
snd_pcm_hw_t *hw = pcm->private;
|
||||
int fd = hw->fd;
|
||||
if (ioctl(fd, SND_PCM_IOCTL_DRAIN) < 0) {
|
||||
SYSERR("SND_PCM_IOCTL_DRAIN failed");
|
||||
if (ioctl(fd, SNDRV_PCM_IOCTL_DRAIN) < 0) {
|
||||
SYSERR("SNDRV_PCM_IOCTL_DRAIN failed");
|
||||
return -errno;
|
||||
}
|
||||
return 0;
|
||||
|
|
@ -295,8 +295,8 @@ static int snd_pcm_hw_pause(snd_pcm_t *pcm, int enable)
|
|||
{
|
||||
snd_pcm_hw_t *hw = pcm->private;
|
||||
int fd = hw->fd;
|
||||
if (ioctl(fd, SND_PCM_IOCTL_PAUSE, enable) < 0) {
|
||||
SYSERR("SND_PCM_IOCTL_PAUSE failed");
|
||||
if (ioctl(fd, SNDRV_PCM_IOCTL_PAUSE, enable) < 0) {
|
||||
SYSERR("SNDRV_PCM_IOCTL_PAUSE failed");
|
||||
return -errno;
|
||||
}
|
||||
return 0;
|
||||
|
|
@ -306,8 +306,8 @@ static snd_pcm_sframes_t snd_pcm_hw_rewind(snd_pcm_t *pcm, snd_pcm_uframes_t fra
|
|||
{
|
||||
snd_pcm_hw_t *hw = pcm->private;
|
||||
int fd = hw->fd;
|
||||
if (ioctl(fd, SND_PCM_IOCTL_REWIND, &frames) < 0) {
|
||||
SYSERR("SND_PCM_IOCTL_REWIND failed");
|
||||
if (ioctl(fd, SNDRV_PCM_IOCTL_REWIND, &frames) < 0) {
|
||||
SYSERR("SNDRV_PCM_IOCTL_REWIND failed");
|
||||
return -errno;
|
||||
}
|
||||
return 0;
|
||||
|
|
@ -321,7 +321,7 @@ static snd_pcm_sframes_t snd_pcm_hw_writei(snd_pcm_t *pcm, const void *buffer, s
|
|||
snd_xferi_t xferi;
|
||||
xferi.buf = (char*) buffer;
|
||||
xferi.frames = size;
|
||||
result = ioctl(fd, SND_PCM_IOCTL_WRITEI_FRAMES, &xferi);
|
||||
result = ioctl(fd, SNDRV_PCM_IOCTL_WRITEI_FRAMES, &xferi);
|
||||
if (result < 0)
|
||||
return -errno;
|
||||
return xferi.result;
|
||||
|
|
@ -335,7 +335,7 @@ static snd_pcm_sframes_t snd_pcm_hw_writen(snd_pcm_t *pcm, void **bufs, snd_pcm_
|
|||
snd_xfern_t xfern;
|
||||
xfern.bufs = bufs;
|
||||
xfern.frames = size;
|
||||
result = ioctl(fd, SND_PCM_IOCTL_WRITEN_FRAMES, &xfern);
|
||||
result = ioctl(fd, SNDRV_PCM_IOCTL_WRITEN_FRAMES, &xfern);
|
||||
if (result < 0)
|
||||
return -errno;
|
||||
return xfern.result;
|
||||
|
|
@ -349,7 +349,7 @@ static snd_pcm_sframes_t snd_pcm_hw_readi(snd_pcm_t *pcm, void *buffer, snd_pcm_
|
|||
snd_xferi_t xferi;
|
||||
xferi.buf = buffer;
|
||||
xferi.frames = size;
|
||||
result = ioctl(fd, SND_PCM_IOCTL_READI_FRAMES, &xferi);
|
||||
result = ioctl(fd, SNDRV_PCM_IOCTL_READI_FRAMES, &xferi);
|
||||
if (result < 0)
|
||||
return -errno;
|
||||
return xferi.result;
|
||||
|
|
@ -363,7 +363,7 @@ snd_pcm_sframes_t snd_pcm_hw_readn(snd_pcm_t *pcm, void **bufs, snd_pcm_uframes_
|
|||
snd_xfern_t xfern;
|
||||
xfern.bufs = bufs;
|
||||
xfern.frames = size;
|
||||
result = ioctl(fd, SND_PCM_IOCTL_READN_FRAMES, &xfern);
|
||||
result = ioctl(fd, SNDRV_PCM_IOCTL_READN_FRAMES, &xfern);
|
||||
if (result < 0)
|
||||
return -errno;
|
||||
return xfern.result;
|
||||
|
|
@ -568,10 +568,10 @@ int snd_pcm_hw_open_subdevice(snd_pcm_t **pcmp, int card, int device, int subdev
|
|||
|
||||
switch (stream) {
|
||||
case SND_PCM_STREAM_PLAYBACK:
|
||||
filefmt = SND_FILE_PCM_STREAM_PLAYBACK;
|
||||
filefmt = SNDRV_FILE_PCM_STREAM_PLAYBACK;
|
||||
break;
|
||||
case SND_PCM_STREAM_CAPTURE:
|
||||
filefmt = SND_FILE_PCM_STREAM_CAPTURE;
|
||||
filefmt = SNDRV_FILE_PCM_STREAM_CAPTURE;
|
||||
break;
|
||||
default:
|
||||
assert(0);
|
||||
|
|
@ -596,19 +596,19 @@ int snd_pcm_hw_open_subdevice(snd_pcm_t **pcmp, int card, int device, int subdev
|
|||
ret = -errno;
|
||||
goto _err;
|
||||
}
|
||||
if (ioctl(fd, SND_PCM_IOCTL_PVERSION, &ver) < 0) {
|
||||
SYSERR("SND_PCM_IOCTL_PVERSION failed");
|
||||
if (ioctl(fd, SNDRV_PCM_IOCTL_PVERSION, &ver) < 0) {
|
||||
SYSERR("SNDRV_PCM_IOCTL_PVERSION failed");
|
||||
ret = -errno;
|
||||
goto _err;
|
||||
}
|
||||
if (SND_PROTOCOL_INCOMPATIBLE(ver, SND_PCM_VERSION_MAX)) {
|
||||
if (SNDRV_PROTOCOL_INCOMPATIBLE(ver, SNDRV_PCM_VERSION_MAX)) {
|
||||
ret = -SND_ERROR_INCOMPATIBLE_VERSION;
|
||||
goto _err;
|
||||
}
|
||||
if (subdevice >= 0) {
|
||||
memset(&info, 0, sizeof(info));
|
||||
if (ioctl(fd, SND_PCM_IOCTL_INFO, &info) < 0) {
|
||||
SYSERR("SND_PCM_IOCTL_INFO failed");
|
||||
if (ioctl(fd, SNDRV_PCM_IOCTL_INFO, &info) < 0) {
|
||||
SYSERR("SNDRV_PCM_IOCTL_INFO failed");
|
||||
ret = -errno;
|
||||
goto _err;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,21 +39,21 @@
|
|||
int snd_pcm_format_signed(int format)
|
||||
{
|
||||
switch (format) {
|
||||
case SND_PCM_FORMAT_S8:
|
||||
case SND_PCM_FORMAT_S16_LE:
|
||||
case SND_PCM_FORMAT_S16_BE:
|
||||
case SND_PCM_FORMAT_S24_LE:
|
||||
case SND_PCM_FORMAT_S24_BE:
|
||||
case SND_PCM_FORMAT_S32_LE:
|
||||
case SND_PCM_FORMAT_S32_BE:
|
||||
case SNDRV_PCM_FORMAT_S8:
|
||||
case SNDRV_PCM_FORMAT_S16_LE:
|
||||
case SNDRV_PCM_FORMAT_S16_BE:
|
||||
case SNDRV_PCM_FORMAT_S24_LE:
|
||||
case SNDRV_PCM_FORMAT_S24_BE:
|
||||
case SNDRV_PCM_FORMAT_S32_LE:
|
||||
case SNDRV_PCM_FORMAT_S32_BE:
|
||||
return 1;
|
||||
case SND_PCM_FORMAT_U8:
|
||||
case SND_PCM_FORMAT_U16_LE:
|
||||
case SND_PCM_FORMAT_U16_BE:
|
||||
case SND_PCM_FORMAT_U24_LE:
|
||||
case SND_PCM_FORMAT_U24_BE:
|
||||
case SND_PCM_FORMAT_U32_LE:
|
||||
case SND_PCM_FORMAT_U32_BE:
|
||||
case SNDRV_PCM_FORMAT_U8:
|
||||
case SNDRV_PCM_FORMAT_U16_LE:
|
||||
case SNDRV_PCM_FORMAT_U16_BE:
|
||||
case SNDRV_PCM_FORMAT_U24_LE:
|
||||
case SNDRV_PCM_FORMAT_U24_BE:
|
||||
case SNDRV_PCM_FORMAT_U32_LE:
|
||||
case SNDRV_PCM_FORMAT_U32_BE:
|
||||
return 0;
|
||||
default:
|
||||
return -EINVAL;
|
||||
|
|
@ -78,25 +78,25 @@ int snd_pcm_format_linear(int format)
|
|||
int snd_pcm_format_little_endian(int format)
|
||||
{
|
||||
switch (format) {
|
||||
case SND_PCM_FORMAT_S16_LE:
|
||||
case SND_PCM_FORMAT_U16_LE:
|
||||
case SND_PCM_FORMAT_S24_LE:
|
||||
case SND_PCM_FORMAT_U24_LE:
|
||||
case SND_PCM_FORMAT_S32_LE:
|
||||
case SND_PCM_FORMAT_U32_LE:
|
||||
case SND_PCM_FORMAT_FLOAT_LE:
|
||||
case SND_PCM_FORMAT_FLOAT64_LE:
|
||||
case SND_PCM_FORMAT_IEC958_SUBFRAME_LE:
|
||||
case SNDRV_PCM_FORMAT_S16_LE:
|
||||
case SNDRV_PCM_FORMAT_U16_LE:
|
||||
case SNDRV_PCM_FORMAT_S24_LE:
|
||||
case SNDRV_PCM_FORMAT_U24_LE:
|
||||
case SNDRV_PCM_FORMAT_S32_LE:
|
||||
case SNDRV_PCM_FORMAT_U32_LE:
|
||||
case SNDRV_PCM_FORMAT_FLOAT_LE:
|
||||
case SNDRV_PCM_FORMAT_FLOAT64_LE:
|
||||
case SNDRV_PCM_FORMAT_IEC958_SUBFRAME_LE:
|
||||
return 1;
|
||||
case SND_PCM_FORMAT_S16_BE:
|
||||
case SND_PCM_FORMAT_U16_BE:
|
||||
case SND_PCM_FORMAT_S24_BE:
|
||||
case SND_PCM_FORMAT_U24_BE:
|
||||
case SND_PCM_FORMAT_S32_BE:
|
||||
case SND_PCM_FORMAT_U32_BE:
|
||||
case SND_PCM_FORMAT_FLOAT_BE:
|
||||
case SND_PCM_FORMAT_FLOAT64_BE:
|
||||
case SND_PCM_FORMAT_IEC958_SUBFRAME_BE:
|
||||
case SNDRV_PCM_FORMAT_S16_BE:
|
||||
case SNDRV_PCM_FORMAT_U16_BE:
|
||||
case SNDRV_PCM_FORMAT_S24_BE:
|
||||
case SNDRV_PCM_FORMAT_U24_BE:
|
||||
case SNDRV_PCM_FORMAT_S32_BE:
|
||||
case SNDRV_PCM_FORMAT_U32_BE:
|
||||
case SNDRV_PCM_FORMAT_FLOAT_BE:
|
||||
case SNDRV_PCM_FORMAT_FLOAT64_BE:
|
||||
case SNDRV_PCM_FORMAT_IEC958_SUBFRAME_BE:
|
||||
return 0;
|
||||
default:
|
||||
return -EINVAL;
|
||||
|
|
@ -115,7 +115,7 @@ int snd_pcm_format_big_endian(int format)
|
|||
|
||||
int snd_pcm_format_cpu_endian(int format)
|
||||
{
|
||||
#ifdef SND_LITTLE_ENDIAN
|
||||
#ifdef SNDRV_LITTLE_ENDIAN
|
||||
return snd_pcm_format_little_endian(format);
|
||||
#else
|
||||
return snd_pcm_format_big_endian(format);
|
||||
|
|
@ -125,36 +125,36 @@ int snd_pcm_format_cpu_endian(int format)
|
|||
int snd_pcm_format_width(int format)
|
||||
{
|
||||
switch (format) {
|
||||
case SND_PCM_FORMAT_S8:
|
||||
case SND_PCM_FORMAT_U8:
|
||||
case SNDRV_PCM_FORMAT_S8:
|
||||
case SNDRV_PCM_FORMAT_U8:
|
||||
return 8;
|
||||
case SND_PCM_FORMAT_S16_LE:
|
||||
case SND_PCM_FORMAT_S16_BE:
|
||||
case SND_PCM_FORMAT_U16_LE:
|
||||
case SND_PCM_FORMAT_U16_BE:
|
||||
case SNDRV_PCM_FORMAT_S16_LE:
|
||||
case SNDRV_PCM_FORMAT_S16_BE:
|
||||
case SNDRV_PCM_FORMAT_U16_LE:
|
||||
case SNDRV_PCM_FORMAT_U16_BE:
|
||||
return 16;
|
||||
case SND_PCM_FORMAT_S24_LE:
|
||||
case SND_PCM_FORMAT_S24_BE:
|
||||
case SND_PCM_FORMAT_U24_LE:
|
||||
case SND_PCM_FORMAT_U24_BE:
|
||||
case SNDRV_PCM_FORMAT_S24_LE:
|
||||
case SNDRV_PCM_FORMAT_S24_BE:
|
||||
case SNDRV_PCM_FORMAT_U24_LE:
|
||||
case SNDRV_PCM_FORMAT_U24_BE:
|
||||
return 24;
|
||||
case SND_PCM_FORMAT_S32_LE:
|
||||
case SND_PCM_FORMAT_S32_BE:
|
||||
case SND_PCM_FORMAT_U32_LE:
|
||||
case SND_PCM_FORMAT_U32_BE:
|
||||
case SND_PCM_FORMAT_FLOAT_LE:
|
||||
case SND_PCM_FORMAT_FLOAT_BE:
|
||||
case SNDRV_PCM_FORMAT_S32_LE:
|
||||
case SNDRV_PCM_FORMAT_S32_BE:
|
||||
case SNDRV_PCM_FORMAT_U32_LE:
|
||||
case SNDRV_PCM_FORMAT_U32_BE:
|
||||
case SNDRV_PCM_FORMAT_FLOAT_LE:
|
||||
case SNDRV_PCM_FORMAT_FLOAT_BE:
|
||||
return 32;
|
||||
case SND_PCM_FORMAT_FLOAT64_LE:
|
||||
case SND_PCM_FORMAT_FLOAT64_BE:
|
||||
case SNDRV_PCM_FORMAT_FLOAT64_LE:
|
||||
case SNDRV_PCM_FORMAT_FLOAT64_BE:
|
||||
return 64;
|
||||
case SND_PCM_FORMAT_IEC958_SUBFRAME_LE:
|
||||
case SND_PCM_FORMAT_IEC958_SUBFRAME_BE:
|
||||
case SNDRV_PCM_FORMAT_IEC958_SUBFRAME_LE:
|
||||
case SNDRV_PCM_FORMAT_IEC958_SUBFRAME_BE:
|
||||
return 24;
|
||||
case SND_PCM_FORMAT_MU_LAW:
|
||||
case SND_PCM_FORMAT_A_LAW:
|
||||
case SNDRV_PCM_FORMAT_MU_LAW:
|
||||
case SNDRV_PCM_FORMAT_A_LAW:
|
||||
return 8;
|
||||
case SND_PCM_FORMAT_IMA_ADPCM:
|
||||
case SNDRV_PCM_FORMAT_IMA_ADPCM:
|
||||
return 4;
|
||||
default:
|
||||
return -EINVAL;
|
||||
|
|
@ -164,34 +164,34 @@ int snd_pcm_format_width(int format)
|
|||
int snd_pcm_format_physical_width(int format)
|
||||
{
|
||||
switch (format) {
|
||||
case SND_PCM_FORMAT_S8:
|
||||
case SND_PCM_FORMAT_U8:
|
||||
case SNDRV_PCM_FORMAT_S8:
|
||||
case SNDRV_PCM_FORMAT_U8:
|
||||
return 8;
|
||||
case SND_PCM_FORMAT_S16_LE:
|
||||
case SND_PCM_FORMAT_S16_BE:
|
||||
case SND_PCM_FORMAT_U16_LE:
|
||||
case SND_PCM_FORMAT_U16_BE:
|
||||
case SNDRV_PCM_FORMAT_S16_LE:
|
||||
case SNDRV_PCM_FORMAT_S16_BE:
|
||||
case SNDRV_PCM_FORMAT_U16_LE:
|
||||
case SNDRV_PCM_FORMAT_U16_BE:
|
||||
return 16;
|
||||
case SND_PCM_FORMAT_S24_LE:
|
||||
case SND_PCM_FORMAT_S24_BE:
|
||||
case SND_PCM_FORMAT_U24_LE:
|
||||
case SND_PCM_FORMAT_U24_BE:
|
||||
case SND_PCM_FORMAT_S32_LE:
|
||||
case SND_PCM_FORMAT_S32_BE:
|
||||
case SND_PCM_FORMAT_U32_LE:
|
||||
case SND_PCM_FORMAT_U32_BE:
|
||||
case SND_PCM_FORMAT_FLOAT_LE:
|
||||
case SND_PCM_FORMAT_FLOAT_BE:
|
||||
case SND_PCM_FORMAT_IEC958_SUBFRAME_LE:
|
||||
case SND_PCM_FORMAT_IEC958_SUBFRAME_BE:
|
||||
case SNDRV_PCM_FORMAT_S24_LE:
|
||||
case SNDRV_PCM_FORMAT_S24_BE:
|
||||
case SNDRV_PCM_FORMAT_U24_LE:
|
||||
case SNDRV_PCM_FORMAT_U24_BE:
|
||||
case SNDRV_PCM_FORMAT_S32_LE:
|
||||
case SNDRV_PCM_FORMAT_S32_BE:
|
||||
case SNDRV_PCM_FORMAT_U32_LE:
|
||||
case SNDRV_PCM_FORMAT_U32_BE:
|
||||
case SNDRV_PCM_FORMAT_FLOAT_LE:
|
||||
case SNDRV_PCM_FORMAT_FLOAT_BE:
|
||||
case SNDRV_PCM_FORMAT_IEC958_SUBFRAME_LE:
|
||||
case SNDRV_PCM_FORMAT_IEC958_SUBFRAME_BE:
|
||||
return 32;
|
||||
case SND_PCM_FORMAT_FLOAT64_LE:
|
||||
case SND_PCM_FORMAT_FLOAT64_BE:
|
||||
case SNDRV_PCM_FORMAT_FLOAT64_LE:
|
||||
case SNDRV_PCM_FORMAT_FLOAT64_BE:
|
||||
return 64;
|
||||
case SND_PCM_FORMAT_MU_LAW:
|
||||
case SND_PCM_FORMAT_A_LAW:
|
||||
case SNDRV_PCM_FORMAT_MU_LAW:
|
||||
case SNDRV_PCM_FORMAT_A_LAW:
|
||||
return 8;
|
||||
case SND_PCM_FORMAT_IMA_ADPCM:
|
||||
case SNDRV_PCM_FORMAT_IMA_ADPCM:
|
||||
return 4;
|
||||
default:
|
||||
return -EINVAL;
|
||||
|
|
@ -201,35 +201,35 @@ int snd_pcm_format_physical_width(int format)
|
|||
ssize_t snd_pcm_format_size(int format, size_t samples)
|
||||
{
|
||||
switch (format) {
|
||||
case SND_PCM_FORMAT_S8:
|
||||
case SND_PCM_FORMAT_U8:
|
||||
case SNDRV_PCM_FORMAT_S8:
|
||||
case SNDRV_PCM_FORMAT_U8:
|
||||
return samples;
|
||||
case SND_PCM_FORMAT_S16_LE:
|
||||
case SND_PCM_FORMAT_S16_BE:
|
||||
case SND_PCM_FORMAT_U16_LE:
|
||||
case SND_PCM_FORMAT_U16_BE:
|
||||
case SNDRV_PCM_FORMAT_S16_LE:
|
||||
case SNDRV_PCM_FORMAT_S16_BE:
|
||||
case SNDRV_PCM_FORMAT_U16_LE:
|
||||
case SNDRV_PCM_FORMAT_U16_BE:
|
||||
return samples * 2;
|
||||
case SND_PCM_FORMAT_S24_LE:
|
||||
case SND_PCM_FORMAT_S24_BE:
|
||||
case SND_PCM_FORMAT_U24_LE:
|
||||
case SND_PCM_FORMAT_U24_BE:
|
||||
case SND_PCM_FORMAT_S32_LE:
|
||||
case SND_PCM_FORMAT_S32_BE:
|
||||
case SND_PCM_FORMAT_U32_LE:
|
||||
case SND_PCM_FORMAT_U32_BE:
|
||||
case SND_PCM_FORMAT_FLOAT_LE:
|
||||
case SND_PCM_FORMAT_FLOAT_BE:
|
||||
case SNDRV_PCM_FORMAT_S24_LE:
|
||||
case SNDRV_PCM_FORMAT_S24_BE:
|
||||
case SNDRV_PCM_FORMAT_U24_LE:
|
||||
case SNDRV_PCM_FORMAT_U24_BE:
|
||||
case SNDRV_PCM_FORMAT_S32_LE:
|
||||
case SNDRV_PCM_FORMAT_S32_BE:
|
||||
case SNDRV_PCM_FORMAT_U32_LE:
|
||||
case SNDRV_PCM_FORMAT_U32_BE:
|
||||
case SNDRV_PCM_FORMAT_FLOAT_LE:
|
||||
case SNDRV_PCM_FORMAT_FLOAT_BE:
|
||||
return samples * 4;
|
||||
case SND_PCM_FORMAT_FLOAT64_LE:
|
||||
case SND_PCM_FORMAT_FLOAT64_BE:
|
||||
case SNDRV_PCM_FORMAT_FLOAT64_LE:
|
||||
case SNDRV_PCM_FORMAT_FLOAT64_BE:
|
||||
return samples * 8;
|
||||
case SND_PCM_FORMAT_IEC958_SUBFRAME_LE:
|
||||
case SND_PCM_FORMAT_IEC958_SUBFRAME_BE:
|
||||
case SNDRV_PCM_FORMAT_IEC958_SUBFRAME_LE:
|
||||
case SNDRV_PCM_FORMAT_IEC958_SUBFRAME_BE:
|
||||
return samples * 4;
|
||||
case SND_PCM_FORMAT_MU_LAW:
|
||||
case SND_PCM_FORMAT_A_LAW:
|
||||
case SNDRV_PCM_FORMAT_MU_LAW:
|
||||
case SNDRV_PCM_FORMAT_A_LAW:
|
||||
return samples;
|
||||
case SND_PCM_FORMAT_IMA_ADPCM:
|
||||
case SNDRV_PCM_FORMAT_IMA_ADPCM:
|
||||
if (samples & 1)
|
||||
return -EINVAL;
|
||||
return samples / 2;
|
||||
|
|
@ -241,105 +241,105 @@ ssize_t snd_pcm_format_size(int format, size_t samples)
|
|||
u_int64_t snd_pcm_format_silence_64(int format)
|
||||
{
|
||||
switch (format) {
|
||||
case SND_PCM_FORMAT_S8:
|
||||
case SND_PCM_FORMAT_S16_LE:
|
||||
case SND_PCM_FORMAT_S16_BE:
|
||||
case SND_PCM_FORMAT_S24_LE:
|
||||
case SND_PCM_FORMAT_S24_BE:
|
||||
case SND_PCM_FORMAT_S32_LE:
|
||||
case SND_PCM_FORMAT_S32_BE:
|
||||
case SNDRV_PCM_FORMAT_S8:
|
||||
case SNDRV_PCM_FORMAT_S16_LE:
|
||||
case SNDRV_PCM_FORMAT_S16_BE:
|
||||
case SNDRV_PCM_FORMAT_S24_LE:
|
||||
case SNDRV_PCM_FORMAT_S24_BE:
|
||||
case SNDRV_PCM_FORMAT_S32_LE:
|
||||
case SNDRV_PCM_FORMAT_S32_BE:
|
||||
return 0;
|
||||
case SND_PCM_FORMAT_U8:
|
||||
case SNDRV_PCM_FORMAT_U8:
|
||||
return 0x8080808080808080ULL;
|
||||
#ifdef SND_LITTLE_ENDIAN
|
||||
case SND_PCM_FORMAT_U16_LE:
|
||||
#ifdef SNDRV_LITTLE_ENDIAN
|
||||
case SNDRV_PCM_FORMAT_U16_LE:
|
||||
return 0x8000800080008000ULL;
|
||||
case SND_PCM_FORMAT_U24_LE:
|
||||
case SNDRV_PCM_FORMAT_U24_LE:
|
||||
return 0x0080000000800000ULL;
|
||||
case SND_PCM_FORMAT_U32_LE:
|
||||
case SNDRV_PCM_FORMAT_U32_LE:
|
||||
return 0x8000000080000000ULL;
|
||||
case SND_PCM_FORMAT_U16_BE:
|
||||
case SNDRV_PCM_FORMAT_U16_BE:
|
||||
return 0x0080008000800080ULL;
|
||||
case SND_PCM_FORMAT_U24_BE:
|
||||
case SNDRV_PCM_FORMAT_U24_BE:
|
||||
return 0x0000800000008000ULL;
|
||||
case SND_PCM_FORMAT_U32_BE:
|
||||
case SNDRV_PCM_FORMAT_U32_BE:
|
||||
return 0x0000008000000080ULL;
|
||||
#else
|
||||
case SND_PCM_FORMAT_U16_LE:
|
||||
case SNDRV_PCM_FORMAT_U16_LE:
|
||||
return 0x0080008000800080ULL;
|
||||
case SND_PCM_FORMAT_U24_LE:
|
||||
case SNDRV_PCM_FORMAT_U24_LE:
|
||||
return 0x0000800000008000ULL;
|
||||
case SND_PCM_FORMAT_U32_LE:
|
||||
case SNDRV_PCM_FORMAT_U32_LE:
|
||||
return 0x0000008000000080ULL;
|
||||
case SND_PCM_FORMAT_U16_BE:
|
||||
case SNDRV_PCM_FORMAT_U16_BE:
|
||||
return 0x8000800080008000ULL;
|
||||
case SND_PCM_FORMAT_U24_BE:
|
||||
case SNDRV_PCM_FORMAT_U24_BE:
|
||||
return 0x0080000000800000ULL;
|
||||
case SND_PCM_FORMAT_U32_BE:
|
||||
case SNDRV_PCM_FORMAT_U32_BE:
|
||||
return 0x8000000080000000ULL;
|
||||
#endif
|
||||
case SND_PCM_FORMAT_FLOAT_LE:
|
||||
case SNDRV_PCM_FORMAT_FLOAT_LE:
|
||||
{
|
||||
union {
|
||||
float f;
|
||||
u_int32_t i;
|
||||
} u;
|
||||
u.f = 0.0;
|
||||
#ifdef SND_LITTLE_ENDIAN
|
||||
#ifdef SNDRV_LITTLE_ENDIAN
|
||||
return u.i;
|
||||
#else
|
||||
return bswap_32(u.i);
|
||||
#endif
|
||||
}
|
||||
case SND_PCM_FORMAT_FLOAT64_LE:
|
||||
case SNDRV_PCM_FORMAT_FLOAT64_LE:
|
||||
{
|
||||
union {
|
||||
double f;
|
||||
u_int64_t i;
|
||||
} u;
|
||||
u.f = 0.0;
|
||||
#ifdef SND_LITTLE_ENDIAN
|
||||
#ifdef SNDRV_LITTLE_ENDIAN
|
||||
return u.i;
|
||||
#else
|
||||
return bswap_64(u.i);
|
||||
#endif
|
||||
}
|
||||
case SND_PCM_FORMAT_FLOAT_BE:
|
||||
case SNDRV_PCM_FORMAT_FLOAT_BE:
|
||||
{
|
||||
union {
|
||||
float f;
|
||||
u_int32_t i;
|
||||
} u;
|
||||
u.f = 0.0;
|
||||
#ifdef SND_LITTLE_ENDIAN
|
||||
#ifdef SNDRV_LITTLE_ENDIAN
|
||||
return bswap_32(u.i);
|
||||
#else
|
||||
return u.i;
|
||||
#endif
|
||||
}
|
||||
case SND_PCM_FORMAT_FLOAT64_BE:
|
||||
case SNDRV_PCM_FORMAT_FLOAT64_BE:
|
||||
{
|
||||
union {
|
||||
double f;
|
||||
u_int64_t i;
|
||||
} u;
|
||||
u.f = 0.0;
|
||||
#ifdef SND_LITTLE_ENDIAN
|
||||
#ifdef SNDRV_LITTLE_ENDIAN
|
||||
return bswap_64(u.i);
|
||||
#else
|
||||
return u.i;
|
||||
#endif
|
||||
}
|
||||
case SND_PCM_FORMAT_IEC958_SUBFRAME_LE:
|
||||
case SND_PCM_FORMAT_IEC958_SUBFRAME_BE:
|
||||
case SNDRV_PCM_FORMAT_IEC958_SUBFRAME_LE:
|
||||
case SNDRV_PCM_FORMAT_IEC958_SUBFRAME_BE:
|
||||
return 0;
|
||||
case SND_PCM_FORMAT_MU_LAW:
|
||||
case SNDRV_PCM_FORMAT_MU_LAW:
|
||||
return 0x7f7f7f7f7f7f7f7fULL;
|
||||
case SND_PCM_FORMAT_A_LAW:
|
||||
case SNDRV_PCM_FORMAT_A_LAW:
|
||||
return 0x5555555555555555ULL;
|
||||
case SND_PCM_FORMAT_IMA_ADPCM: /* special case */
|
||||
case SND_PCM_FORMAT_MPEG:
|
||||
case SND_PCM_FORMAT_GSM:
|
||||
case SNDRV_PCM_FORMAT_IMA_ADPCM: /* special case */
|
||||
case SNDRV_PCM_FORMAT_MPEG:
|
||||
case SNDRV_PCM_FORMAT_GSM:
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
|
|
@ -404,22 +404,22 @@ int snd_pcm_format_set_silence(int format, void *data, unsigned int samples)
|
|||
}
|
||||
|
||||
static int linear_formats[4*2*2] = {
|
||||
SND_PCM_FORMAT_S8,
|
||||
SND_PCM_FORMAT_S8,
|
||||
SND_PCM_FORMAT_U8,
|
||||
SND_PCM_FORMAT_U8,
|
||||
SND_PCM_FORMAT_S16_LE,
|
||||
SND_PCM_FORMAT_S16_BE,
|
||||
SND_PCM_FORMAT_U16_LE,
|
||||
SND_PCM_FORMAT_U16_BE,
|
||||
SND_PCM_FORMAT_S24_LE,
|
||||
SND_PCM_FORMAT_S24_BE,
|
||||
SND_PCM_FORMAT_U24_LE,
|
||||
SND_PCM_FORMAT_U24_BE,
|
||||
SND_PCM_FORMAT_S32_LE,
|
||||
SND_PCM_FORMAT_S32_BE,
|
||||
SND_PCM_FORMAT_U32_LE,
|
||||
SND_PCM_FORMAT_U32_BE
|
||||
SNDRV_PCM_FORMAT_S8,
|
||||
SNDRV_PCM_FORMAT_S8,
|
||||
SNDRV_PCM_FORMAT_U8,
|
||||
SNDRV_PCM_FORMAT_U8,
|
||||
SNDRV_PCM_FORMAT_S16_LE,
|
||||
SNDRV_PCM_FORMAT_S16_BE,
|
||||
SNDRV_PCM_FORMAT_U16_LE,
|
||||
SNDRV_PCM_FORMAT_U16_BE,
|
||||
SNDRV_PCM_FORMAT_S24_LE,
|
||||
SNDRV_PCM_FORMAT_S24_BE,
|
||||
SNDRV_PCM_FORMAT_U24_LE,
|
||||
SNDRV_PCM_FORMAT_U24_BE,
|
||||
SNDRV_PCM_FORMAT_S32_LE,
|
||||
SNDRV_PCM_FORMAT_S32_BE,
|
||||
SNDRV_PCM_FORMAT_U32_LE,
|
||||
SNDRV_PCM_FORMAT_U32_BE
|
||||
};
|
||||
|
||||
int snd_pcm_build_linear_format(int width, int unsignd, int big_endian)
|
||||
|
|
|
|||
|
|
@ -147,7 +147,7 @@ static int snd_pcm_shm_info(snd_pcm_t *pcm, snd_pcm_info_t * info)
|
|||
volatile snd_pcm_shm_ctrl_t *ctrl = shm->ctrl;
|
||||
int err;
|
||||
// ctrl->u.info = *info;
|
||||
ctrl->cmd = SND_PCM_IOCTL_INFO;
|
||||
ctrl->cmd = SNDRV_PCM_IOCTL_INFO;
|
||||
err = snd_pcm_shm_action(pcm);
|
||||
if (err < 0)
|
||||
return err;
|
||||
|
|
@ -215,7 +215,7 @@ static int snd_pcm_shm_hw_refine_slave(snd_pcm_t *pcm,
|
|||
volatile snd_pcm_shm_ctrl_t *ctrl = shm->ctrl;
|
||||
int err;
|
||||
ctrl->u.hw_refine = *params;
|
||||
ctrl->cmd = SND_PCM_IOCTL_HW_REFINE;
|
||||
ctrl->cmd = SNDRV_PCM_IOCTL_HW_REFINE;
|
||||
err = snd_pcm_shm_action(pcm);
|
||||
*params = ctrl->u.hw_refine;
|
||||
return err;
|
||||
|
|
@ -237,7 +237,7 @@ static int snd_pcm_shm_hw_params_slave(snd_pcm_t *pcm,
|
|||
snd_pcm_shm_t *shm = pcm->private;
|
||||
volatile snd_pcm_shm_ctrl_t *ctrl = shm->ctrl;
|
||||
int err;
|
||||
ctrl->cmd = SND_PCM_IOCTL_HW_PARAMS;
|
||||
ctrl->cmd = SNDRV_PCM_IOCTL_HW_PARAMS;
|
||||
ctrl->u.hw_params = *params;
|
||||
err = snd_pcm_shm_action(pcm);
|
||||
*params = ctrl->u.hw_params;
|
||||
|
|
@ -257,7 +257,7 @@ static int snd_pcm_shm_hw_free(snd_pcm_t *pcm)
|
|||
{
|
||||
snd_pcm_shm_t *shm = pcm->private;
|
||||
volatile snd_pcm_shm_ctrl_t *ctrl = shm->ctrl;
|
||||
ctrl->cmd = SND_PCM_IOCTL_HW_FREE;
|
||||
ctrl->cmd = SNDRV_PCM_IOCTL_HW_FREE;
|
||||
return snd_pcm_shm_action(pcm);
|
||||
}
|
||||
|
||||
|
|
@ -266,7 +266,7 @@ static int snd_pcm_shm_sw_params(snd_pcm_t *pcm, snd_pcm_sw_params_t * params)
|
|||
snd_pcm_shm_t *shm = pcm->private;
|
||||
volatile snd_pcm_shm_ctrl_t *ctrl = shm->ctrl;
|
||||
int err;
|
||||
ctrl->cmd = SND_PCM_IOCTL_SW_PARAMS;
|
||||
ctrl->cmd = SNDRV_PCM_IOCTL_SW_PARAMS;
|
||||
ctrl->u.sw_params = *params;
|
||||
err = snd_pcm_shm_action(pcm);
|
||||
*params = ctrl->u.sw_params;
|
||||
|
|
@ -314,7 +314,7 @@ static int snd_pcm_shm_channel_info(snd_pcm_t *pcm, snd_pcm_channel_info_t * inf
|
|||
volatile snd_pcm_shm_ctrl_t *ctrl = shm->ctrl;
|
||||
int err;
|
||||
int fd;
|
||||
ctrl->cmd = SND_PCM_IOCTL_CHANNEL_INFO;
|
||||
ctrl->cmd = SNDRV_PCM_IOCTL_CHANNEL_INFO;
|
||||
ctrl->u.channel_info = *info;
|
||||
err = snd_pcm_shm_action_fd(pcm, &fd);
|
||||
if (err < 0)
|
||||
|
|
@ -339,7 +339,7 @@ static int snd_pcm_shm_status(snd_pcm_t *pcm, snd_pcm_status_t * status)
|
|||
snd_pcm_shm_t *shm = pcm->private;
|
||||
volatile snd_pcm_shm_ctrl_t *ctrl = shm->ctrl;
|
||||
int err;
|
||||
ctrl->cmd = SND_PCM_IOCTL_STATUS;
|
||||
ctrl->cmd = SNDRV_PCM_IOCTL_STATUS;
|
||||
// ctrl->u.status = *status;
|
||||
err = snd_pcm_shm_action(pcm);
|
||||
if (err < 0)
|
||||
|
|
@ -361,7 +361,7 @@ static int snd_pcm_shm_delay(snd_pcm_t *pcm, snd_pcm_sframes_t *delayp)
|
|||
snd_pcm_shm_t *shm = pcm->private;
|
||||
volatile snd_pcm_shm_ctrl_t *ctrl = shm->ctrl;
|
||||
int err;
|
||||
ctrl->cmd = SND_PCM_IOCTL_DELAY;
|
||||
ctrl->cmd = SNDRV_PCM_IOCTL_DELAY;
|
||||
err = snd_pcm_shm_action(pcm);
|
||||
if (err < 0)
|
||||
return err;
|
||||
|
|
@ -385,7 +385,7 @@ static int snd_pcm_shm_prepare(snd_pcm_t *pcm)
|
|||
{
|
||||
snd_pcm_shm_t *shm = pcm->private;
|
||||
volatile snd_pcm_shm_ctrl_t *ctrl = shm->ctrl;
|
||||
ctrl->cmd = SND_PCM_IOCTL_PREPARE;
|
||||
ctrl->cmd = SNDRV_PCM_IOCTL_PREPARE;
|
||||
return snd_pcm_shm_action(pcm);
|
||||
}
|
||||
|
||||
|
|
@ -393,7 +393,7 @@ static int snd_pcm_shm_reset(snd_pcm_t *pcm)
|
|||
{
|
||||
snd_pcm_shm_t *shm = pcm->private;
|
||||
volatile snd_pcm_shm_ctrl_t *ctrl = shm->ctrl;
|
||||
ctrl->cmd = SND_PCM_IOCTL_RESET;
|
||||
ctrl->cmd = SNDRV_PCM_IOCTL_RESET;
|
||||
return snd_pcm_shm_action(pcm);
|
||||
}
|
||||
|
||||
|
|
@ -401,7 +401,7 @@ static int snd_pcm_shm_start(snd_pcm_t *pcm)
|
|||
{
|
||||
snd_pcm_shm_t *shm = pcm->private;
|
||||
volatile snd_pcm_shm_ctrl_t *ctrl = shm->ctrl;
|
||||
ctrl->cmd = SND_PCM_IOCTL_START;
|
||||
ctrl->cmd = SNDRV_PCM_IOCTL_START;
|
||||
return snd_pcm_shm_action(pcm);
|
||||
}
|
||||
|
||||
|
|
@ -409,7 +409,7 @@ static int snd_pcm_shm_drop(snd_pcm_t *pcm)
|
|||
{
|
||||
snd_pcm_shm_t *shm = pcm->private;
|
||||
volatile snd_pcm_shm_ctrl_t *ctrl = shm->ctrl;
|
||||
ctrl->cmd = SND_PCM_IOCTL_DROP;
|
||||
ctrl->cmd = SNDRV_PCM_IOCTL_DROP;
|
||||
return snd_pcm_shm_action(pcm);
|
||||
}
|
||||
|
||||
|
|
@ -418,7 +418,7 @@ static int snd_pcm_shm_drain(snd_pcm_t *pcm)
|
|||
snd_pcm_shm_t *shm = pcm->private;
|
||||
volatile snd_pcm_shm_ctrl_t *ctrl = shm->ctrl;
|
||||
int err;
|
||||
ctrl->cmd = SND_PCM_IOCTL_DRAIN;
|
||||
ctrl->cmd = SNDRV_PCM_IOCTL_DRAIN;
|
||||
err = snd_pcm_shm_action(pcm);
|
||||
if (err < 0)
|
||||
return err;
|
||||
|
|
@ -431,7 +431,7 @@ static int snd_pcm_shm_pause(snd_pcm_t *pcm, int enable)
|
|||
{
|
||||
snd_pcm_shm_t *shm = pcm->private;
|
||||
volatile snd_pcm_shm_ctrl_t *ctrl = shm->ctrl;
|
||||
ctrl->cmd = SND_PCM_IOCTL_PAUSE;
|
||||
ctrl->cmd = SNDRV_PCM_IOCTL_PAUSE;
|
||||
ctrl->u.pause.enable = enable;
|
||||
return snd_pcm_shm_action(pcm);
|
||||
}
|
||||
|
|
@ -440,7 +440,7 @@ static snd_pcm_sframes_t snd_pcm_shm_rewind(snd_pcm_t *pcm, snd_pcm_uframes_t fr
|
|||
{
|
||||
snd_pcm_shm_t *shm = pcm->private;
|
||||
volatile snd_pcm_shm_ctrl_t *ctrl = shm->ctrl;
|
||||
ctrl->cmd = SND_PCM_IOCTL_REWIND;
|
||||
ctrl->cmd = SNDRV_PCM_IOCTL_REWIND;
|
||||
ctrl->u.rewind.frames = frames;
|
||||
return snd_pcm_shm_action(pcm);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue