Skip to content

Commit ace9881

Browse files
tiwaipopcornmix
authored andcommitted
staging: bcm2835-audio: Fix draining behavior regression
The PCM draining behavior got broken since the recent refactoring, and this turned out to be the incorrect expectation of the firmware behavior regarding "draining". While I expected the "drain" flag at the stop operation would do processing the queued samples, it seems rather dropping the samples. As a quick fix, just drop the SNDRV_PCM_INFO_DRAIN_TRIGGER flag, so that the driver uses the normal PCM draining procedure. Also, put some caution comment to the function for future readers not to fall into the same pitfall. Fixes: d7ca3a7 ("staging: bcm2835-audio: Operate non-atomic PCM ops") BugLink: #2983 Cc: [email protected] Signed-off-by: Takashi Iwai <[email protected]>
1 parent d79e4ed commit ace9881

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

drivers/staging/vc04_services/bcm2835-audio/bcm2835-pcm.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
static const struct snd_pcm_hardware snd_bcm2835_playback_hw = {
1313
.info = (SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER |
1414
SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP_VALID |
15-
SNDRV_PCM_INFO_DRAIN_TRIGGER | SNDRV_PCM_INFO_SYNC_APPLPTR),
15+
SNDRV_PCM_INFO_SYNC_APPLPTR),
1616
.formats = SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE,
1717
.rates = SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_192000,
1818
.rate_min = 8000,
@@ -29,7 +29,7 @@ static const struct snd_pcm_hardware snd_bcm2835_playback_hw = {
2929
static const struct snd_pcm_hardware snd_bcm2835_playback_spdif_hw = {
3030
.info = (SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER |
3131
SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP_VALID |
32-
SNDRV_PCM_INFO_DRAIN_TRIGGER | SNDRV_PCM_INFO_SYNC_APPLPTR),
32+
SNDRV_PCM_INFO_SYNC_APPLPTR),
3333
.formats = SNDRV_PCM_FMTBIT_S16_LE,
3434
.rates = SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000 |
3535
SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000 |

drivers/staging/vc04_services/bcm2835-audio/bcm2835-vchiq.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,7 @@ int bcm2835_audio_stop(struct bcm2835_alsa_stream *alsa_stream)
297297
VC_AUDIO_MSG_TYPE_STOP, false);
298298
}
299299

300+
/* FIXME: this doesn't seem working as expected for "draining" */
300301
int bcm2835_audio_drain(struct bcm2835_alsa_stream *alsa_stream)
301302
{
302303
struct vc_audio_msg m = {

0 commit comments

Comments
 (0)