All of lore.kernel.org
 help / color / mirror / Atom feed
From: Clemens Ladisch <clemens@ladisch.de>
To: Damien Zammit <damien.zammit@gmail.com>
Cc: alsa-devel@alsa-project.org
Subject: Re: [PATCH 1/1] sound: usb-audio: support for Digidesign Mbox 2
Date: Mon, 24 Aug 2009 18:01:34 +0200	[thread overview]
Message-ID: <4A92B95E.9090905@ladisch.de> (raw)
In-Reply-To: <4A8EBB35.2010604@gmail.com>

Damien Zammit wrote:
> S/PDIF mode works by setting the required flag
> in usbaudio.c. I think the device can't do both simultaneously,
> since different altsettings are required to set it.

Does the Windows driver allow it?

>              Remaining issues:
>                  1) Double check endianess of 24 bit capture.

This should be apparent even in low-amplitude noise.
Do you have a hex dump of recorded data?

> @@ -2441,6 +2441,12 @@ static int parse_audio_format_i_type(struct snd_usb_audio *chip, struct audiofor
>   				   fp->altsetting, sample_width, sample_bytes);
>   			break;
>   		}
> +
> +                /* Digidesign Mbox 2 workaround:
> +                 * supports S24_3BE BIG ENDIAN  */
> +                if (chip->usb_id == USB_ID(0x0dba, 0x3000))
> +                        pcm_format = SNDRV_PCM_FORMAT_S24_3BE;

Please put this into is_big_endian_format().

> +                /* Digidesign Mbox 2: skip altsets incompatible with device_setup
> +                 */

But there isn't actually a device_setup parameter?

> +mbox2_reboot:
> +                snd_usb_ctl_msg(dev, usb_rcvctrlpipe(dev, 0),
> +                        0x85, 0xc0, 0x0001, 0x0000, &bootresponse, 0x0012, 1000);
> +
> +                if (bootresponse == MBOX2_BOOT_LOADING) {
> +                        snd_printdd("device not ready, resending boot sequence...\n");
> +                        goto mbox2_reboot;
> +                }

This could be made a loop.  And it could run infinitely long; maybe you
should add a timeout.  (How long does it usually need?)

> +                        err = usb_get_descriptor(dev, USB_DT_DEVICE, 0,
> +                                &dev->descriptor, sizeof(dev->descriptor));
> +                        config = dev->actconfig;
> +                        if (err < 0) snd_printdd("error usb_get_descriptor: %d\n", err);
> +                        err = usb_reset_configuration(dev);

Does this device change its descriptors without a reset?

> +                         * 80 bb 00 = 24bit mode - S24_3BE
> +                         * 44 ac 00 = 16bit mode?

0xbb80 = 48000
0xac44 = 44100

Do the descriptors change if you change the sample rate?  Or does using
44.1 kHz result in another altsetting?

> +                snd_printdd("unknown bootresponse, ignoring device: %d\n",bootresponse);
> +                return -ENODEV;
> +        }
> +        snd_printdd("Invalid firmware size: %d\n",fwsize);
> +        return -ENODEV;

snd_printdd is for debugging output, but a failure due to a new firmware
revision should be indicated in any case.

> +#ifdef MBOX2_SPDIF_IO

This should be done at runtime.  This would need logic to prevent using
analog/digital at the same time(?), and it might be necessary to
hardcode interfaces and if numbers in find_format().

> +                 * We have to make sure that the USB core looks
> +                 * again at interface 6

Why?


Best regards,
Clemens

  reply	other threads:[~2009-08-24 16:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-21 15:20 [PATCH 1/1] sound: usb-audio: support for Digidesign Mbox 2 Damien Zammit
2009-08-24 16:01 ` Clemens Ladisch [this message]
2009-08-27  1:22   ` Damien Zammit
2009-08-27  3:16     ` Damien Zammit

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=4A92B95E.9090905@ladisch.de \
    --to=clemens@ladisch.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=damien.zammit@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.