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
08ce24ec
Commit
08ce24ec
authored
Mar 18, 2012
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
audio_format: basic support for DSD-over-USB
parent
281b8714
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
30 additions
and
0 deletions
+30
-0
audio_format.c
src/audio_format.c
+3
-0
audio_format.h
src/audio_format.h
+9
-0
audio_parser.c
src/audio_parser.c
+6
-0
flac_pcm.c
src/decoder/flac_pcm.c
+1
-0
alsa_output_plugin.c
src/output/alsa_output_plugin.c
+1
-0
oss_output_plugin.c
src/output/oss_output_plugin.c
+1
-0
pcm_byteswap.c
src/pcm_byteswap.c
+1
-0
pcm_convert.c
src/pcm_convert.c
+1
-0
pcm_format.c
src/pcm_format.c
+4
-0
pcm_mix.c
src/pcm_mix.c
+2
-0
pcm_volume.c
src/pcm_volume.c
+1
-0
No files found.
src/audio_format.c
View file @
08ce24ec
...
...
@@ -77,6 +77,9 @@ sample_format_to_string(enum sample_format format)
case
SAMPLE_FORMAT_DSD_LSBFIRST
:
return
"dsdl"
;
case
SAMPLE_FORMAT_DSD_OVER_USB
:
return
"dsdusb"
;
}
/* unreachable */
...
...
src/audio_format.h
View file @
08ce24ec
...
...
@@ -61,6 +61,13 @@ enum sample_format {
* comes first.
*/
SAMPLE_FORMAT_DSD_LSBFIRST
,
/**
* DSD packed in 24 bit samples (no padding), according to the
* dCS suggested standard:
* http://www.dcsltd.co.uk/page/assets/DSDoverUSB.pdf
*/
SAMPLE_FORMAT_DSD_OVER_USB
,
};
static
const
unsigned
MAX_CHANNELS
=
8
;
...
...
@@ -189,6 +196,7 @@ audio_valid_sample_format(enum sample_format format)
case
SAMPLE_FORMAT_FLOAT
:
case
SAMPLE_FORMAT_DSD
:
case
SAMPLE_FORMAT_DSD_LSBFIRST
:
case
SAMPLE_FORMAT_DSD_OVER_USB
:
return
true
;
case
SAMPLE_FORMAT_UNDEFINED
:
...
...
@@ -258,6 +266,7 @@ sample_format_size(enum sample_format format)
return
2
;
case
SAMPLE_FORMAT_S24
:
case
SAMPLE_FORMAT_DSD_OVER_USB
:
return
3
;
case
SAMPLE_FORMAT_S24_P32
:
...
...
src/audio_parser.c
View file @
08ce24ec
...
...
@@ -87,6 +87,12 @@ parse_sample_format(const char *src, bool mask,
return
true
;
}
if
(
memcmp
(
src
,
"dsdusb"
,
6
)
==
0
)
{
*
sample_format_r
=
SAMPLE_FORMAT_DSD_OVER_USB
;
*
endptr_r
=
src
+
6
;
return
true
;
}
if
(
memcmp
(
src
,
"dsd"
,
3
)
==
0
)
{
if
(
src
[
3
]
==
'l'
)
{
*
sample_format_r
=
SAMPLE_FORMAT_DSD_LSBFIRST
;
...
...
src/decoder/flac_pcm.c
View file @
08ce24ec
...
...
@@ -105,6 +105,7 @@ flac_convert(void *dest,
case
SAMPLE_FORMAT_FLOAT
:
case
SAMPLE_FORMAT_DSD
:
case
SAMPLE_FORMAT_DSD_LSBFIRST
:
case
SAMPLE_FORMAT_DSD_OVER_USB
:
case
SAMPLE_FORMAT_UNDEFINED
:
/* unreachable */
assert
(
false
);
...
...
src/output/alsa_output_plugin.c
View file @
08ce24ec
...
...
@@ -196,6 +196,7 @@ get_bitformat(enum sample_format sample_format)
case
SAMPLE_FORMAT_UNDEFINED
:
case
SAMPLE_FORMAT_DSD
:
case
SAMPLE_FORMAT_DSD_LSBFIRST
:
case
SAMPLE_FORMAT_DSD_OVER_USB
:
return
SND_PCM_FORMAT_UNKNOWN
;
case
SAMPLE_FORMAT_S8
:
...
...
src/output/oss_output_plugin.c
View file @
08ce24ec
...
...
@@ -398,6 +398,7 @@ sample_format_to_oss(enum sample_format format)
case
SAMPLE_FORMAT_FLOAT
:
case
SAMPLE_FORMAT_DSD
:
case
SAMPLE_FORMAT_DSD_LSBFIRST
:
case
SAMPLE_FORMAT_DSD_OVER_USB
:
return
AFMT_QUERY
;
case
SAMPLE_FORMAT_S8
:
...
...
src/pcm_byteswap.c
View file @
08ce24ec
...
...
@@ -70,6 +70,7 @@ pcm_byteswap(struct pcm_buffer *buffer, enum sample_format format,
case
SAMPLE_FORMAT_UNDEFINED
:
case
SAMPLE_FORMAT_S24
:
case
SAMPLE_FORMAT_FLOAT
:
case
SAMPLE_FORMAT_DSD_OVER_USB
:
/* not implemented */
return
NULL
;
...
...
src/pcm_convert.c
View file @
08ce24ec
...
...
@@ -82,6 +82,7 @@ pcm_convert_channels(struct pcm_buffer *buffer, enum sample_format format,
case
SAMPLE_FORMAT_FLOAT
:
case
SAMPLE_FORMAT_DSD
:
case
SAMPLE_FORMAT_DSD_LSBFIRST
:
case
SAMPLE_FORMAT_DSD_OVER_USB
:
g_set_error
(
error_r
,
pcm_convert_quark
(),
0
,
"Channel conversion not implemented for format '%s'"
,
sample_format_to_string
(
format
));
...
...
src/pcm_format.c
View file @
08ce24ec
...
...
@@ -149,6 +149,7 @@ pcm_convert_to_16(struct pcm_buffer *buffer, struct pcm_dither *dither,
case
SAMPLE_FORMAT_UNDEFINED
:
case
SAMPLE_FORMAT_DSD
:
case
SAMPLE_FORMAT_DSD_LSBFIRST
:
case
SAMPLE_FORMAT_DSD_OVER_USB
:
break
;
case
SAMPLE_FORMAT_S8
:
...
...
@@ -269,6 +270,7 @@ pcm_convert_to_24(struct pcm_buffer *buffer,
case
SAMPLE_FORMAT_UNDEFINED
:
case
SAMPLE_FORMAT_DSD
:
case
SAMPLE_FORMAT_DSD_LSBFIRST
:
case
SAMPLE_FORMAT_DSD_OVER_USB
:
break
;
case
SAMPLE_FORMAT_S8
:
...
...
@@ -395,6 +397,7 @@ pcm_convert_to_32(struct pcm_buffer *buffer,
case
SAMPLE_FORMAT_UNDEFINED
:
case
SAMPLE_FORMAT_DSD
:
case
SAMPLE_FORMAT_DSD_LSBFIRST
:
case
SAMPLE_FORMAT_DSD_OVER_USB
:
break
;
case
SAMPLE_FORMAT_S8
:
...
...
@@ -532,6 +535,7 @@ pcm_convert_to_float(struct pcm_buffer *buffer,
case
SAMPLE_FORMAT_UNDEFINED
:
case
SAMPLE_FORMAT_DSD
:
case
SAMPLE_FORMAT_DSD_LSBFIRST
:
case
SAMPLE_FORMAT_DSD_OVER_USB
:
break
;
case
SAMPLE_FORMAT_S8
:
...
...
src/pcm_mix.c
View file @
08ce24ec
...
...
@@ -122,6 +122,7 @@ pcm_add_vol(void *buffer1, const void *buffer2, size_t size,
case
SAMPLE_FORMAT_S24
:
case
SAMPLE_FORMAT_DSD
:
case
SAMPLE_FORMAT_DSD_LSBFIRST
:
case
SAMPLE_FORMAT_DSD_OVER_USB
:
/* not implemented */
return
false
;
...
...
@@ -233,6 +234,7 @@ pcm_add(void *buffer1, const void *buffer2, size_t size,
case
SAMPLE_FORMAT_S24
:
case
SAMPLE_FORMAT_DSD
:
case
SAMPLE_FORMAT_DSD_LSBFIRST
:
case
SAMPLE_FORMAT_DSD_OVER_USB
:
/* not implemented */
return
false
;
...
...
src/pcm_volume.c
View file @
08ce24ec
...
...
@@ -161,6 +161,7 @@ pcm_volume(void *buffer, size_t length,
case
SAMPLE_FORMAT_S24
:
case
SAMPLE_FORMAT_DSD
:
case
SAMPLE_FORMAT_DSD_LSBFIRST
:
case
SAMPLE_FORMAT_DSD_OVER_USB
:
/* not implemented */
return
false
;
...
...
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