All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Mack <zonque@gmail.com>
To: Jesus R <sonorejr@gmail.com>,
	ALSA development <alsa-devel@alsa-project.org>
Subject: Re: [PATCH v3 5/5] ALSA: snd-usb: add quirks handler for DSD streams
Date: Mon, 12 Aug 2013 13:43:26 +0200	[thread overview]
Message-ID: <5208CA5E.8040604@gmail.com> (raw)
In-Reply-To: <CANNq7HjgbBvJLRPpewWZKF1LSYmDaSndQnmaXV9XSLj7rvPeHA@mail.gmail.com>

[please never drop people from the Cc: list but always use 'reply to all'!]

On 12.08.2013 13:27, Jesus R wrote:
> On Mon, Aug 12, 2013 at 4:52 AM, Daniel Mack <zonque@gmail.com
> <mailto:zonque@gmail.com>> wrote:

>     Given than none of devices have a chance to report their capabilities to
>     the host, finding out which modes to use is a trial-and-error game,
>     unless you have access to the firmware sources.    
> 
> 
>     Hence, please just look up the USB IDs and alternate interface settings
>     of your connected device with lsusb, and then augment the code in
>     snd_usb_interface_dsd_format_quirks() (file sound/usb/quirks.c) and play
>     around with different possibilities (bitreverse on/off, DSD_U8 vs
>     DSD_U16 etc). Follow the example that I provided in that function.
> 
> Right now MPD supports DSD/DoP with one selectable on/off option. On
> equals DoP output and off equals conversion to PCM. I'm not aware of any
> case where it does not work. I would seem to me that there is one
> predominant format?

It's more complicated than that. Applications were always free to use a
usual PCM stream and stuff it with DOP/DSD samples. This is the whole
idea of DOP: allow applications to transport DSD samples via regular
audio streams. The downside of this is that applications are in charge
of adding the DOP markers manually, and information about bit-reversing
and marker format (8 bit vs. 16 bit) is up to the application, which is
not the right place for it.

The patch series I brought in addressed this in a way that all that
information about device-specific details is now known to the kernel,
which can hence offer a standard compliant interface to userspace.

[There's yet one more level of confusion as some file formats store the
samples bit-reversed, but there's nothing we can do about that from
kernel space except for defining a stable interface application have to
obey to in order to be compatible. That is, samples are expected to
always carry the oldest bit in the most significant bit of a byte.]

So my question is: are you 100% sure that MPD uses the newly introduces
ALSA formats, or are they doing the DOP conversion in manually in their
own software layers?

>     You have to recompile and rmmod/insmod the snd-usb driver every time you
>     make a change, and then you need some sort of userspace tool to test it.
>     I published one here:
> 
> This may be more than I can do. Can you add the options (bitreverse
> on/off, DSD_U8 vs
> DSD_U16 etc) to the alas-dsd-player? This would allow me to quickly test
> the devices.    

There are #if0'ed blocks that you can opt-in for bit reversal, but as
the marker format is different for 8 and 16 bits, and up to the kernel
space now, the dsd player does not know about them. That was the entire
intention of bringing that logic to kernel space in the first place.

> Take a look at the DSD database so you can see what we are up against. I
> could even add the tests results to the database.
> https://docs.google.com/spreadsheet/ccc?key=0AgVhKcl_3lHfdFVyenBBNjNpQ2lieG81WGpqQTNfVUE#gid=0

Nice list. Only devics with USB interface are interesting at this point,
but that's a good start.

As I said: you need to add the quirks for the devices to the quirks
list. Other than that, there's no chance to test them.

Copy'n pasting code inside that function and recompiling the kernel is
really not as hard as you might think it is. Just search the internet
for "compile kernel git <your-distribution-here>" and follow the links.


Thanks,
Daniel

  parent reply	other threads:[~2013-08-12 11:43 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-11 16:37 [PATCH v3 5/5] ALSA: snd-usb: add quirks handler for DSD streams Jesus R
2013-08-11 18:20 ` Jesus R
2013-08-12  8:52 ` Daniel Mack
     [not found]   ` <CANNq7HjgbBvJLRPpewWZKF1LSYmDaSndQnmaXV9XSLj7rvPeHA@mail.gmail.com>
2013-08-12 11:43     ` Daniel Mack [this message]
2013-08-12 12:17       ` Jesus R
2013-08-12 11:52     ` Daniel Mack
2013-08-12 12:25       ` Jesus R
  -- strict thread matches above, loose matches on Subject: below --
2013-04-16 16:01 [PATCH v3 0/5] ALSA: snd-usb: add support for DSD Daniel Mack
2013-04-16 16:01 ` [PATCH v3 5/5] ALSA: snd-usb: add quirks handler for DSD streams Daniel Mack

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=5208CA5E.8040604@gmail.com \
    --to=zonque@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=sonorejr@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.