Merge pull request #340 from epicfrequency/patch-1

ALSA: usb-audio: Eliminate noise at the start of DSD playback.
This commit is contained in:
Mauro Ribeiro
2018-02-24 21:48:29 -03:00
committed by GitHub

View File

@@ -592,7 +592,21 @@ static int data_ep_set_params(struct snd_usb_endpoint *ep,
ep->datainterval = fmt->datainterval;
ep->stride = frame_bits >> 3;
ep->silence_value = pcm_format == SNDRV_PCM_FORMAT_U8 ? 0x80 : 0;
switch (pcm_format) {
case SNDRV_PCM_FORMAT_U8:
ep->silence_value = 0x80;
break;
case SNDRV_PCM_FORMAT_DSD_U8:
case SNDRV_PCM_FORMAT_DSD_U16_LE:
case SNDRV_PCM_FORMAT_DSD_U32_LE:
case SNDRV_PCM_FORMAT_DSD_U16_BE:
case SNDRV_PCM_FORMAT_DSD_U32_BE:
ep->silence_value = 0x69;
break;
default:
ep->silence_value = 0;
}
/* assume max. frequency is 25% higher than nominal */
ep->freqmax = ep->freqn + (ep->freqn >> 2);