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
f930f37d
Commit
f930f37d
authored
Apr 01, 2012
by
Jurgen Kramer
Committed by
Max Kellermann
Apr 04, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add support for DSD-over-USB version 1.0, remove pre-v1 support
parent
4feb57e8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
9 deletions
+33
-9
user.xml
doc/user.xml
+2
-2
pcm_dsd_usb.c
src/pcm_dsd_usb.c
+28
-5
pcm_dsd_usb.h
src/pcm_dsd_usb.h
+3
-2
No files found.
doc/user.xml
View file @
f930f37d
...
...
@@ -1127,8 +1127,8 @@ systemctl start mpd.socket</programlisting>
<entry>
If set to
<parameter>
yes
</parameter>
, then DSD over
USB according to the
<ulink
url=
"http://www.
dcsltd.co.uk/page/assets/DSDoverUSB.pdf"
>
dCS
suggested standard
</ulink>
is enabled. This wrapsa
url=
"http://www.
sonore.us/DoP_openStandard_1v1.pdf"
>
pro
posed standard by dCS and others
</ulink>
is enabled. This wraps
DSD samples in fake 24 bit PCM, and is understood by
some DSD capable products, but may be harmful to
other hardware. Therefore, the default is
...
...
src/pcm_dsd_usb.c
View file @
f930f37d
...
...
@@ -24,11 +24,19 @@
G_GNUC_CONST
static
inline
uint32_t
pcm_two_dsd_to_usb
(
uint8_t
a
,
uint8_t
b
)
pcm_two_dsd_to_usb
_marker1
(
uint8_t
a
,
uint8_t
b
)
{
return
0xff
aa
0000
|
(
a
<<
8
)
|
b
;
return
0xff
05
0000
|
(
a
<<
8
)
|
b
;
}
G_GNUC_CONST
static
inline
uint32_t
pcm_two_dsd_to_usb_marker2
(
uint8_t
a
,
uint8_t
b
)
{
return
0xfffa0000
|
(
a
<<
8
)
|
b
;
}
const
uint32_t
*
pcm_dsd_to_usb
(
struct
pcm_buffer
*
buffer
,
unsigned
channels
,
const
uint8_t
*
src
,
size_t
src_size
,
...
...
@@ -53,12 +61,27 @@ pcm_dsd_to_usb(struct pcm_buffer *buffer, unsigned channels,
uint32_t
*
const
dest0
=
pcm_buffer_get
(
buffer
,
dest_size
),
*
dest
=
dest0
;
for
(
unsigned
i
=
num_frames
;
i
>
0
;
--
i
)
{
for
(
unsigned
i
=
num_frames
/
2
;
i
>
0
;
--
i
)
{
for
(
unsigned
c
=
channels
;
c
>
0
;
--
c
)
{
/* each 24 bit sample has 16 DSD sample bits
plus the magic 0x05 marker */
*
dest
++
=
pcm_two_dsd_to_usb_marker1
(
src
[
0
],
src
[
channels
]);
/* seek the source pointer to the next
channel */
++
src
;
}
/* skip the second byte of each channel, because we
have already copied it */
src
+=
channels
;
for
(
unsigned
c
=
channels
;
c
>
0
;
--
c
)
{
/* each 24 bit sample has 16 DSD sample bits
plus the magic 0x
a
a marker */
plus the magic 0x
f
a marker */
*
dest
++
=
pcm_two_dsd_to_usb
(
src
[
0
],
src
[
channels
]);
*
dest
++
=
pcm_two_dsd_to_usb
_marker2
(
src
[
0
],
src
[
channels
]);
/* seek the source pointer to the next
channel */
...
...
src/pcm_dsd_usb.h
View file @
f930f37d
...
...
@@ -30,8 +30,9 @@ struct pcm_buffer;
/**
* Pack DSD 1 bit samples into (padded) 24 bit PCM samples for
* playback over USB, according to the dCS suggested standard:
* http://www.dcsltd.co.uk/page/assets/DSDoverUSB.pdf
* playback over USB, according to the proposed standard by
* dCS and others:
* http://www.sonore.us/DoP_openStandard_1v1.pdf
*/
const
uint32_t
*
pcm_dsd_to_usb
(
struct
pcm_buffer
*
buffer
,
unsigned
channels
,
...
...
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