Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Geoffrey D. Bennett" <g@b4.vu>
To: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.com>, alsa-devel@alsa-project.org
Subject: Re: [PATCH RFC] ALSA: scarlett2: Add ioctls for user-space access
Date: Mon, 16 Oct 2023 23:02:42 +1030	[thread overview]
Message-ID: <ZS0tajzKr68CZ5uA@m.b4.vu> (raw)
In-Reply-To: <76c1526d-78be-92d2-cf2b-148278394575@perex.cz>

On Mon, Oct 16, 2023 at 09:04:21AM +0200, Jaroslav Kysela wrote:
> On 14. 10. 23 15:58, Geoffrey D. Bennett wrote:
> > In order to support functions such as firmware upgrade from
> > user-space, add ioctls for submitting arbitrary proprietary requests
> > through scarlett2_usb() and requesting/releasing exclusive access.
> > ---
> > 
> > Hi Takashi,
> > 
> > I recently figured how to update the firmware on Scarlett Gen 2+
> > devices. I think the best way to implement this is with an ioctl
> > giving access to the scarlett2_usb() function from user-space, plus
> > two ioctls to request/release exclusive access.
> > 
> > Does something like this seem reasonable?
> 
> Maybe you can use libusb for this job without an additional kernel
> interface. It allows to detach the USB kernel driver and attach it again
> when the job is complete.

Hi Jaroslav,

I considered using libusb (I used it during initial development of the
driver), and if the only purpose of the ioctl would be for firmware
updates then it would be reasonable to detach the kernel driver for
that. However...

Beyond just being able to do firmware operations, that ioctl would
also allow access to all of the configuration space using cmd =
SCARLETT2_USB_GET_DATA and SCARLETT2_USB_SET_DATA. I think this would
be the cleanest way to allow implementing non-mixer related
functionality in user-space, such as reading the current firmware
version, reading/updating the device name and channel names, and
updating the software configuration space for Focusrite Control
compatibility to name a few. These sorts of applications need to be
able to make these proprietary requests through the scarlett2 driver
to avoid disrupting it (or disrupting audio).

Regards,
Geoffrey.

  reply	other threads:[~2023-10-16 12:34 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-14 13:58 [PATCH RFC] ALSA: scarlett2: Add ioctls for user-space access Geoffrey D. Bennett
2023-10-16  7:04 ` Jaroslav Kysela
2023-10-16 12:32   ` Geoffrey D. Bennett [this message]
2023-10-16 13:28     ` Jaroslav Kysela
2023-10-16 15:45       ` Geoffrey D. Bennett
2023-10-17  7:53         ` Takashi Iwai
2023-11-19 17:35           ` [PATCH RFC v2] " Geoffrey D. Bennett
2023-11-24 13:39             ` Takashi Iwai
2023-11-27 18:32               ` Geoffrey D. Bennett

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=ZS0tajzKr68CZ5uA@m.b4.vu \
    --to=g@b4.vu \
    --cc=alsa-devel@alsa-project.org \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox