Repository navigation
ALSA/ASoC: hda: Address format selection limitations and ambiguity #4539
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
33c4d5d
fcd069e
c3e1ccf
1f8b4a0
f92e880
ce49474
9259b37
20c2126
9f1bc04
5736c7e
a9bb7c8
015312b
47ab5ec
177d6b6
eb37244
f623575
03d751b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2614,6 +2614,8 @@ static int snd_pcm_hw_constraints_complete(struct snd_pcm_substream *substream) | |
| int err; | ||
| unsigned int mask = 0; | ||
|
|
||
| /* All PCMs support at least the default STD subformat. */ | ||
| hw->subformats |= PARAM_MASK_BIT(SNDRV_PCM_SUBFORMAT_STD); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is no definition of SNDRV_PCM_SUBFORMAT_STD that I can find, but it looks to me that it is there to not fail when setting the mask?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. STD is the default and expected to be always supported by any device. So, when adding new flags I had to OR it here to avoid breaking audio for most of the world.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Based on the upstream discussion, the SNDRV_PCM_SUBFORMAT_STD tells that the whole physical width is used? I would expect that drivers would set explicit subformats if they care and they might say that I'm not supporting STD and here you override that statement. if (!hw->subformats)
hw->subformats = PARAM_MASK_BIT(SNDRV_PCM_SUBFORMAT_STD);might be what should be done here? |
||
| if (hw->info & SNDRV_PCM_INFO_INTERLEAVED) | ||
| mask |= PARAM_MASK_BIT(SNDRV_PCM_ACCESS_RW_INTERLEAVED); | ||
| if (hw->info & SNDRV_PCM_INFO_NONINTERLEAVED) | ||
|
|
@@ -2634,8 +2636,7 @@ static int snd_pcm_hw_constraints_complete(struct snd_pcm_substream *substream) | |
| if (err < 0) | ||
| return err; | ||
|
|
||
| err = snd_pcm_hw_constraint_mask(runtime, SNDRV_PCM_HW_PARAM_SUBFORMAT, | ||
| PARAM_MASK_BIT(SNDRV_PCM_SUBFORMAT_STD)); | ||
| err = snd_pcm_hw_constraint_mask(runtime, SNDRV_PCM_HW_PARAM_SUBFORMAT, hw->subformats); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. snd_pcm_hw_constraint_mask64() ?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ack. |
||
| if (err < 0) | ||
| return err; | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it make sense to update the
params_width()so all drivers will get to support the subformat out of box?