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
47ea6923
Commit
47ea6923
authored
Mar 02, 2014
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
output/alsa: remove the obsolete Raspberry Pi workaround
Has been superseded by the previous commit.
parent
a884e37d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
36 deletions
+0
-36
AlsaOutputPlugin.cxx
src/output/AlsaOutputPlugin.cxx
+0
-36
No files found.
src/output/AlsaOutputPlugin.cxx
View file @
47ea6923
...
@@ -106,14 +106,6 @@ struct AlsaOutput {
...
@@ -106,14 +106,6 @@ struct AlsaOutput {
snd_pcm_uframes_t
period_position
;
snd_pcm_uframes_t
period_position
;
/**
/**
* Set to non-zero when the Raspberry Pi workaround has been
* activated in alsa_recover(); decremented by each write.
* This will avoid activating it again, leading to an endless
* loop. This problem was observed with a "RME Digi9636/52".
*/
unsigned
pi_workaround
;
/**
* Do we need to call snd_pcm_prepare() before the next write?
* Do we need to call snd_pcm_prepare() before the next write?
* It means that we put the device to SND_PCM_STATE_SETUP by
* It means that we put the device to SND_PCM_STATE_SETUP by
* calling snd_pcm_drop().
* calling snd_pcm_drop().
...
@@ -688,8 +680,6 @@ alsa_open(struct audio_output *ao, AudioFormat &audio_format, Error &error)
...
@@ -688,8 +680,6 @@ alsa_open(struct audio_output *ao, AudioFormat &audio_format, Error &error)
{
{
AlsaOutput
*
ad
=
(
AlsaOutput
*
)
ao
;
AlsaOutput
*
ad
=
(
AlsaOutput
*
)
ao
;
ad
->
pi_workaround
=
0
;
int
err
=
snd_pcm_open
(
&
ad
->
pcm
,
alsa_device
(
ad
),
int
err
=
snd_pcm_open
(
&
ad
->
pcm
,
alsa_device
(
ad
),
SND_PCM_STREAM_PLAYBACK
,
ad
->
mode
);
SND_PCM_STREAM_PLAYBACK
,
ad
->
mode
);
if
(
err
<
0
)
{
if
(
err
<
0
)
{
...
@@ -750,29 +740,6 @@ alsa_recover(AlsaOutput *ad, int err)
...
@@ -750,29 +740,6 @@ alsa_recover(AlsaOutput *ad, int err)
case
SND_PCM_STATE_XRUN
:
case
SND_PCM_STATE_XRUN
:
ad
->
period_position
=
0
;
ad
->
period_position
=
0
;
err
=
snd_pcm_prepare
(
ad
->
pcm
);
err
=
snd_pcm_prepare
(
ad
->
pcm
);
if
(
err
==
0
&&
ad
->
pi_workaround
==
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
);
/* disable the workaround for some time */
ad
->
pi_workaround
=
8
;
}
break
;
break
;
case
SND_PCM_STATE_DISCONNECTED
:
case
SND_PCM_STATE_DISCONNECTED
:
break
;
break
;
...
@@ -859,9 +826,6 @@ alsa_play(struct audio_output *ao, const void *chunk, size_t size,
...
@@ -859,9 +826,6 @@ alsa_play(struct audio_output *ao, const void *chunk, size_t size,
ad
->
period_position
=
(
ad
->
period_position
+
ret
)
ad
->
period_position
=
(
ad
->
period_position
+
ret
)
%
ad
->
period_frames
;
%
ad
->
period_frames
;
if
(
ad
->
pi_workaround
>
0
)
--
ad
->
pi_workaround
;
size_t
bytes_written
=
ret
*
ad
->
out_frame_size
;
size_t
bytes_written
=
ret
*
ad
->
out_frame_size
;
return
ad
->
pcm_export
->
CalcSourceSize
(
bytes_written
);
return
ad
->
pcm_export
->
CalcSourceSize
(
bytes_written
);
}
}
...
...
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