All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jussi Laako <jussi@sonarnerd.net>
To: Daniel Mack <zonque@gmail.com>
Cc: alsa-devel@alsa-project.org, Takashi Iwai <tiwai@suse.de>,
	clemens@ladisch.de, demian@auraliti.com, ray@auraliti.com,
	andreas@akdesigninc.com
Subject: Re: Support for DSD streams
Date: Sat, 23 Mar 2013 21:53:59 +0200	[thread overview]
Message-ID: <514E0857.8010201@sonarnerd.net> (raw)
In-Reply-To: <514D927B.3080000@gmail.com>

Hi Daniel,

On 03/23/2013 01:31 PM, Daniel Mack wrote:
> Ok, but how do you know about which interfaces are capable of handling
> that? Are you maintaining a white list?

It's all up to user configuration, just an option in GUI for it. There 
are still some devices where the support depends on firmware version 
(support was introduced as firmware upgrade) so white listing is not so 
feasible always. But the situation is getting better. However I don't 
want to maintain a white list of vendor/device id's inside my 
application. Also the same format works over S/PDIF or AES/EBU just fine 
(with dual-wire up to DSD128). So automatic detection is not always 
possible anyway.

However I'm hoping to get the relevant information through the audio API 
in future for all possible interfaces (IOW not S/PDIF or AES/EBU, but 
things like USB, Firewire, PCI(e) and ASoC). Since there many DAC chips 
that have support for DSD it makes sense.

> And does that mean these devices are also wrongly believed to have
> additional PCM interfaces? IOW: do they only work as DSD, breaking all
> applications that believe that they can use all devices that expose a
> PCM interface?

So far all devices have been supporting also PCM, but support for DSD128 
is already a problem. Since with DoP it would require 352.8k PCM sample 
rate support, but some devices can do PCM only up to 192 while being 
able to support DSD128. Currently there's no way to figure out such 
limitations through ALSA (unlike ASIO where sampling rate enumeration is 
completely separate for PCM and DSD). So application would assume that 
also 352.8 PCM is available.

> Can you show the contents of /proc/asound/cardX/stream0 for such a card
> maybe?
> Can you provide the output of "lsusb -v" for any of these?

There's nothing related to DSD there, because DoP is implemented in an 
FPGA behind the audio interface. Most common is the XMOS UAC2 
implementation. Just normal asynchronous UAC2.

For the rest it's device class "vendor specific".

> I'm afraid that adding a DSD format and teaching the driver quirks for
> interfaces that are known to support DSD would break applications that
> already expect to see a usual PCM interface.

Currently most interfaces support usual PCM, but in addition they 
support also DSD. So they have two native sample formats, but only one 
USB format. Except again the vendor specific ones where there tend to be 
two wire formats, like 3-byte 24-bit and byte stream for DSD.

> To be precise: which SND_PCM_FORMAT_* does your application accept, and
> what happens if it sees  SND_PCM_FORMAT_SPECIAL?

For PCM:
         SND_PCM_FORMAT_S16_LE
         SND_PCM_FORMAT_S16_BE
         SND_PCM_FORMAT_S24_LE
         SND_PCM_FORMAT_S24_BE
         SND_PCM_FORMAT_S32_LE
         SND_PCM_FORMAT_S32_BE
         SND_PCM_FORMAT_S18_3LE
         SND_PCM_FORMAT_S20_3LE
         SND_PCM_FORMAT_S24_3LE
         SND_PCM_FORMAT_S18_3BE
         SND_PCM_FORMAT_S20_3BE
         SND_PCM_FORMAT_S24_3BE
         SND_PCM_FORMAT_FLOAT_LE
         SND_PCM_FORMAT_FLOAT_BE
         SND_PCM_FORMAT_FLOAT64_LE
         SND_PCM_FORMAT_FLOAT64_BE

For DSD:
         SND_PCM_FORMAT_S8
         SND_PCM_FORMAT_U8
         SND_PCM_FORMAT_S24_LE
         SND_PCM_FORMAT_U24_LE
         SND_PCM_FORMAT_S24_BE
         SND_PCM_FORMAT_U24_BE
         SND_PCM_FORMAT_S32_LE
         SND_PCM_FORMAT_U32_LE
         SND_PCM_FORMAT_S32_BE
         SND_PCM_FORMAT_U32_BE
         SND_PCM_FORMAT_S24_3LE
         SND_PCM_FORMAT_U24_3LE
         SND_PCM_FORMAT_S24_3BE
         SND_PCM_FORMAT_U24_3BE

