mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-10-31 22:25:35 -04:00
dmix - Enable auto format detection as default
The direct plugins have the automatic format-detection feature but it wasn't enabled properly in the interface. Now you can pass the format "unchanged" to make the plugin detect a proper format. This will change the default format of some drivers, such as, HD-audio.
This commit is contained in:
parent
91fc64cefb
commit
35d4f9b8d7
3 changed files with 11 additions and 5 deletions
|
|
@ -1267,7 +1267,7 @@ int _snd_pcm_dmix_open(snd_pcm_t **pcmp, const char *name,
|
|||
params.periods = 3;
|
||||
|
||||
err = snd_pcm_slave_conf(root, dopen.slave, &sconf, 8,
|
||||
SND_PCM_HW_PARAM_FORMAT, 0, ¶ms.format,
|
||||
SND_PCM_HW_PARAM_FORMAT, SCONF_UNCHANGED, ¶ms.format,
|
||||
SND_PCM_HW_PARAM_RATE, 0, ¶ms.rate,
|
||||
SND_PCM_HW_PARAM_CHANNELS, 0, ¶ms.channels,
|
||||
SND_PCM_HW_PARAM_PERIOD_TIME, 0, ¶ms.period_time,
|
||||
|
|
@ -1282,8 +1282,10 @@ int _snd_pcm_dmix_open(snd_pcm_t **pcmp, const char *name,
|
|||
if (psize == -1 && params.period_time == -1)
|
||||
params.period_time = 125000; /* 0.125 seconds */
|
||||
|
||||
/* sorry, limited features */
|
||||
if (! (dmix_supported_format & (1ULL << params.format))) {
|
||||
if (params.format == -2)
|
||||
params.format = SND_PCM_FORMAT_UNKNOWN;
|
||||
else if (!(dmix_supported_format & (1ULL << params.format))) {
|
||||
/* sorry, limited features */
|
||||
SNDERR("Unsupported format");
|
||||
snd_config_delete(sconf);
|
||||
return -EINVAL;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue