Re: [Musicpd-dev-team] [PATCH] Add support for DSD-over-USB version 1.0, remove pre-v1 support - updated docs

2012-04-04 Thread Max Kellermann
On 2012/04/02 18:36, Jurgen Kramer gtmkra...@xs4all.nl wrote:
 Hi,
 
 Attached patch updates the documentation. Modified the links to the
 documentation of the DSD-over-USB standard version 1.1. 
 JR will make the link live later today.

This one and the DSD1.0 patch merged to master.

--
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second 
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev
___
Musicpd-dev-team mailing list
Musicpd-dev-team@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/musicpd-dev-team


Re: [Musicpd-dev-team] [PATCH] Add support for DSD-over-USB version 1.0, remove pre-v1 support - updated docs

2012-04-03 Thread Jurgen Kramer
On Mon, 2012-04-02 at 18:36 +0200, Jurgen Kramer wrote:
 Hi,
 
 Attached patch updates the documentation. Modified the links to the
 documentation of the DSD-over-USB standard version 1.1. 
 JR will make the link live later today.

Link to DSD-over-USB standard version 1.1 document is no live.

Jurgen


--
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second 
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev
___
Musicpd-dev-team mailing list
Musicpd-dev-team@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/musicpd-dev-team


Re: [Musicpd-dev-team] [PATCH] Add support for DSD-over-USB version 1.0, remove pre-v1 support

2012-04-02 Thread Max Kellermann
On 2012/04/01 11:10, Jurgen Kramer gtmkra...@xs4all.nl wrote:
 Hi,
 
 Attached patch adds support for DSD-over-USB version 1.0 and removes
 support for the old pre-v1 standard. Patch is against current git.

Please update the URLs to the official documentation.

--
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
___
Musicpd-dev-team mailing list
Musicpd-dev-team@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/musicpd-dev-team


[Musicpd-dev-team] [PATCH] Add support for DSD-over-USB version 1.0, remove pre-v1 support - updated docs

2012-04-02 Thread Jurgen Kramer
Hi,

Attached patch updates the documentation. Modified the links to the
documentation of the DSD-over-USB standard version 1.1. 
JR will make the link live later today.

---
 doc/user.xml  |4 ++--
 src/pcm_dsd_usb.h |5 +++--
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/doc/user.xml b/doc/user.xml
index 6c0547f..cd36528 100644
--- a/doc/user.xml
+++ b/doc/user.xml
@@ -1127,8 +1127,8 @@ systemctl start mpd.socket/programlisting
 entry
   If set to parameteryes/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
diff --git a/src/pcm_dsd_usb.h b/src/pcm_dsd_usb.h
index 3e7ad8f..3893584 100644
--- a/src/pcm_dsd_usb.h
+++ b/src/pcm_dsd_usb.h
@@ -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,
-- 
1.7.6.5

--
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure___
Musicpd-dev-team mailing list
Musicpd-dev-team@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/musicpd-dev-team


[Musicpd-dev-team] [PATCH] Add support for DSD-over-USB version 1.0, remove pre-v1 support

2012-04-01 Thread Jurgen Kramer
Hi,

Attached patch adds support for DSD-over-USB version 1.0 and removes
support for the old pre-v1 standard. Patch is against current git.

---
 src/pcm_dsd_usb.c |   33 -
 1 files changed, 28 insertions(+), 5 deletions(-)

Jurgen

diff --git a/src/pcm_dsd_usb.c b/src/pcm_dsd_usb.c
index 976420c..4b5e39f 100644
--- a/src/pcm_dsd_usb.c
+++ b/src/pcm_dsd_usb.c
@@ -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 0xffaa | (a  8) | b;
+	return 0xff05 | (a  8) | b;
 }
 
+G_GNUC_CONST
+static inline uint32_t
+pcm_two_dsd_to_usb_marker2(uint8_t a, uint8_t b)
+{
+	return 0xfffa | (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 0xaa marker */
+			   plus the magic 0xfa 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 */
-- 
1.7.6.5

--
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure___
Musicpd-dev-team mailing list
Musicpd-dev-team@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/musicpd-dev-team