Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
af991765
Commit
af991765
authored
Feb 04, 2013
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
output/alsa: workaround for noise after manual song change
Workaround for driver bug observed on the Raspberry Pi, see code comment for details.
parent
57e825df
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
0 deletions
+21
-0
NEWS
NEWS
+1
-0
AlsaOutputPlugin.cxx
src/output/AlsaOutputPlugin.cxx
+20
-0
No files found.
NEWS
View file @
af991765
...
...
@@ -11,6 +11,7 @@ ver 0.18 (2012/??/??)
- vorbis: accept floating point input samples
* output:
- new option "tags" may be used to disable sending tags to output
- alsa: workaround for noise after manual song change
* improved decoder/output error reporting
...
...
src/output/AlsaOutputPlugin.cxx
View file @
af991765
...
...
@@ -726,6 +726,26 @@ alsa_recover(AlsaOutput *ad, int err)
case
SND_PCM_STATE_XRUN
:
ad
->
period_position
=
0
;
err
=
snd_pcm_prepare
(
ad
->
pcm
);
if
(
err
==
0
)
{
/* this works around a driver bug observed on
the Raspberry Pi: after snd_pcm_drop(), the
whole ring buffer must be invalidated, but
the snd_pcm_prepare() call above makes the
driver play random data that just happens
to be still in the buffer; by adding and
cancelling some silence, this bug does not
occur */
alsa_write_silence
(
ad
,
ad
->
period_frames
);
/* cancel the silence data right away to avoid
increasing latency; even though this
function call invalidates the portion of
silence, the driver seems to avoid the
bug */
snd_pcm_reset
(
ad
->
pcm
);
}
break
;
case
SND_PCM_STATE_DISCONNECTED
:
break
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment