mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-12-17 08:56:45 -05:00
Uniformed some internal names. Bug fixes
This commit is contained in:
parent
fa6f875f57
commit
aa813e1f39
16 changed files with 45 additions and 57 deletions
|
|
@ -572,28 +572,28 @@ snd_pcm_sframes_t snd_pcm_bytes_to_frames(snd_pcm_t *pcm, ssize_t bytes)
|
||||||
{
|
{
|
||||||
assert(pcm);
|
assert(pcm);
|
||||||
assert(pcm->setup);
|
assert(pcm->setup);
|
||||||
return bytes * 8 / pcm->bits_per_frame;
|
return bytes * 8 / pcm->frame_bits;
|
||||||
}
|
}
|
||||||
|
|
||||||
ssize_t snd_pcm_frames_to_bytes(snd_pcm_t *pcm, snd_pcm_sframes_t frames)
|
ssize_t snd_pcm_frames_to_bytes(snd_pcm_t *pcm, snd_pcm_sframes_t frames)
|
||||||
{
|
{
|
||||||
assert(pcm);
|
assert(pcm);
|
||||||
assert(pcm->setup);
|
assert(pcm->setup);
|
||||||
return frames * pcm->bits_per_frame / 8;
|
return frames * pcm->frame_bits / 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
int snd_pcm_bytes_to_samples(snd_pcm_t *pcm, ssize_t bytes)
|
int snd_pcm_bytes_to_samples(snd_pcm_t *pcm, ssize_t bytes)
|
||||||
{
|
{
|
||||||
assert(pcm);
|
assert(pcm);
|
||||||
assert(pcm->setup);
|
assert(pcm->setup);
|
||||||
return bytes * 8 / pcm->bits_per_sample;
|
return bytes * 8 / pcm->sample_bits;
|
||||||
}
|
}
|
||||||
|
|
||||||
ssize_t snd_pcm_samples_to_bytes(snd_pcm_t *pcm, int samples)
|
ssize_t snd_pcm_samples_to_bytes(snd_pcm_t *pcm, int samples)
|
||||||
{
|
{
|
||||||
assert(pcm);
|
assert(pcm);
|
||||||
assert(pcm->setup);
|
assert(pcm->setup);
|
||||||
return samples * pcm->bits_per_sample / 8;
|
return samples * pcm->sample_bits / 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
int snd_pcm_open(snd_pcm_t **pcmp, char *name,
|
int snd_pcm_open(snd_pcm_t **pcmp, char *name,
|
||||||
|
|
@ -739,8 +739,8 @@ void snd_pcm_areas_from_buf(snd_pcm_t *pcm, snd_pcm_channel_area_t *areas,
|
||||||
unsigned int channels = pcm->channels;
|
unsigned int channels = pcm->channels;
|
||||||
for (channel = 0; channel < channels; ++channel, ++areas) {
|
for (channel = 0; channel < channels; ++channel, ++areas) {
|
||||||
areas->addr = buf;
|
areas->addr = buf;
|
||||||
areas->first = channel * pcm->bits_per_sample;
|
areas->first = channel * pcm->sample_bits;
|
||||||
areas->step = pcm->bits_per_frame;
|
areas->step = pcm->frame_bits;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -752,7 +752,7 @@ void snd_pcm_areas_from_bufs(snd_pcm_t *pcm, snd_pcm_channel_area_t *areas,
|
||||||
for (channel = 0; channel < channels; ++channel, ++areas, ++bufs) {
|
for (channel = 0; channel < channels; ++channel, ++areas, ++bufs) {
|
||||||
areas->addr = *bufs;
|
areas->addr = *bufs;
|
||||||
areas->first = 0;
|
areas->first = 0;
|
||||||
areas->step = pcm->bits_per_sample;
|
areas->step = pcm->sample_bits;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -419,8 +419,6 @@ static int snd_pcm_adpcm_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t * params)
|
||||||
SND_PCM_HW_PARBIT_TICK_TIME;
|
SND_PCM_HW_PARBIT_TICK_TIME;
|
||||||
err = snd_pcm_hw_params_refine(&sparams, links, params);
|
err = snd_pcm_hw_params_refine(&sparams, links, params);
|
||||||
assert(err >= 0);
|
assert(err >= 0);
|
||||||
err = _snd_pcm_hw_refine(&sparams);
|
|
||||||
assert(err >= 0);
|
|
||||||
err = snd_pcm_hw_params(slave, &sparams);
|
err = snd_pcm_hw_params(slave, &sparams);
|
||||||
params->cmask = 0;
|
params->cmask = 0;
|
||||||
sparams.cmask = ~0U;
|
sparams.cmask = ~0U;
|
||||||
|
|
|
||||||
|
|
@ -301,8 +301,6 @@ static int snd_pcm_alaw_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t * params)
|
||||||
SND_PCM_HW_PARBIT_TICK_TIME;
|
SND_PCM_HW_PARBIT_TICK_TIME;
|
||||||
err = snd_pcm_hw_params_refine(&sparams, links, params);
|
err = snd_pcm_hw_params_refine(&sparams, links, params);
|
||||||
assert(err >= 0);
|
assert(err >= 0);
|
||||||
err = _snd_pcm_hw_refine(&sparams);
|
|
||||||
assert(err >= 0);
|
|
||||||
err = snd_pcm_hw_params(slave, &sparams);
|
err = snd_pcm_hw_params(slave, &sparams);
|
||||||
params->cmask = 0;
|
params->cmask = 0;
|
||||||
sparams.cmask = ~0U;
|
sparams.cmask = ~0U;
|
||||||
|
|
|
||||||
|
|
@ -76,8 +76,6 @@ static int snd_pcm_copy_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t *params)
|
||||||
links = ~SND_PCM_HW_PARBIT_ACCESS;
|
links = ~SND_PCM_HW_PARBIT_ACCESS;
|
||||||
err = snd_pcm_hw_params_refine(&sparams, links, params);
|
err = snd_pcm_hw_params_refine(&sparams, links, params);
|
||||||
assert(err >= 0);
|
assert(err >= 0);
|
||||||
err = _snd_pcm_hw_refine(&sparams);
|
|
||||||
assert(err >= 0);
|
|
||||||
err = snd_pcm_hw_params(slave, &sparams);
|
err = snd_pcm_hw_params(slave, &sparams);
|
||||||
params->cmask = 0;
|
params->cmask = 0;
|
||||||
sparams.cmask = ~0U;
|
sparams.cmask = ~0U;
|
||||||
|
|
|
||||||
|
|
@ -335,8 +335,8 @@ static int snd_pcm_file_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t * params)
|
||||||
for (channel = 0; channel < slave->channels; ++channel) {
|
for (channel = 0; channel < slave->channels; ++channel) {
|
||||||
snd_pcm_channel_area_t *a = &file->wbuf_areas[channel];
|
snd_pcm_channel_area_t *a = &file->wbuf_areas[channel];
|
||||||
a->addr = file->wbuf;
|
a->addr = file->wbuf;
|
||||||
a->first = slave->bits_per_sample * channel;
|
a->first = slave->sample_bits * channel;
|
||||||
a->step = slave->bits_per_frame;
|
a->step = slave->frame_bits;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -153,8 +153,6 @@ static int snd_pcm_linear_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t *params)
|
||||||
SND_PCM_HW_PARBIT_TICK_TIME;
|
SND_PCM_HW_PARBIT_TICK_TIME;
|
||||||
err = snd_pcm_hw_params_refine(&sparams, links, params);
|
err = snd_pcm_hw_params_refine(&sparams, links, params);
|
||||||
assert(err >= 0);
|
assert(err >= 0);
|
||||||
err = _snd_pcm_hw_refine(&sparams);
|
|
||||||
assert(err >= 0);
|
|
||||||
err = snd_pcm_hw_params(slave, &sparams);
|
err = snd_pcm_hw_params(slave, &sparams);
|
||||||
params->cmask = 0;
|
params->cmask = 0;
|
||||||
sparams.cmask = ~0U;
|
sparams.cmask = ~0U;
|
||||||
|
|
|
||||||
|
|
@ -113,8 +113,8 @@ struct _snd_pcm {
|
||||||
unsigned int rate_den; /* rate denominator */
|
unsigned int rate_den; /* rate denominator */
|
||||||
snd_pcm_uframes_t fifo_size; /* chip FIFO size in frames */
|
snd_pcm_uframes_t fifo_size; /* chip FIFO size in frames */
|
||||||
snd_pcm_uframes_t buffer_size;
|
snd_pcm_uframes_t buffer_size;
|
||||||
unsigned int bits_per_sample;
|
unsigned int sample_bits;
|
||||||
unsigned int bits_per_frame;
|
unsigned int frame_bits;
|
||||||
snd_pcm_uframes_t *appl_ptr;
|
snd_pcm_uframes_t *appl_ptr;
|
||||||
snd_pcm_uframes_t min_align;
|
snd_pcm_uframes_t min_align;
|
||||||
volatile snd_pcm_uframes_t *hw_ptr;
|
volatile snd_pcm_uframes_t *hw_ptr;
|
||||||
|
|
|
||||||
|
|
@ -230,13 +230,13 @@ int snd_pcm_channel_info_shm(snd_pcm_t *pcm, snd_pcm_channel_info_t *info,
|
||||||
switch (pcm->access) {
|
switch (pcm->access) {
|
||||||
case SND_PCM_ACCESS_MMAP_INTERLEAVED:
|
case SND_PCM_ACCESS_MMAP_INTERLEAVED:
|
||||||
case SND_PCM_ACCESS_RW_INTERLEAVED:
|
case SND_PCM_ACCESS_RW_INTERLEAVED:
|
||||||
info->first = info->channel * pcm->bits_per_sample;
|
info->first = info->channel * pcm->sample_bits;
|
||||||
info->step = pcm->bits_per_frame;
|
info->step = pcm->frame_bits;
|
||||||
break;
|
break;
|
||||||
case SND_PCM_ACCESS_MMAP_NONINTERLEAVED:
|
case SND_PCM_ACCESS_MMAP_NONINTERLEAVED:
|
||||||
case SND_PCM_ACCESS_RW_NONINTERLEAVED:
|
case SND_PCM_ACCESS_RW_NONINTERLEAVED:
|
||||||
info->first = 0;
|
info->first = 0;
|
||||||
info->step = pcm->bits_per_sample;
|
info->step = pcm->sample_bits;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
assert(0);
|
assert(0);
|
||||||
|
|
@ -281,7 +281,7 @@ int snd_pcm_mmap(snd_pcm_t *pcm)
|
||||||
unsigned int c1;
|
unsigned int c1;
|
||||||
if (!i->addr) {
|
if (!i->addr) {
|
||||||
char *ptr;
|
char *ptr;
|
||||||
size_t size = i->first + i->step * (pcm->buffer_size - 1) + pcm->bits_per_sample;
|
size_t size = i->first + i->step * (pcm->buffer_size - 1) + pcm->sample_bits;
|
||||||
for (c1 = c + 1; c1 < pcm->channels; ++c1) {
|
for (c1 = c + 1; c1 < pcm->channels; ++c1) {
|
||||||
snd_pcm_channel_info_t *i1 = &pcm->mmap_channels[c1];
|
snd_pcm_channel_info_t *i1 = &pcm->mmap_channels[c1];
|
||||||
size_t s;
|
size_t s;
|
||||||
|
|
@ -300,7 +300,7 @@ int snd_pcm_mmap(snd_pcm_t *pcm)
|
||||||
default:
|
default:
|
||||||
assert(0);
|
assert(0);
|
||||||
}
|
}
|
||||||
s = i1->first + i1->step * (pcm->buffer_size - 1) + pcm->bits_per_sample;
|
s = i1->first + i1->step * (pcm->buffer_size - 1) + pcm->sample_bits;
|
||||||
if (s > size)
|
if (s > size)
|
||||||
size = s;
|
size = s;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -318,8 +318,6 @@ static int snd_pcm_mulaw_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t * params)
|
||||||
SND_PCM_HW_PARBIT_TICK_TIME;
|
SND_PCM_HW_PARBIT_TICK_TIME;
|
||||||
err = snd_pcm_hw_params_refine(&sparams, links, params);
|
err = snd_pcm_hw_params_refine(&sparams, links, params);
|
||||||
assert(err >= 0);
|
assert(err >= 0);
|
||||||
err = _snd_pcm_hw_refine(&sparams);
|
|
||||||
assert(err >= 0);
|
|
||||||
err = snd_pcm_hw_params(slave, &sparams);
|
err = snd_pcm_hw_params(slave, &sparams);
|
||||||
params->cmask = 0;
|
params->cmask = 0;
|
||||||
sparams.cmask = ~0U;
|
sparams.cmask = ~0U;
|
||||||
|
|
|
||||||
|
|
@ -212,8 +212,6 @@ static int snd_pcm_multi_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t *params)
|
||||||
multi->slaves[k].channels_count, 0);
|
multi->slaves[k].channels_count, 0);
|
||||||
err = snd_pcm_hw_params_refine(&sparams, links, params);
|
err = snd_pcm_hw_params_refine(&sparams, links, params);
|
||||||
assert(err >= 0);
|
assert(err >= 0);
|
||||||
err = _snd_pcm_hw_refine(&sparams);
|
|
||||||
assert(err >= 0);
|
|
||||||
err = snd_pcm_hw_params(slave, &sparams);
|
err = snd_pcm_hw_params(slave, &sparams);
|
||||||
params->cmask = 0;
|
params->cmask = 0;
|
||||||
sparams.cmask = ~0U;
|
sparams.cmask = ~0U;
|
||||||
|
|
|
||||||
|
|
@ -2244,9 +2244,9 @@ int snd_pcm_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t *params)
|
||||||
pcm->period_size = snd_pcm_hw_param_value(params, SND_PCM_HW_PARAM_PERIOD_SIZE, 0);
|
pcm->period_size = snd_pcm_hw_param_value(params, SND_PCM_HW_PARAM_PERIOD_SIZE, 0);
|
||||||
pcm->buffer_size = snd_pcm_hw_param_value(params, SND_PCM_HW_PARAM_BUFFER_SIZE, 0);
|
pcm->buffer_size = snd_pcm_hw_param_value(params, SND_PCM_HW_PARAM_BUFFER_SIZE, 0);
|
||||||
pcm->tick_time = snd_pcm_hw_param_value(params, SND_PCM_HW_PARAM_TICK_TIME, 0);
|
pcm->tick_time = snd_pcm_hw_param_value(params, SND_PCM_HW_PARAM_TICK_TIME, 0);
|
||||||
pcm->bits_per_sample = snd_pcm_format_physical_width(pcm->format);
|
pcm->sample_bits = snd_pcm_hw_param_value(params, SND_PCM_HW_PARAM_SAMPLE_BITS, 0);
|
||||||
pcm->bits_per_frame = pcm->bits_per_sample * pcm->channels;
|
pcm->frame_bits = snd_pcm_hw_param_value(params, SND_PCM_HW_PARAM_FRAME_BITS, 0);
|
||||||
fb = pcm->bits_per_frame;
|
fb = pcm->frame_bits;
|
||||||
min_align = 1;
|
min_align = 1;
|
||||||
while (fb % 8) {
|
while (fb % 8) {
|
||||||
fb *= 2;
|
fb *= 2;
|
||||||
|
|
|
||||||
|
|
@ -312,12 +312,15 @@ static int snd_pcm_plug_hw_link(snd_pcm_hw_params_t *params,
|
||||||
if (format_never || channels_never || rate_never) {
|
if (format_never || channels_never || rate_never) {
|
||||||
mask_t *mmap_mask = alloca(mask_sizeof());
|
mask_t *mmap_mask = alloca(mask_sizeof());
|
||||||
mask_load(mmap_mask, SND_PCM_ACCBIT_MMAP);
|
mask_load(mmap_mask, SND_PCM_ACCBIT_MMAP);
|
||||||
_snd_pcm_hw_param_mask(sparams, SND_PCM_HW_PARAM_ACCESS,
|
err = _snd_pcm_hw_param_mask(sparams, SND_PCM_HW_PARAM_ACCESS,
|
||||||
mmap_mask);
|
mmap_mask);
|
||||||
|
assert(err >= 0);
|
||||||
} else
|
} else
|
||||||
mask_union(access_mask, snd_pcm_hw_param_value_mask(sparams, SND_PCM_HW_PARAM_ACCESS));
|
mask_union(access_mask, snd_pcm_hw_param_value_mask(sparams, SND_PCM_HW_PARAM_ACCESS));
|
||||||
_snd_pcm_hw_param_mask(params, SND_PCM_HW_PARAM_ACCESS,
|
err = _snd_pcm_hw_param_mask(params, SND_PCM_HW_PARAM_ACCESS,
|
||||||
access_mask);
|
access_mask);
|
||||||
|
if (err < 0)
|
||||||
|
return err;
|
||||||
sparams->cmask |= scmask;
|
sparams->cmask |= scmask;
|
||||||
return snd_pcm_generic_hw_link(params, sparams, slave, links);
|
return snd_pcm_generic_hw_link(params, sparams, slave, links);
|
||||||
}
|
}
|
||||||
|
|
@ -391,8 +394,8 @@ static void snd_pcm_plug_clear(snd_pcm_t *pcm)
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
unsigned int access;
|
snd_pcm_access_t access;
|
||||||
unsigned int format;
|
snd_pcm_format_t format;
|
||||||
unsigned int channels;
|
unsigned int channels;
|
||||||
unsigned int rate;
|
unsigned int rate;
|
||||||
} snd_pcm_plug_params_t;
|
} snd_pcm_plug_params_t;
|
||||||
|
|
@ -603,18 +606,21 @@ static int snd_pcm_plug_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t *params)
|
||||||
clt_params.channels = snd_pcm_hw_param_value(params, SND_PCM_HW_PARAM_CHANNELS, 0);
|
clt_params.channels = snd_pcm_hw_param_value(params, SND_PCM_HW_PARAM_CHANNELS, 0);
|
||||||
clt_params.rate = snd_pcm_hw_param_value(params, SND_PCM_HW_PARAM_RATE, 0);
|
clt_params.rate = snd_pcm_hw_param_value(params, SND_PCM_HW_PARAM_RATE, 0);
|
||||||
|
|
||||||
if (snd_pcm_hw_param_test(params, SND_PCM_HW_PARAM_ACCESS, clt_params.access))
|
|
||||||
slv_params.access = clt_params.access;
|
|
||||||
else
|
|
||||||
slv_params.access = snd_pcm_hw_param_first(slave, &sparams, SND_PCM_HW_PARAM_ACCESS, 0);
|
|
||||||
slv_params.format = snd_pcm_hw_param_value(&sparams, SND_PCM_HW_PARAM_FORMAT, 0);
|
slv_params.format = snd_pcm_hw_param_value(&sparams, SND_PCM_HW_PARAM_FORMAT, 0);
|
||||||
slv_params.channels = snd_pcm_hw_param_value(&sparams, SND_PCM_HW_PARAM_CHANNELS, 0);
|
slv_params.channels = snd_pcm_hw_param_value(&sparams, SND_PCM_HW_PARAM_CHANNELS, 0);
|
||||||
slv_params.rate = snd_pcm_hw_param_value(&sparams, SND_PCM_HW_PARAM_RATE, 0);
|
slv_params.rate = snd_pcm_hw_param_value(&sparams, SND_PCM_HW_PARAM_RATE, 0);
|
||||||
|
|
||||||
snd_pcm_plug_clear(pcm);
|
snd_pcm_plug_clear(pcm);
|
||||||
err = snd_pcm_plug_insert_plugins(pcm, &clt_params, &slv_params);
|
if (clt_params.format == slv_params.format &&
|
||||||
if (err < 0)
|
clt_params.channels == slv_params.channels &&
|
||||||
return err;
|
clt_params.rate == slv_params.rate &&
|
||||||
|
snd_pcm_hw_param_test(params, SND_PCM_HW_PARAM_ACCESS, clt_params.access))
|
||||||
|
slv_params.access = clt_params.access;
|
||||||
|
else {
|
||||||
|
slv_params.access = snd_pcm_hw_param_first(slave, &sparams, SND_PCM_HW_PARAM_ACCESS, 0);
|
||||||
|
err = snd_pcm_plug_insert_plugins(pcm, &clt_params, &slv_params);
|
||||||
|
if (err < 0)
|
||||||
|
return err;
|
||||||
|
}
|
||||||
err = snd_pcm_hw_params(plug->slave, params);
|
err = snd_pcm_hw_params(plug->slave, params);
|
||||||
if (err < 0) {
|
if (err < 0) {
|
||||||
snd_pcm_plug_clear(pcm);
|
snd_pcm_plug_clear(pcm);
|
||||||
|
|
|
||||||
|
|
@ -335,8 +335,6 @@ static int snd_pcm_rate_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t * params)
|
||||||
|
|
||||||
err = snd_pcm_hw_params_refine(&sparams, links, params);
|
err = snd_pcm_hw_params_refine(&sparams, links, params);
|
||||||
assert(err >= 0);
|
assert(err >= 0);
|
||||||
err = _snd_pcm_hw_refine(&sparams);
|
|
||||||
assert(err >= 0);
|
|
||||||
err = snd_pcm_hw_params(slave, &sparams);
|
err = snd_pcm_hw_params(slave, &sparams);
|
||||||
params->cmask = 0;
|
params->cmask = 0;
|
||||||
sparams.cmask = ~0U;
|
sparams.cmask = ~0U;
|
||||||
|
|
|
||||||
|
|
@ -499,7 +499,8 @@ static int snd_pcm_route_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t * params)
|
||||||
snd_pcm_t *slave = route->plug.slave;
|
snd_pcm_t *slave = route->plug.slave;
|
||||||
int err;
|
int err;
|
||||||
snd_pcm_hw_params_t sparams;
|
snd_pcm_hw_params_t sparams;
|
||||||
unsigned int links = (SND_PCM_HW_PARBIT_PERIODS |
|
unsigned int links = (SND_PCM_HW_PARBIT_RATE |
|
||||||
|
SND_PCM_HW_PARBIT_PERIODS |
|
||||||
SND_PCM_HW_PARBIT_PERIOD_SIZE |
|
SND_PCM_HW_PARBIT_PERIOD_SIZE |
|
||||||
SND_PCM_HW_PARBIT_PERIOD_TIME |
|
SND_PCM_HW_PARBIT_PERIOD_TIME |
|
||||||
SND_PCM_HW_PARBIT_BUFFER_SIZE |
|
SND_PCM_HW_PARBIT_BUFFER_SIZE |
|
||||||
|
|
@ -534,8 +535,6 @@ static int snd_pcm_route_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t * params)
|
||||||
|
|
||||||
err = snd_pcm_hw_params_refine(&sparams, links, params);
|
err = snd_pcm_hw_params_refine(&sparams, links, params);
|
||||||
assert(err >= 0);
|
assert(err >= 0);
|
||||||
err = _snd_pcm_hw_refine(&sparams);
|
|
||||||
assert(err >= 0);
|
|
||||||
err = snd_pcm_hw_params(slave, &sparams);
|
err = snd_pcm_hw_params(slave, &sparams);
|
||||||
params->cmask = 0;
|
params->cmask = 0;
|
||||||
sparams.cmask = ~0U;
|
sparams.cmask = ~0U;
|
||||||
|
|
|
||||||
|
|
@ -584,8 +584,6 @@ static int snd_pcm_share_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t *params)
|
||||||
share->channels_count, 0);
|
share->channels_count, 0);
|
||||||
err = snd_pcm_hw_params_refine(&sparams, links, params);
|
err = snd_pcm_hw_params_refine(&sparams, links, params);
|
||||||
assert(err >= 0);
|
assert(err >= 0);
|
||||||
err = _snd_pcm_hw_refine(&sparams);
|
|
||||||
assert(err >= 0);
|
|
||||||
err = snd_pcm_hw_params(slave->pcm, &sparams);
|
err = snd_pcm_hw_params(slave->pcm, &sparams);
|
||||||
params->cmask = 0;
|
params->cmask = 0;
|
||||||
sparams.cmask = ~0U;
|
sparams.cmask = ~0U;
|
||||||
|
|
|
||||||
|
|
@ -235,13 +235,12 @@ static int snd_pcm_shm_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t * params)
|
||||||
saccess_mask);
|
saccess_mask);
|
||||||
err = snd_pcm_hw_params_refine(&sparams, links, params);
|
err = snd_pcm_hw_params_refine(&sparams, links, params);
|
||||||
assert(err >= 0);
|
assert(err >= 0);
|
||||||
err = _snd_pcm_hw_refine(&sparams);
|
|
||||||
assert(err >= 0);
|
|
||||||
err = _snd_pcm_shm_hw_params(pcm, &sparams);
|
err = _snd_pcm_shm_hw_params(pcm, &sparams);
|
||||||
if (err < 0) {
|
params->cmask = 0;
|
||||||
snd_pcm_hw_params_refine(params, links, &sparams);
|
sparams.cmask = ~0U;
|
||||||
|
snd_pcm_hw_params_refine(params, links, &sparams);
|
||||||
|
if (err < 0)
|
||||||
return err;
|
return err;
|
||||||
}
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue