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
21fb7eea
Commit
21fb7eea
authored
Feb 28, 2016
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
output/alsa: probe DSD_U32 if DSD_U8 fails
See
http://bugs.musicpd.org/view.php?id=4485
parent
fd7eb433
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
1 deletion
+31
-1
NEWS
NEWS
+1
-0
AlsaOutputPlugin.cxx
src/output/plugins/AlsaOutputPlugin.cxx
+30
-1
No files found.
NEWS
View file @
21fb7eea
...
...
@@ -30,6 +30,7 @@ ver 0.20 (not yet released)
* output
- alsa: fix multi-channel order
- alsa: remove option "use_mmap"
- alsa: support DSD_U32
- jack: reduce CPU usage
- pulse: set channel map to WAVE-EX
- recorder: record tags
...
...
src/output/plugins/AlsaOutputPlugin.cxx
View file @
21fb7eea
...
...
@@ -24,6 +24,7 @@
#include "mixer/MixerList.hxx"
#include "pcm/PcmExport.hxx"
#include "config/ConfigError.hxx"
#include "system/ByteOrder.hxx"
#include "util/Manual.hxx"
#include "util/Error.hxx"
#include "util/Domain.hxx"
...
...
@@ -403,6 +404,34 @@ AlsaTryFormatOrByteSwap(snd_pcm_t *pcm, snd_pcm_hw_params_t *hwparams,
return
err
;
}
/**
* Attempts to configure the specified sample format. On DSD_U8
* failure, attempt to switch to DSD_U32.
*/
static
int
AlsaTryFormatDsd
(
snd_pcm_t
*
pcm
,
snd_pcm_hw_params_t
*
hwparams
,
snd_pcm_format_t
fmt
,
PcmExport
::
Params
&
params
)
{
int
err
=
AlsaTryFormatOrByteSwap
(
pcm
,
hwparams
,
fmt
,
params
);
#if defined(ENABLE_DSD) && defined(HAVE_ALSA_DSD_U32)
if
(
err
==
0
)
params
.
dsd_u32
=
false
;
if
(
err
==
-
EINVAL
&&
fmt
==
SND_PCM_FORMAT_DSD_U8
)
{
/* attempt to switch to DSD_U32 */
fmt
=
IsLittleEndian
()
?
SND_PCM_FORMAT_DSD_U32_LE
:
SND_PCM_FORMAT_DSD_U32_BE
;
err
=
AlsaTryFormatOrByteSwap
(
pcm
,
hwparams
,
fmt
,
params
);
if
(
err
==
0
)
params
.
dsd_u32
=
true
;
}
#endif
return
err
;
}
static
int
AlsaTryFormat
(
snd_pcm_t
*
pcm
,
snd_pcm_hw_params_t
*
hwparams
,
SampleFormat
sample_format
,
...
...
@@ -412,7 +441,7 @@ AlsaTryFormat(snd_pcm_t *pcm, snd_pcm_hw_params_t *hwparams,
if
(
alsa_format
==
SND_PCM_FORMAT_UNKNOWN
)
return
-
EINVAL
;
return
AlsaTryFormat
OrByteSwap
(
pcm
,
hwparams
,
alsa_format
,
params
);
return
AlsaTryFormat
Dsd
(
pcm
,
hwparams
,
alsa_format
,
params
);
}
/**
...
...
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