Skip to content

Commit

Permalink
ALSA: usb-audio: Eliminate noise at the start of DSD playback.
Browse files Browse the repository at this point in the history
[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 <[email protected]>
Signed-off-by: Takashi Iwai <[email protected]>
  • Loading branch information
nobnob77 authored and tiwai committed Dec 12, 2016
1 parent 7f38ca0 commit 0120073
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion sound/usb/endpoint.c
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,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 50% higher than nominal */
ep->freqmax = ep->freqn + (ep->freqn >> 1);
Expand Down

0 comments on commit 0120073

Please sign in to comment.