I'm currently using SND_PCM_FORMAT_U8 at 352800 for my raw DSD custom 
hacks, because it won't overlap with any real world PCM hardware... For 
DoP devices there are at least SND_PCM_FORMAT_S32_LE and 
SND_PCM_FORMAT_S24_3LE in use. XMOS uses the former one, IIRC Mytek with 
the TCAT Dice FW chipset uses the latter one (and the USB2 is vendor 
specific class).

I don't support SND_PCM_FORMAT_SPECIAL.

> As for the driver, I would not go any further than marking the streams
> as DSD, without touching the payload. The marker bytes as described in
> the DoP document could be handled by some sort of libasound convenience
> function maybe though.

OK, then I would most likely keep the payload packing as it is already...


	- Jussi

  reply	other threads:[~2013-03-23 19:54 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-17 12:07 [PATCH 0/3] ALSA: snd-usb: Some small fixes to make Playback Design products work Daniel Mack
2013-03-17 12:07 ` [PATCH 1/3] ALSA: snd-usb: handle the bmFormats field as unsigned int Daniel Mack
2013-03-17 12:07 ` [PATCH 2/3] ALSA: snd-usb: handle raw data format of UAC2 devices Daniel Mack
2013-03-17 12:07 ` [PATCH 3/3] ALSA: snd-usb: add delay quirk for "Playback Design" products Daniel Mack
2013-03-18  9:07 ` [PATCH 0/3] ALSA: snd-usb: Some small fixes to make Playback Design products work Takashi Iwai
2013-03-18  9:15   ` Daniel Mack
2013-03-18  9:30     ` Takashi Iwai
2013-03-18 13:49       ` Daniel Mack
2013-03-19  2:51         ` Gabriel M. Beddingfield
2013-03-19  6:48           ` Takashi Iwai
2013-03-21 21:21         ` Jussi Laako
2013-03-22  8:11           ` Daniel Mack
2013-03-22 19:37             ` Jussi Laako
2013-03-23 11:31               ` Support for DSD streams (was: Re: [PATCH 0/3] ALSA: snd-usb: Some small fixes to make Playback Design products work) Daniel Mack
2013-03-23 19:53                 ` Jussi Laako [this message]
     [not found]             ` <7.0.0.16.2.20130322082602.0605cbc0@akdesigninc.com>
2013-03-23 11:50               ` Daniel Mack
     [not found]                 ` <7.0.0.16.2.20130323101939.0605d748@akdesigninc.com>
2013-03-23 18:43                   ` Support for DSD streams Daniel Mack
     [not found]                     ` <7.0.0.16.2.20130323182911.0605db20@akdesigninc.com>
2013-03-27  9:53                       ` Daniel Mack
2013-03-23 20:01               ` [PATCH 0/3] ALSA: snd-usb: Some small fixes to make Playback Design products work Jussi Laako
     [not found]                 ` <7.0.0.16.2.20130323183543.0605ddb0@akdesigninc.com>
2013-03-24 10:50                   ` Jussi Laako
2013-03-26 19:34                     ` Daniel Mack
2013-03-28  0:10                       ` Jussi Laako
2013-03-26 19:58                   ` Daniel Mack
     [not found]                     ` <7.0.0.16.2.20130326224120.13b063e0@akdesigninc.com>
2013-03-27  9:45                       ` Clemens Ladisch
2013-03-27  9:48                       ` Daniel Mack
     [not found]                         ` <7.0.0.16.2.20130327080219.13b06900@akdesigninc.com>
2013-03-27 18:22                           ` Daniel Mack
2013-03-27 23:48                           ` Jussi Laako
2013-03-28  0:00                     ` Jussi Laako
2013-03-27 19:02               ` Daniel Mack
     [not found]           ` <7.0.0.16.2.20130321181551.0605bc60@akdesigninc.com>
2013-03-22 10:15             ` Jussi Laako
2013-03-22 10:23               ` Takashi Iwai
2013-03-22 11:08                 ` Jussi Laako
2013-03-19  2:37   ` Gabriel M. Beddingfield
2013-03-19  6:49     ` Takashi Iwai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=514E0857.8010201@sonarnerd.net \
    --to=jussi@sonarnerd.net \
    --cc=alsa-devel@alsa-project.org \
    --cc=andreas@akdesigninc.com \
    --cc=clemens@ladisch.de \
    --cc=demian@auraliti.com \
    --cc=ray@auraliti.com \
    --cc=tiwai@suse.de \
    --cc=zonque@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.