Skip to content

Commit b8be71f

Browse files
Eliminate noise at the start of DSD playback.
ALSA: usb-audio: Eliminate noise at the start of DSD playback. Copy mainline DSD playback pop noise fix torvalds@0120073#diff-cc9fc192670bbec31122ad6874641755 [Problem] In some USB DACs, a terrible pop noise comes to be heard at the start of DSD playback (in the following situations). - play first DSD track - change from PCM track to DSD track - change from DSD64 track to DSD128 track (and etc...) - seek DSD track - Fast-Forward/Rewind DSD track [Cause] At the start of playback, there is a little silence. The silence bit pattern "0x69" is required on DSD mode, but it is not like that. [Solution] This patch adds DSD silence pattern to the endpoint settings. Signed-off-by: Nobutaka Okabe <nob77413@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent e600153 commit b8be71f

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

sound/usb/endpoint.c

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -642,8 +642,23 @@ static int data_ep_set_params(struct snd_usb_endpoint *ep,
642642

643643
ep->datainterval = fmt->datainterval;
644644
ep->stride = frame_bits >> 3;
645-
ep->silence_value = pcm_format == SNDRV_PCM_FORMAT_U8 ? 0x80 : 0;
646-
645+
646+
647+
switch (pcm_format) {
648+
case SNDRV_PCM_FORMAT_U8:
649+
ep->silence_value = 0x80;
650+
break;
651+
case SNDRV_PCM_FORMAT_DSD_U8:
652+
case SNDRV_PCM_FORMAT_DSD_U16_LE:
653+
case SNDRV_PCM_FORMAT_DSD_U32_LE:
654+
case SNDRV_PCM_FORMAT_DSD_U16_BE:
655+
case SNDRV_PCM_FORMAT_DSD_U32_BE:
656+
ep->silence_value = 0x69;
657+
break;
658+
default:
659+
ep->silence_value = 0;
660+
}
661+
647662
/* assume max. frequency is 25% higher than nominal */
648663
ep->freqmax = ep->freqn + (ep->freqn >> 2);
649664
/* Round up freqmax to nearest integer in order to calculate maximum

0 commit comments

Comments
 (0)