Skip to contentSkip to conversation

sst: Intel SST audio driver

PATCH In review Alan Cox 6 participants 21 messages Sep 30, 2010 – Oct 19, 2010 1 message not in the archive Staging

lore
Share & tools
lore

Alan Cox

author
#0 lore raw

PATCH 1/1 sst: Intel SST audio driver

From: Vinod Koul <[email protected]>

This is the Intel SST audio driver.

As compared to the previous versions it has all the printks and other stuff noted cleaned up and more hardware support. The Aava support is disabled in this patch (is_aava resolves to 0) because the Aava board detection logic is not yet upstream.

The driver itself is a combination of a traditional ALSA driver and a hardware assisted offload driver which can play audio while the processor is asleep but which can't do all the more interactive stuff.

In the general case most software would use the ALSA interface, but the other interface is needed for certain classes of use such as music playback on highly power consumption sensitive devices.

This is going to staging primarily because it depends upon the staging memrar driver.

[Merged together and tweaked for -next]

---

 drivers/staging/Kconfig                            |    2 
 drivers/staging/Makefile                           |    1 
 drivers/staging/intel_sst/TODO                     |   12 
 drivers/staging/intel_sst/intel_sst.c              |  512 ++++++++
 drivers/staging/intel_sst/intel_sst.h              |  131 ++
 .../staging/intel_sst/intel_sst_app_interface.c    | 1234 +++++++++++++++++++
 drivers/staging/intel_sst/intel_sst_common.h       |  618 ++++++++++
 .../staging/intel_sst/intel_sst_drv_interface.c    |  492 ++++++++
 drivers/staging/intel_sst/intel_sst_dsp.c          |  486 ++++++++
 drivers/staging/intel_sst/intel_sst_fw_ipc.h       |  393 ++++++
 drivers/staging/intel_sst/intel_sst_ioctl.h        |  435 +++++++
 drivers/staging/intel_sst/intel_sst_ipc.c          |  656 ++++++++++
 drivers/staging/intel_sst/intel_sst_pvt.c          |  311 +++++
 drivers/staging/intel_sst/intel_sst_stream.c       |  575 +++++++++
 .../staging/intel_sst/intel_sst_stream_encoded.c   | 1275 ++++++++++++++++++++
 drivers/staging/intel_sst/intelmid.c               | 1233 +++++++++++++++++++
 drivers/staging/intel_sst/intelmid.h               |  186 +++
 drivers/staging/intel_sst/intelmid_ctrl.c          |  629 ++++++++++
 drivers/staging/intel_sst/intelmid_msic_control.c  |  410 ++++++
 drivers/staging/intel_sst/intelmid_pvt.c           |  174 +++
 drivers/staging/intel_sst/intelmid_snd_control.h   |  114 ++
 drivers/staging/intel_sst/intelmid_v0_control.c    |  771 ++++++++++++
 drivers/staging/intel_sst/intelmid_v1_control.c    | 1072 +++++++++++++++++
 drivers/staging/intel_sst/intelmid_v2_control.c    | 1001 ++++++++++++++++
 drivers/staging/intel_sst/jack.h                   |   10 
 25 files changed, 12733 insertions(+), 0 deletions(-)
 create mode 100644 drivers/staging/intel_sst/TODO
 create mode 100644 drivers/staging/intel_sst/intel_sst.c
 create mode 100644 drivers/staging/intel_sst/intel_sst.h
 create mode 100644 drivers/staging/intel_sst/intel_sst_app_interface.c
 create mode 100644 drivers/staging/intel_sst/intel_sst_common.h
 create mode 100644 drivers/staging/intel_sst/intel_sst_drv_interface.c
 create mode 100644 drivers/staging/intel_sst/intel_sst_dsp.c
 create mode 100644 drivers/staging/intel_sst/intel_sst_fw_ipc.h
 create mode 100644 drivers/staging/intel_sst/intel_sst_ioctl.h
 create mode 100644 drivers/staging/intel_sst/intel_sst_ipc.c
 create mode 100644 drivers/staging/intel_sst/intel_sst_pvt.c
 create mode 100644 drivers/staging/intel_sst/intel_sst_stream.c
 create mode 100644 drivers/staging/intel_sst/intel_sst_stream_encoded.c
 create mode 100644 drivers/staging/intel_sst/intelmid.c
 create mode 100644 drivers/staging/intel_sst/intelmid.h
 create mode 100644 drivers/staging/intel_sst/intelmid_ctrl.c
 create mode 100644 drivers/staging/intel_sst/intelmid_msic_control.c
 create mode 100644 drivers/staging/intel_sst/intelmid_pvt.c
 create mode 100644 drivers/staging/intel_sst/intelmid_snd_control.h
 create mode 100644 drivers/staging/intel_sst/intelmid_v0_control.c
 create mode 100644 drivers/staging/intel_sst/intelmid_v1_control.c
 create mode 100644 drivers/staging/intel_sst/intelmid_v2_control.c
 create mode 100644 drivers/staging/intel_sst/jack.h
drivers/staging/Kconfig +2 -0
index e00ef92..bb069cf 100644
@@ -165,5 +165,7 @@ source "drivers/staging/bcm/Kconfig"
 
 source "drivers/staging/ft1000/Kconfig"
 
+source "drivers/staging/intel_sst/Kconfig"
+
 endif # !STAGING_EXCLUDE_BUILD
 endif # STAGING
drivers/staging/Makefile +1 -0
index 35eacc9..9457e07 100644
@@ -63,3 +63,4 @@ obj-$(CONFIG_ATH6K_LEGACY)	+= ath6kl/
 obj-$(CONFIG_USB_ENESTORAGE)	+= keucr/
 obj-$(CONFIG_BCM_WIMAX)	+= bcm/
 obj-$(CONFIG_FT1000)		+= ft1000/
+obj-$(CONFIG_SND_INTEL_SST)		+= intel_sst/
drivers/staging/intel_sst/TODO new file +12 -0
new file mode 100644
index 0000000..58d6d2d
@@ -0,0 +1,12 @@
+TODO
+----
+
+Get the memrar driver cleaned up and upstream (dependancy blocking SST)
+Get the jack header entries accepted
+Review the printks and kill off any left over ST_ERR: messages
+Review the misc device ioctls for 32/64bit safety and sanity
+Review the misc device ioctls for size safety depending on config and decide
+	if space/unused areas should be left
+
+Anything the sound folks turn up on full review
+
drivers/staging/intel_sst/intel_sst.c new file +512 -0

512 lines not on this page · raw message

drivers/staging/intel_sst/intel_sst.h new file +131 -0

131 lines not on this page · raw message

drivers/staging/intel_sst/intel_sst_app_interface.c new file +1234 -0

1,234 lines not on this page · raw message

drivers/staging/intel_sst/intel_sst_common.h new file +618 -0

618 lines not on this page · raw message

drivers/staging/intel_sst/intel_sst_drv_interface.c new file +492 -0

482 lines not on this page · raw message

drivers/staging/intel_sst/intel_sst_dsp.c new file +486 -0

486 lines not on this page · raw message

drivers/staging/intel_sst/intel_sst_fw_ipc.h new file +393 -0

393 lines not on this page · raw message

drivers/staging/intel_sst/intel_sst_ioctl.h new file +435 -0

435 lines not on this page · raw message

drivers/staging/intel_sst/intel_sst_ipc.c new file +656 -0

656 lines not on this page · raw message

drivers/staging/intel_sst/intel_sst_pvt.c new file +311 -0

311 lines not on this page · raw message

drivers/staging/intel_sst/intel_sst_stream.c new file +575 -0

575 lines not on this page · raw message

drivers/staging/intel_sst/intel_sst_stream_encoded.c new file +1275 -0

1,275 lines not on this page · raw message

drivers/staging/intel_sst/intelmid.c new file +1233 -0

1,233 lines not on this page · raw message

drivers/staging/intel_sst/intelmid.h new file +186 -0

186 lines not on this page · raw message

drivers/staging/intel_sst/intelmid_ctrl.c new file +629 -0

629 lines not on this page · raw message

drivers/staging/intel_sst/intelmid_msic_control.c new file +410 -0

410 lines not on this page · raw message

drivers/staging/intel_sst/intelmid_pvt.c new file +174 -0

174 lines not on this page · raw message

drivers/staging/intel_sst/intelmid_snd_control.h new file +114 -0

114 lines not on this page · raw message

drivers/staging/intel_sst/intelmid_v0_control.c new file +771 -0

771 lines not on this page · raw message

drivers/staging/intel_sst/intelmid_v1_control.c new file +1072 -0

1,072 lines not on this page · raw message

drivers/staging/intel_sst/intelmid_v2_control.c new file +1001 -0

1,001 lines not on this page · raw message

drivers/staging/intel_sst/jack.h new file +10 -0
new file mode 100644
index 0000000..9a6e483

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Part of the diff is not shown here. View the raw message.

#1 lore raw
Quoted 4 lines · Alan Cox
[Merged together and tweaked for -next]

Having things as a series does make things easier for review, reducing reviewer fatigue if nothing else. I've given this a bit of a once over below but not a deep dive - splitting the series would really help with reviewability.

drivers/staging/intel_sst/TODO line 5

Quoted 5 lines
drivers/staging/intel_sst/TODO new file +5 -0
+TODO
+----
+
+Get the memrar driver cleaned up and upstream (dependancy blocking SST)
+Get the jack header entries accepted

See below; I think this needs to be changed to rework the current code to use the existing facilities.

drivers/staging/intel_sst/TODO line 11

Quoted 6 lines
drivers/staging/intel_sst/TODO new file +6 -0
+Review the printks and kill off any left over ST_ERR: messages
+Review the misc device ioctls for 32/64bit safety and sanity
+Review the misc device ioctls for size safety depending on config and decide
+	if space/unused areas should be left
+
+Anything the sound folks turn up on full review

The big thing I can see is that as I've commented when reviewing earlier versions of these patches this code really does need to be reworked to use the standard embedded audio framework under sound/soc rather than providing its own implementation of the same concepts. It is clear from the code that this is a pretty much standard embedded audio hardware design with the primary digital logic in the CPU and a separate mixed signal chip providing the ADCs, DACs and other analogue components streaming audio via standard I2S/PCM style interfaces. This is a design that is already well supported by the ASoC code.

Where there are gaps that need fixing in what's there at present (and there are some) we should work on those at a generic level and share the effort rather than developing a bunch of vendor-specific driver stacks.

drivers/staging/intel_sst/intel_sst.c line 471

Quoted 9 lines
drivers/staging/intel_sst/intel_sst.c new file +9 -0
+static struct pci_driver driver = {
+	.name = SST_DRV_NAME,
+	.id_table = intel_sst_ids,
+	.probe = intel_sst_probe,
+	.remove = __devexit_p(intel_sst_remove),
+#ifdef CONFIG_PM
+	.suspend = intel_sst_suspend,
+	.resume = intel_sst_resume,
+#endif

Standard approach is to #define the functions to NULL in the ifdef for the function.

drivers/staging/intel_sst/intel_sst.h line 81

Quoted 4 lines
drivers/staging/intel_sst/intel_sst.h new file +4 -0
+struct snd_pmic_ops {
+	int card_status;
+	int master_mute;
+	int num_channel;

This abstraction for the mixed signal chip is the key bit that should be factored out to work within ASoC - at a very high level the model is that the mixed signal chips are represented by the CODEC drivers, the CPU drivers contain almost all the rest of the code here (pretty much as-is, the abstractions are very thin for the CPU) and you have a machine driver that specified how all these are glued together on a particular system (so for you this would be the bit that parses the BIOS data).

drivers/staging/intel_sst/intel_sst_app_interface.c line 222

Quoted 4 lines
drivers/staging/intel_sst/intel_sst_app_interface.c new file +4 -0
+	/* round it up to the page bondary  */
+	/*mem_area = (void *)((((unsigned long)sst_drv_ctx->mmap_mem)
+				+ PAGE_SIZE - 1) & PAGE_MASK);*/
+	mem_area = (void *) PAGE_ALIGN((unsigned int) sst_drv_ctx->mmap_mem);

Looks like you should just be loosing the commented code here?

drivers/staging/intel_sst/intel_sst_app_interface.c line 837

Quoted 9 lines
drivers/staging/intel_sst/intel_sst_app_interface.c new file +9 -0
+	switch (_IOC_NR(cmd)) {
+	case _IOC_NR(SNDRV_SST_STREAM_PAUSE):
+		pr_debug("sst: IOCTL_PAUSE recieved for %d!\n", str_id);
+		if (minor != STREAM_MODULE) {
+			retval = -EBADRQC;
+			break;
+		}
+		retval = sst_pause_stream(str_id);
+		break;

I believe these are ioctl()s for the offloaded DSP engine rather than for the PCM data ALSA handles? It would be nice to name them in a way that makes this more obvious, obviously there's substantial overlap with the standard ALSA operations and triggers which raises eyebrows for someone coming at this from an ALSA context.

To be honest all this stuff looks sufficiently generic that it might be worth considering factoring out an abstraction which can be used by other offload engines - having a standard kernel API for them would be a real win. That's just a nice to have, though.

drivers/staging/intel_sst/intel_sst_app_interface.c line 944

Quoted 1 line
drivers/staging/intel_sst/intel_sst_app_interface.c new file +1 -0
+		/*sst_print_get_vol_info(str_id, &get_vol);*/

Better to have stuff like this be vdbg() or otherwise provide a conditional compilation/enable method rather than just have commented out code.

drivers/staging/intel_sst/intel_sst_common.h line 55

Quoted 3 lines
drivers/staging/intel_sst/intel_sst_common.h new file +3 -0
+/* SST numbers */
+#define SST_BLOCK_TIMEOUT	5000
+#define TARGET_DEV_BLOCK_TIMEOUT	5000

Some of this stuff could do with namespacing, even if this file isn't used anywhere else there may be collisions with other headers code using it needs to pull in.

drivers/staging/intel_sst/intelmid.c line 459

Quoted 6 lines
drivers/staging/intel_sst/intelmid.c new file +6 -0
+void sst_mad_send_jack_report(struct snd_jack *jack,
+				int buttonpressevent , int status)
+{
+
+	if (!jack) {
+		pr_debug("sst: MAD error jack empty\n");

The jack API will happily eat reports on null jacks, though obviously you may still wish to warn anyway.

drivers/staging/intel_sst/intelmid.c line 464

Quoted 4 lines
drivers/staging/intel_sst/intelmid.c new file +4 -0
+	} else {
+		pr_debug("sst: MAD send jack report for = %d!!!\n", status);
+		pr_debug("sst: MAD send jack report %d\n", jack->type);
+		snd_jack_report(jack, status);

Seems like you might want to add trace to the jack code for this...

drivers/staging/intel_sst/intelmid.c line 468

Quoted 3 lines
drivers/staging/intel_sst/intelmid.c new file +3 -0
+		/*button pressed and released */
+		if (buttonpressevent)
+			snd_jack_report(jack, 0);

This looks very suspicious. You'll report an everything off status for the jack if a button press was involved which means that not only will the button press be reported as having ended but any jack presence indications will also be reported as gone which I suspect is not what's meant. If this is safe the code should have comments explaining why.

Review

Quoted 2 lines
(quoted diff) +2 -0
+	if (jack_event_flag)
+		sst_mad_send_jack_report(jack, buttonpressflag, present);

I'm not convinced that headset detection will work in general here, it looks like each independant event is reported by itself but no effort is made to maintain the status for things like jack presence which should be persistent. Similar issues seem to apply for the other mixed signal vendors.

When you move to ASoC the ASoC jack detection helpers allow code in the driver to be written like this (since it's common for jacks in embedded systems to be detected by multiple unrelated subsystems).

drivers/staging/intel_sst/intelmid.c line 551

Quoted 2 lines
drivers/staging/intel_sst/intelmid.c new file +2 -0
+void sst_mad_jackdetection_mx(u8 intsts, struct snd_intelmad *intelmaddata)
+{

Obviously each of these should be part of the ASoC CODEC driver for the mixed signal chip.

drivers/staging/intel_sst/intelmid.c line 658

Quoted 4 lines
drivers/staging/intel_sst/intelmid.c new file +4 -0
+	if (is_aava() && jack) {
+		if (present) {
+			pr_debug("sst: Jack... YES\n");
+			scard_ops->set_output_dev(STEREO_HEADPHONE);

is_aava()?

Quoted 12 lines
drivers/staging/intel_sst/intelmid_snd_control.h new file +12 -0
+/*
+Mask bits
+*/
+#define MASK0 0x01	/* 0000 0001 */
+#define MASK1 0x02	/* 0000 0010 */
+#define MASK2 0x04	/* 0000 0100 */
+#define MASK3 0x08	/* 0000 1000 */
+#define MASK4 0x10	/* 0001 0000 */
+#define MASK5 0x20	/* 0010 0000 */
+#define MASK6 0x40	/* 0100 0000 */
+#define MASK7 0x80	/* 1000 0000 */
+/*

drivers/staging/intel_sst/intelmid_snd_control.h line 52

Quoted 10 lines
drivers/staging/intel_sst/intelmid_snd_control.h new file +10 -0
+value bits
+*/
+#define VALUE0	0x01	/* 0000 0001 */
+#define VALUE1	0x02	/* 0000 0010 */
+#define VALUE2	0x04	/* 0000 0100 */
+#define VALUE3	0x08	/* 0000 1000 */
+#define VALUE4	0x10	/* 0001 0000 */
+#define VALUE5	0x20	/* 0010 0000 */
+#define VALUE6	0x40	/* 0100 0000 */
+#define VALUE7	0x80	/* 1000 0000 */

This doesn't look like driver specific stuff, really...

drivers/staging/intel_sst/intelmid_snd_control.h line 61

Quoted 5 lines
drivers/staging/intel_sst/intelmid_snd_control.h new file +5 -0
+#define MAX_VOL_PMIC_VENDOR0    0x3f /* max vol in dB for stereo & voice DAC */
+#define MIN_VOL_PMIC_VENDOR0    0 /* min vol in dB for stereo & voice DAC */
+/* Head phone volume control  */
+#define MAX_HP_VOL_PMIC_VENDOR1    6 /* max volume in dB for HP */
+#define MIN_HP_VOL_PMIC_VENDOR1    (-84) /* min volume in dB for HP */

You're using much more parsable names for your mixed signal vendors elsewhere (and several of them have done press releases and whatnot so there's no issue with disclosure there), doing something more legible than vendorN wouldn't hurt.

drivers/staging/intel_sst/jack.h line 8

Quoted 4 lines
drivers/staging/intel_sst/jack.h new file +3 -0
+/* These want adding to jack.h as enum entries once approved */
 
+#define SND_JACK_HS_SHORT_PRESS 	(SND_JACK_HEADSET | 0x0020)
+#define	SND_JACK_HS_LONG_PRESS		(SND_JACK_HEADSET | 0x0040)

We already have defines for buttons, and I don't see any need to force the buttons to be associated with headsets. Someone could easily provide button detection on a microphone only jack, or some other combination accessory. If you do need to define new types you'd also need to add appropriate stuff to the input layer and make sure the lookups in jack.c are joined up so we can actually send something up via the input layer (as things stand your buttons will be ignored).

The way I'd do this is to just say the two different lengths are buttons zero and one and let user space assign whatever semantics it desires to those. It did look like at least one of your mixed signal chips didn't implement long/short distincton in hardware; for that one you can just implement a single button. Any generic userspace is going to need to cope with that anyway.

A message that is not in the archive (sent off-list or not yet received): [email protected]

#3 lore raw
Quoted 10 lines · Alan Cox
Quoted 4 lines

Having things as a series does make things easier for review, reducing reviewer fatigue if nothing else. I've given this a bit of a once over below but not a deep dive - splitting the series would really help with reviewability.

It really wouldn't help in this case for most people I think. You end up with what there is in the original which is a series of patches for old code all quite large and just a big one chopped into chunks, followed by a series of updates that fix half the bugs you found reviewing the first big splat.

IIRC at least one version had a split where the ALSA integration stuff was separated out from the underlying DSP interface code - that was pretty helpful since it helps focus on the ALSA specifics.

Quoted 2 lines

I did think about it, but what history we have is fairly basic because it was basically written then fired in my direction to help sort out

Yeah, I wasn't thinking about history so much as about helping break down the areas covered for comprehensibility.

Quoted 7 lines
Quoted 4 lines

To be honest all this stuff looks sufficiently generic that it might be worth considering factoring out an abstraction which can be used by other offload engines - having a standard kernel API for them would be a real win. That's just a nice to have, though.

Agreed, although gstreamer is pretty good at that it would save work if it can be partly generic. It's not trivial however because the offload

Plus the fact that not everyone is using gstreamer at the application level :/

Quoted 2 lines

interface with suitable firmware loaded does things other than PCM and you have very firmware specific interfaces for configuring those.

We ought to be able to come up with something for the core streaming stuff, though. Like I say, it's just a nice to have though.

Quoted 4 lines

So are you happy for it to go into staging. I'm hoping that way at least all the changes will be visible and trackable. I'll start by sending GregKH a follow up patch which is a TODO list summary based on your feedback

Happy is a strong term but this looks like exactly the sort of stuff staging is there for so yes, it should go in. Probably best to look for feedback from at least Takashi and/or Jaroslav as well, but obviously we can update the TODO later.

I do have some nervousness about the concept of staging for embedded stuff since I worry that inclusion in staging can send the wrong message to vendors but that's a completely separate issue to this driver.

author
#4 lore raw
Quoted 3 lines

IIRC at least one version had a split where the ALSA integration stuff was separated out from the underlying DSP interface code - that was pretty helpful since it helps focus on the ALSA specifics.

Yes but that split is no longer there once the clean up patches sit on top because they weren't put together as separate bits. This is exactly the sort of reason I want to get it in staging.

Quoted 7 lines
Quoted 3 lines

Agreed, although gstreamer is pretty good at that it would save work if it can be partly generic. It's not trivial however because the offload

Plus the fact that not everyone is using gstreamer at the application level :/

Quoted 6 lines
Quoted 3 lines

interface with suitable firmware loaded does things other than PCM and you have very firmware specific interfaces for configuring those.

We ought to be able to come up with something for the core streaming stuff, though. Like I say, it's just a nice to have though.

I would have thought PCM at least was also going to have some kind of common structure.

Quoted 4 lines

I do have some nervousness about the concept of staging for embedded stuff since I worry that inclusion in staging can send the wrong message to vendors but that's a completely separate issue to this driver.

Noted. But I'll point you at the SEP driver which did get bogged down for ages for reasons I can't really go into publically, and we therefore pulled out of staging.

Alan

#5 lore raw
Quoted 7 lines · Alan Cox
Quoted 3 lines

IIRC at least one version had a split where the ALSA integration stuff was separated out from the underlying DSP interface code - that was pretty helpful since it helps focus on the ALSA specifics.

Yes but that split is no longer there once the clean up patches sit on top because they weren't put together as separate bits. This is exactly the sort of reason I want to get it in staging.

Sure, though that's what rebase is there for.

Quoted 5 lines
Quoted 2 lines

We ought to be able to come up with something for the core streaming stuff, though. Like I say, it's just a nice to have though.

I would have thought PCM at least was also going to have some kind of common structure.

ALSA provides that already, pretty much? I guess PCM also falls out of compressed CODEC support as a noop CODEC.

Quoted 8 lines
Quoted 4 lines

I do have some nervousness about the concept of staging for embedded stuff since I worry that inclusion in staging can send the wrong message to vendors but that's a completely separate issue to this driver.

Noted. But I'll point you at the SEP driver which did get bogged down for ages for reasons I can't really go into publically, and we therefore pulled out of staging.

It's not specifically about this driver, it's more of a general concern about the whole concept and how vendors less used to Linux could easily get the wrong end of the stick.

#6 lore raw
In reply to Alan Cox

At Mon, 4 Oct 2010 10:04:24 +0100,

Quoted 27 lines · Alan Cox
Quoted 4 lines

IIRC at least one version had a split where the ALSA integration stuff was separated out from the underlying DSP interface code - that was pretty helpful since it helps focus on the ALSA specifics.

Yes but that split is no longer there once the clean up patches sit on top because they weren't put together as separate bits. This is exactly the sort of reason I want to get it in staging.

Quoted 7 lines
Quoted 3 lines

Agreed, although gstreamer is pretty good at that it would save work if it can be partly generic. It's not trivial however because the offload

Plus the fact that not everyone is using gstreamer at the application level :/

Quoted 6 lines
Quoted 3 lines

interface with suitable firmware loaded does things other than PCM and you have very firmware specific interfaces for configuring those.

We ought to be able to come up with something for the core streaming stuff, though. Like I say, it's just a nice to have though.

I would have thought PCM at least was also going to have some kind of common structure.

Quoted 8 lines
Quoted 4 lines

I do have some nervousness about the concept of staging for embedded stuff since I worry that inclusion in staging can send the wrong message to vendors but that's a completely separate issue to this driver.

Noted. But I'll point you at the SEP driver which did get bogged down for ages for reasons I can't really go into publically, and we therefore pulled out of staging.

Sorry to be too late to join the review (as I've been too busy and in other troubles...)

SST driver has been once (sort of) posted and reviewed, but stalled since then. But in general I'm not against merging to the sound main tree at all. The only reason that it didn't occur was that the activity just stopped somehow.

Anyway, I'm going to review in the next week or so. Then maybe we can move it to sound/ directory (e.g. creating sound/platform/x86 directory) before rc1, unless you'd like to keep the stuff rather in staging tree.

thanks,

Takashi

#7 lore raw
Quoted 4 lines · Takashi Iwai

SST driver has been once (sort of) posted and reviewed, but stalled since then. But in general I'm not against merging to the sound main tree at all. The only reason that it didn't occur was that the activity just stopped somehow.

I'm really concerned about this idea. Allowing embedded vendors to push drivers into mainline which don't work with the standard frameworks for what they're doing sets a bad precedent which makes it much harder to push back on other vendors who also want to push their own stacks.

This sort of thing is very common in the embedded space for audio, to a large extent because other OSs don't have any sort of standard framework for representing the hardware. The experience is that it's always pretty painful if there's any active work with the device - hardware changes that should be straightforward like substituting a new CODEC or even changing the physical configuration of the outputs become much more involved. You can see in the current code that the bulk of the audio configuration is register write sequences for various operations, at best you end up needing to replicate those into each vendor's stack for each CODEC that gets deployed and at worst you end up replicating everything per-board rather than per-CPU. This isn't great for anyone, it's a lot more work and a lot less clear.

The Moorestown CPU appears to be very standard embedded audio hardware - a CPU communicating with an external CODEC over I2S/PCM data links - and so I can't see any reason why we should treat it differently to other such hardware.

#8 lore raw

At Sun, 17 Oct 2010 11:36:27 +0100,

Quoted 8 lines · Mark Brown
Quoted 4 lines · Takashi Iwai

SST driver has been once (sort of) posted and reviewed, but stalled since then. But in general I'm not against merging to the sound main tree at all. The only reason that it didn't occur was that the activity just stopped somehow.

Quoted 4 lines

I'm really concerned about this idea. Allowing embedded vendors to push drivers into mainline which don't work with the standard frameworks for what they're doing sets a bad precedent which makes it much harder to push back on other vendors who also want to push their own stacks.

We've had (and still have) many pre-ASoC drivers, but the _maintenance_ cost of them were relatively small from the global sound-tree POV. As long as the driver is self-contained, there is no big hustle for maintenance.

Of course, the further _development_ is a totally different question. If the development diverges to too many different h/w components, a certain framework would be certainly needed. This is how ASoC was introduced and developed by Liam and you.

So, what I'm trying to say is:
- we can accept the present solution in a certain level, rather then just refusing it
- it can be taken into the main sound tree as an EXPERIMENTAL one, instead of keeping it in staging tree forever

These don't mean that the current driver will be necessarily regarded as the standard. We might need to end up developing the new better standard framework for similar devices. It doesn't conflict with merging the merge action.

Anyway, I'll need to review patches again from the current standpoint, together with Mark's reviews, before further decisions. And, I'll be open for suggestions. Take my comments above just as my current "feelings" :)

thanks,

Takashi

Quoted 17 lines

This sort of thing is very common in the embedded space for audio, to a large extent because other OSs don't have any sort of standard framework for representing the hardware. The experience is that it's always pretty painful if there's any active work with the device - hardware changes that should be straightforward like substituting a new CODEC or even changing the physical configuration of the outputs become much more involved. You can see in the current code that the bulk of the audio configuration is register write sequences for various operations, at best you end up needing to replicate those into each vendor's stack for each CODEC that gets deployed and at worst you end up replicating everything per-board rather than per-CPU. This isn't great for anyone, it's a lot more work and a lot less clear.

The Moorestown CPU appears to be very standard embedded audio hardware - a CPU communicating with an external CODEC over I2S/PCM data links - and so I can't see any reason why we should treat it differently to other such hardware.

#9 lore raw
Quoted 11 lines · Takashi Iwai
Quoted 4 lines · Mark Brown

I'm really concerned about this idea. Allowing embedded vendors to push drivers into mainline which don't work with the standard frameworks for what they're doing sets a bad precedent which makes it much harder to push back on other vendors who also want to push their own stacks.

We've had (and still have) many pre-ASoC drivers, but the _maintenance_ cost of them were relatively small from the global sound-tree POV. As long as the driver is self-contained, there is no big hustle for maintenance.

You're only seeing what goes on upstream. Outside of upstream you'll usually find a lot of people doing a lot of redundant work to get their boards working, code that never finds its way upstream and quite often gets done fairly reptitvely. It's no hassle upstream because nobody ever bothers upstreaming anything much after the original driver but for system integrators trying to use the driver on their platform which differs from the vendor reference and distributors trying to support multiple machines it's a different kettle of fish.

Quoted 4 lines

Of course, the further _development_ is a totally different question. If the development diverges to too many different h/w components, a certain framework would be certainly needed. This is how ASoC was introduced and developed by Liam and you.

This is pretty much a given in the embedded marketplace if a CPU is at all successful - apart from anything else the embedded audio state of the art is on much quicker cycles than most components so the components which are leading edge today may not make quite so much sense in a year. The hardware is all constructed with standard interfaces between the parts (though there are no standards at all for the control of the devices) so these sorts of changes are very straightforward for the hardware guys to do, meaning that the software stack needs to be similarly modularised.

Quoted 3 lines

So, what I'm trying to say is:
- we can accept the present solution in a certain level, rather then just refusing it

I think this is the wrong approach. I think this says to embedded CPU vendors that they can go off and reinvent the wheel with their own embedded audio stacks. If all the CPU vendors already in mainline were to have gone down this route we'd have sixteen different ways to add support for a new board right now, with lots of redundancy in the CODEC side between them and each with a different set of features and limitations in how you can customise for your board (especially if you want to get code upstream). That wouldn't be terribly pleasant, it'd put Linux's audio support right back where all the other embedded OSs are.

Please bear in mind that we've already seen similar stacks from other vendors (Marvell and TI being the main ones I've been aware of) getting replaced as part of mainlining, and a couple of others I'm aware of but NDAed with doing the same thing. If you're saying you'll accept this approach and bypass the existing embedded audio stack then the pressure on vendors to do the right thing and move over to the Linux embedded audio stack is greatly reduced.

Quoted 2 lines

- it can be taken into the main sound tree as an EXPERIMENTAL one, instead of keeping it in staging tree forever

I definitely think EXPERIMENTAL is too weak a pushback - I can't see that stopping anyone going out there and saying they have standard audio drivers in mainline which is the check box people are looking for. Even distributors routinely enable EXPERIMENTAL.

Like I say, this is not just a concern for this driver it's also a big worry with other CPU vendors and with future Intel chips.

Quoted 4 lines

These don't mean that the current driver will be necessarily regarded as the standard. We might need to end up developing the new better standard framework for similar devices. It doesn't conflict with merging the merge action.

We already have an existing framework for embedded audio devices. We may want to extend or improve it but I don't see a pressing need to develop a new one. Whenever we end up with two different ways of doing the same thing it's not great, it just makes for confusion and redundancy.

#10 lore raw

At Sun, 17 Oct 2010 17:18:08 +0100,

Quoted 14 lines · Mark Brown
Quoted 11 lines · Takashi Iwai
Quoted 4 lines · Mark Brown

I'm really concerned about this idea. Allowing embedded vendors to push drivers into mainline which don't work with the standard frameworks for what they're doing sets a bad precedent which makes it much harder to push back on other vendors who also want to push their own stacks.

We've had (and still have) many pre-ASoC drivers, but the _maintenance_ cost of them were relatively small from the global sound-tree POV. As long as the driver is self-contained, there is no big hustle for maintenance.

Quoted 8 lines

You're only seeing what goes on upstream. Outside of upstream you'll usually find a lot of people doing a lot of redundant work to get their boards working, code that never finds its way upstream and quite often gets done fairly reptitvely. It's no hassle upstream because nobody ever bothers upstreaming anything much after the original driver but for system integrators trying to use the driver on their platform which differs from the vendor reference and distributors trying to support multiple machines it's a different kettle of fish.

OK, but what makes it different from keeping the stuff in sound tree rather than staging tree? Or you are suggesting to remove the driver from staging tree, either?

Quoted 15 lines
Quoted 4 lines

Of course, the further _development_ is a totally different question. If the development diverges to too many different h/w components, a certain framework would be certainly needed. This is how ASoC was introduced and developed by Liam and you.

This is pretty much a given in the embedded marketplace if a CPU is at all successful - apart from anything else the embedded audio state of the art is on much quicker cycles than most components so the components which are leading edge today may not make quite so much sense in a year. The hardware is all constructed with standard interfaces between the parts (though there are no standards at all for the control of the devices) so these sorts of changes are very straightforward for the hardware guys to do, meaning that the software stack needs to be similarly modularised.

Quoted 7 lines
Quoted 3 lines

So, what I'm trying to say is:
- we can accept the present solution in a certain level, rather then just refusing it

I think this is the wrong approach. I think this says to embedded CPU vendors that they can go off and reinvent the wheel with their own embedded audio stacks.

If this brings really benefit to _user_, why not?

Quoted 8 lines

If all the CPU vendors already in mainline were
to have gone down this route we'd have sixteen different ways to add support for a new board right now, with lots of redundancy in the CODEC side between them and each with a different set of features and limitations in how you can customise for your board (especially if you want to get code upstream). That wouldn't be terribly pleasant, it'd put Linux's audio support right back where all the other embedded OSs are.

OS exists for supporting the hardware.
Yes, we have now a great framework, and h/w vendors should support it. But, why we must restrict ourselves by this, and don't allow us to use the full hardware features at all? The hardware encoding/decoding are nice and long-wanted features, indeed.

Quoted 7 lines

Please bear in mind that we've already seen similar stacks from other vendors (Marvell and TI being the main ones I've been aware of) getting replaced as part of mainlining, and a couple of others I'm aware of but NDAed with doing the same thing. If you're saying you'll accept this approach and bypass the existing embedded audio stack then the pressure on vendors to do the right thing and move over to the Linux embedded audio stack is greatly reduced.

Well, think about it from the user's POV.
"Why can't I use the h/w audio decoding feature on linux?" "Because it doesn't match with the philosophy of the existing linux
audio framework."

Quoted 7 lines
Quoted 2 lines

- it can be taken into the main sound tree as an EXPERIMENTAL one, instead of keeping it in staging tree forever

I definitely think EXPERIMENTAL is too weak a pushback - I can't see that stopping anyone going out there and saying they have standard audio drivers in mainline which is the check box people are looking for. Even distributors routinely enable EXPERIMENTAL.

Ditto for staging tree :)

Quoted 8 lines

Like I say, this is not just a concern for this driver it's also a big worry with other CPU vendors and with future Intel chips.

Quoted 4 lines

These don't mean that the current driver will be necessarily regarded as the standard. We might need to end up developing the new better standard framework for similar devices. It doesn't conflict with merging the merge action.

Quoted 5 lines

We already have an existing framework for embedded audio devices. We may want to extend or improve it but I don't see a pressing need to develop a new one. Whenever we end up with two different ways of doing the same thing it's not great, it just makes for confusion and redundancy.

So, are you saying that we can extend ASoC to provide the support this kind of hardware feature? If yes, then we can work on it first.

thanks,

Takashi

#11 lore raw
Quoted 5 lines · Takashi Iwai

Mark Brown wrote:

OK, but what makes it different from keeping the stuff in sound tree rather than staging tree? Or you are suggesting to remove the driver from staging tree, either?

I do have some qualms about staging but given Greg's active policing of it and work to push things into the actual trees the warnings about its quality and general mainlineness are much more meaningful than those for experimental. There's also the tainting of kernels, which is really useful.

Quoted 9 lines
Quoted 7 lines
Quoted 3 lines

So, what I'm trying to say is:
- we can accept the present solution in a certain level, rather then just refusing it

I think this is the wrong approach. I think this says to embedded CPU vendors that they can go off and reinvent the wheel with their own embedded audio stacks.

If this brings really benefit to _user_, why not?

We've got multiple classes of users here - system integrators are involved too - and there's also the issue of how we maintain stuff going forward if users get shiny new machines and we have to work out what the patched audio drivers that come with them actually mean.

Quoted 9 lines
Quoted 3 lines

If all the CPU vendors already in mainline were
to have gone down this route we'd have sixteen different ways to add support for a new board right now, with lots of redundancy in the CODEC

OS exists for supporting the hardware.
Yes, we have now a great framework, and h/w vendors should support it. But, why we must restrict ourselves by this, and don't allow us to use the full hardware features at all? The hardware encoding/decoding are nice and long-wanted features, indeed.

I'm sorry I don't really understand what you're saying here. The encoder offload stuff is all totally orthogonal to the issue of using the ASoC APIs. On the CPU side the ASoC API is mostly a thin wrapper around the standard ALSA API so anything that works in ALSA should slot fairly readily into ASoC. What I'd expect to see happen is that the CODEC and board stuff would get pulled out and everything else would stay pretty much as-is, including the DSP.

CPUs like OMAP (which are obviously already in the ASoC framework) also support this sort of stuff, the issues with mainline for them have been around the API to the DSP, though it looks like the TI stuff in staging is getting sorted out now.

Quoted 8 lines
Quoted 7 lines

Please bear in mind that we've already seen similar stacks from other vendors (Marvell and TI being the main ones I've been aware of) getting replaced as part of mainlining, and a couple of others I'm aware of but NDAed with doing the same thing. If you're saying you'll accept this approach and bypass the existing embedded audio stack then the pressure on vendors to do the right thing and move over to the Linux embedded audio stack is greatly reduced.

Quoted 4 lines

Well, think about it from the user's POV.
"Why can't I use the h/w audio decoding feature on linux?" "Because it doesn't match with the philosophy of the existing linux
audio framework."

Like I say I'm having real trouble connecting the above with what I wrote.

Quoted 8 lines
Quoted 5 lines

We already have an existing framework for embedded audio devices. We may want to extend or improve it but I don't see a pressing need to develop a new one. Whenever we end up with two different ways of doing the same thing it's not great, it just makes for confusion and redundancy.

So, are you saying that we can extend ASoC to provide the support this kind of hardware feature? If yes, then we can work on it first.

I'm saying I see nothing about this hardware which should prevent it working with ASoC right now. As I have said in terms of the overall structure of the device it's not really doing anything that hasn't been done elsewhere. There's stuff we'd have to bodge in the short term, but only fairly small bits that can be handled fairly straightforwardly.

#12 lore raw

At Sun, 17 Oct 2010 23:11:26 +0100,

Quoted 8 lines · Mark Brown
Quoted 5 lines · Takashi Iwai

Mark Brown wrote:

OK, but what makes it different from keeping the stuff in sound tree rather than staging tree? Or you are suggesting to remove the driver from staging tree, either?

Quoted 5 lines

I do have some qualms about staging but given Greg's active policing of it and work to push things into the actual trees the warnings about its quality and general mainlineness are much more meaningful than those for experimental. There's also the tainting of kernels, which is really useful.

But who of the end user would care about it? It's distributor and developer who care.

And, is the code quality is in question, which is supposed to be fixable there? Your argument against this driver doesn't sound like fixable.

Quoted 8 lines
Quoted 7 lines
Quoted 7 lines
Quoted 3 lines

So, what I'm trying to say is:
- we can accept the present solution in a certain level, rather then just refusing it

I think this is the wrong approach. I think this says to embedded CPU vendors that they can go off and reinvent the wheel with their own embedded audio stacks.

Quoted 6 lines
Quoted 1 line

If this brings really benefit to _user_, why not?

We've got multiple classes of users here - system integrators are involved too - and there's also the issue of how we maintain stuff going forward if users get shiny new machines and we have to work out what the patched audio drivers that come with them actually mean.

So then why you do you think keeping that stuff in staging tree is OK while sound tree is not? It's a question to be or not to be. End-users never hesitate using the staging if it works. They don't notice the difference; they don't notice kernel taint either.

The staging driver is also in upstream; distribution enables it almost always, no matter how the quality of each driver is. For developers, the distinction is clear, of course. But for the rest, it's not.

Thus, to my eyes, there is no difference between keeping it in staging and other tree. It's nothing but a question where to cook.

So, if you really don't want this style of implementation, you'll have to take an action for getting rid of the driver from staging tree. Otherwise others will submit the similar drivers, and they'll land there, too. Then we can keep the stuff in sound or other git tree in another branch until the things gets sorted out.

Quoted 18 lines
Quoted 9 lines
Quoted 3 lines

If all the CPU vendors already in mainline were
to have gone down this route we'd have sixteen different ways to add support for a new board right now, with lots of redundancy in the CODEC

OS exists for supporting the hardware.
Yes, we have now a great framework, and h/w vendors should support it. But, why we must restrict ourselves by this, and don't allow us to use the full hardware features at all? The hardware encoding/decoding are nice and long-wanted features, indeed.

I'm sorry I don't really understand what you're saying here. The encoder offload stuff is all totally orthogonal to the issue of using the ASoC APIs. On the CPU side the ASoC API is mostly a thin wrapper around the standard ALSA API so anything that works in ALSA should slot fairly readily into ASoC. What I'd expect to see happen is that the CODEC and board stuff would get pulled out and everything else would stay pretty much as-is, including the DSP.

Quoted 4 lines

CPUs like OMAP (which are obviously already in the ASoC framework) also support this sort of stuff, the issues with mainline for them have been around the API to the DSP, though it looks like the TI stuff in staging is getting sorted out now.

Well, what I don't understand in your argument is why we must stop it being deployed. Because it doesn't match with the current design of the framework? If so, a straight question must come next: can't the framework itself be extended to suit with such hardware?

Quoted 22 lines
Quoted 8 lines
Quoted 7 lines

Please bear in mind that we've already seen similar stacks from other vendors (Marvell and TI being the main ones I've been aware of) getting replaced as part of mainlining, and a couple of others I'm aware of but NDAed with doing the same thing. If you're saying you'll accept this approach and bypass the existing embedded audio stack then the pressure on vendors to do the right thing and move over to the Linux embedded audio stack is greatly reduced.

Quoted 4 lines

Well, think about it from the user's POV.
"Why can't I use the h/w audio decoding feature on linux?" "Because it doesn't match with the philosophy of the existing linux
audio framework."

Like I say I'm having real trouble connecting the above with what I wrote.

Quoted 5 lines
Quoted 5 lines

We already have an existing framework for embedded audio devices. We may want to extend or improve it but I don't see a pressing need to develop a new one. Whenever we end up with two different ways of doing the same thing it's not great, it just makes for confusion and redundancy.

Quoted 8 lines
Quoted 2 lines

So, are you saying that we can extend ASoC to provide the support this kind of hardware feature? If yes, then we can work on it first.

I'm saying I see nothing about this hardware which should prevent it working with ASoC right now. As I have said in terms of the overall structure of the device it's not really doing anything that hasn't been done elsewhere. There's stuff we'd have to bodge in the short term, but only fairly small bits that can be handled fairly straightforwardly.

OK, then we should fix this first.

thanks,

Takashi

#13 lore raw
Quoted 10 lines · Takashi Iwai
Quoted 5 lines · Mark Brown

I do have some qualms about staging but given Greg's active policing of it and work to push things into the actual trees the warnings about its quality and general mainlineness are much more meaningful than those for experimental. There's also the tainting of kernels, which is really useful.

But who of the end user would care about it? It's distributor and developer who care.

End users I'm not so worried about in the immediate instance, it's mostly developers and in the embedded space there's way more of them than end users. A lot of the time end users don't get sufficent access to the hardware to worry about kernels (though in this case that's less likely to be the case).

Quoted 3 lines

And, is the code quality is in question, which is supposed to be fixable there? Your argument against this driver doesn't sound like fixable.

What makes you think these problems are unfixable? It should be fairly straightforward to pull out the CODEC and board parts of the driver and factor them out - as I said last night the ASoC CPU side support is a very thin wrapper around vanilla ALSA. The code and board sections of the code look fairly basic and straightforward to redo within the ASoC APIs. I don't think this is an unreasonably difficult thing to do and it's certainly nowhere near starting from scratch.

Quoted 4 lines

So then why you do you think keeping that stuff in staging tree is OK while sound tree is not? It's a question to be or not to be. End-users never hesitate using the staging if it works. They don't notice the difference; they don't notice kernel taint either.

Like I say, I have some qualms about staging but they're pretty minor. The idea of accepting embedded drivers which don't use ASoC seems like a massive step back compared to where what we've got right now, and is going down the path of accepting drivers that don't even sit within ALSA.

Currently with Linux we're able to say that if a CPU is supported and a CODEC is supported then we can use the two together. That's great, and it's good for all concerned. If we're going to start accepting vendor specific audio stacks we'll no longer be in a position to say that. We will be back to having to talk about specific combinations of devices working together.

Quoted 3 lines

The staging driver is also in upstream; distribution enables it almost always, no matter how the quality of each driver is. For developers, the distinction is clear, of course. But for the rest, it's not.

The biggest issues here surround developers.

Quoted 5 lines

So, if you really don't want this style of implementation, you'll have to take an action for getting rid of the driver from staging tree. Otherwise others will submit the similar drivers, and they'll land there, too. Then we can keep the stuff in sound or other git tree in another branch until the things gets sorted out.

One of the nice things about staging (indeed the key thing from my point of view) is that Greg does from time to time remove drivers from staging which look like they're not making any progress towards leaving staging. In contrast drivers in the main tree generally sit there indefinitely with minimal impetus to improve them.

Quoted 8 lines
Quoted 7 lines

I'm sorry I don't really understand what you're saying here. The encoder offload stuff is all totally orthogonal to the issue of using the ASoC APIs. On the CPU side the ASoC API is mostly a thin wrapper around the standard ALSA API so anything that works in ALSA should slot fairly readily into ASoC. What I'd expect to see happen is that the CODEC and board stuff would get pulled out and everything else would stay pretty much as-is, including the DSP.

Quoted 7 lines
Quoted 4 lines

CPUs like OMAP (which are obviously already in the ASoC framework) also support this sort of stuff, the issues with mainline for them have been around the API to the DSP, though it looks like the TI stuff in staging is getting sorted out now.

Well, what I don't understand in your argument is why we must stop it being deployed.

Because it's not using the relevant framework at all, it's gone and reinvented the wheel without a pressing reason to do so and this will be very likely to create problems if the part is at all successful. It will also set a really bad precedent for other vendors which is even more worrying than the specific driver.

Throughout the kernel we regularly have to push back on embedded vendors (not just CPU vendors) who produce drivers outside the standard frameworks and get them converted to the standard frameworks so that they can be deployed without having to go into driver specific APIs all the time. Due to the fact that everything gets merged into one mainline tree Linux has much higher standards all round with this sort of thing than most other OSs but it takes work to enforce that.

This does include a bunch of the recently posted Intel drivers, including this one, but there's nothing particularly unusual here.

Quoted 3 lines

Because it doesn't match with the current design of
the framework? If so, a straight question must come next: can't the framework itself be extended to suit with such hardware?

As I wrote several times I can see no problem supporting this hardware with current ASoC. I'm not sure how I can be any clearer on this point.

Quoted 7 lines
Quoted 5 lines

I'm saying I see nothing about this hardware which should prevent it working with ASoC right now. As I have said in terms of the overall structure of the device it's not really doing anything that hasn't been done elsewhere. There's stuff we'd have to bodge in the short term, but only fairly small bits that can be handled fairly straightforwardly.

OK, then we should fix this first.

This is all driver specific stuff, there's nothing that needs doing here immediately outside of the driver that I can spot right now.

#14 lore raw

Hi,

Building a linux audio driver is like putting lego blocks together. That is the major convenience in driver development and other non-opensource systems cannot offer such luxury to driver developers. I am in no position to make any statements but please keep this luxury alive and thriving and do not let it be ruined by vendor-specific ways if there is a standardized framework to employ, if the framework is suitable for the task, and if modifying the existing driver is not overly complicated.

Thanks for the great work you are doing.

Pavel.

Mark Brown napsal(a):

Quoted 120 lines · Takashi Iwai
Quoted 10 lines
Quoted 5 lines · Mark Brown

I do have some qualms about staging but given Greg's active policing of it and work to push things into the actual trees the warnings about its quality and general mainlineness are much more meaningful than those for experimental. There's also the tainting of kernels, which is really useful.

But who of the end user would care about it? It's distributor and developer who care.

End users I'm not so worried about in the immediate instance, it's mostly developers and in the embedded space there's way more of them than end users. A lot of the time end users don't get sufficent access to the hardware to worry about kernels (though in this case that's less likely to be the case).

Quoted 3 lines

And, is the code quality is in question, which is supposed to be fixable there? Your argument against this driver doesn't sound like fixable.

What makes you think these problems are unfixable? It should be fairly straightforward to pull out the CODEC and board parts of the driver and factor them out - as I said last night the ASoC CPU side support is a very thin wrapper around vanilla ALSA. The code and board sections of the code look fairly basic and straightforward to redo within the ASoC APIs. I don't think this is an unreasonably difficult thing to do and it's certainly nowhere near starting from scratch.

Quoted 4 lines

So then why you do you think keeping that stuff in staging tree is OK while sound tree is not? It's a question to be or not to be. End-users never hesitate using the staging if it works. They don't notice the difference; they don't notice kernel taint either.

Like I say, I have some qualms about staging but they're pretty minor. The idea of accepting embedded drivers which don't use ASoC seems like a massive step back compared to where what we've got right now, and is going down the path of accepting drivers that don't even sit within ALSA.

Currently with Linux we're able to say that if a CPU is supported and a CODEC is supported then we can use the two together. That's great, and it's good for all concerned. If we're going to start accepting vendor specific audio stacks we'll no longer be in a position to say that. We will be back to having to talk about specific combinations of devices working together.

Quoted 3 lines

The staging driver is also in upstream; distribution enables it almost always, no matter how the quality of each driver is. For developers, the distinction is clear, of course. But for the rest, it's not.

The biggest issues here surround developers.

Quoted 5 lines

So, if you really don't want this style of implementation, you'll have to take an action for getting rid of the driver from staging tree. Otherwise others will submit the similar drivers, and they'll land there, too. Then we can keep the stuff in sound or other git tree in another branch until the things gets sorted out.

One of the nice things about staging (indeed the key thing from my point of view) is that Greg does from time to time remove drivers from staging which look like they're not making any progress towards leaving staging. In contrast drivers in the main tree generally sit there indefinitely with minimal impetus to improve them.

Quoted 8 lines
Quoted 7 lines

I'm sorry I don't really understand what you're saying here. The encoder offload stuff is all totally orthogonal to the issue of using the ASoC APIs. On the CPU side the ASoC API is mostly a thin wrapper around the standard ALSA API so anything that works in ALSA should slot fairly readily into ASoC. What I'd expect to see happen is that the CODEC and board stuff would get pulled out and everything else would stay pretty much as-is, including the DSP.

Quoted 7 lines
Quoted 4 lines

CPUs like OMAP (which are obviously already in the ASoC framework) also support this sort of stuff, the issues with mainline for them have been around the API to the DSP, though it looks like the TI stuff in staging is getting sorted out now.

Well, what I don't understand in your argument is why we must stop it being deployed.

Because it's not using the relevant framework at all, it's gone and reinvented the wheel without a pressing reason to do so and this will be very likely to create problems if the part is at all successful. It will also set a really bad precedent for other vendors which is even more worrying than the specific driver.

Throughout the kernel we regularly have to push back on embedded vendors (not just CPU vendors) who produce drivers outside the standard frameworks and get them converted to the standard frameworks so that they can be deployed without having to go into driver specific APIs all the time. Due to the fact that everything gets merged into one mainline tree Linux has much higher standards all round with this sort of thing than most other OSs but it takes work to enforce that.

This does include a bunch of the recently posted Intel drivers, including this one, but there's nothing particularly unusual here.

Quoted 3 lines

Because it doesn't match with the current design of
the framework? If so, a straight question must come next: can't the framework itself be extended to suit with such hardware?

As I wrote several times I can see no problem supporting this hardware with current ASoC. I'm not sure how I can be any clearer on this point.

Quoted 7 lines
Quoted 5 lines

I'm saying I see nothing about this hardware which should prevent it working with ASoC right now. As I have said in terms of the overall structure of the device it's not really doing anything that hasn't been done elsewhere. There's stuff we'd have to bodge in the short term, but only fairly small bits that can be handled fairly straightforwardly.

OK, then we should fix this first.

This is all driver specific stuff, there's nothing that needs doing here immediately outside of the driver that I can spot right now.
_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#15 lore raw
In reply to Mark Brown

At Mon, 18 Oct 2010 08:20:17 +0100,

Quoted 113 lines · Mark Brown
Quoted 10 lines · Takashi Iwai
Quoted 5 lines · Mark Brown

I do have some qualms about staging but given Greg's active policing of it and work to push things into the actual trees the warnings about its quality and general mainlineness are much more meaningful than those for experimental. There's also the tainting of kernels, which is really useful.

But who of the end user would care about it? It's distributor and developer who care.

End users I'm not so worried about in the immediate instance, it's mostly developers and in the embedded space there's way more of them than end users. A lot of the time end users don't get sufficent access to the hardware to worry about kernels (though in this case that's less likely to be the case).

Quoted 3 lines

And, is the code quality is in question, which is supposed to be fixable there? Your argument against this driver doesn't sound like fixable.

What makes you think these problems are unfixable? It should be fairly straightforward to pull out the CODEC and board parts of the driver and factor them out - as I said last night the ASoC CPU side support is a very thin wrapper around vanilla ALSA. The code and board sections of the code look fairly basic and straightforward to redo within the ASoC APIs. I don't think this is an unreasonably difficult thing to do and it's certainly nowhere near starting from scratch.

Quoted 4 lines

So then why you do you think keeping that stuff in staging tree is OK while sound tree is not? It's a question to be or not to be. End-users never hesitate using the staging if it works. They don't notice the difference; they don't notice kernel taint either.

Like I say, I have some qualms about staging but they're pretty minor. The idea of accepting embedded drivers which don't use ASoC seems like a massive step back compared to where what we've got right now, and is going down the path of accepting drivers that don't even sit within ALSA.

Currently with Linux we're able to say that if a CPU is supported and a CODEC is supported then we can use the two together. That's great, and it's good for all concerned. If we're going to start accepting vendor specific audio stacks we'll no longer be in a position to say that. We will be back to having to talk about specific combinations of devices working together.

Quoted 3 lines

The staging driver is also in upstream; distribution enables it almost always, no matter how the quality of each driver is. For developers, the distinction is clear, of course. But for the rest, it's not.

The biggest issues here surround developers.

Quoted 5 lines

So, if you really don't want this style of implementation, you'll have to take an action for getting rid of the driver from staging tree. Otherwise others will submit the similar drivers, and they'll land there, too. Then we can keep the stuff in sound or other git tree in another branch until the things gets sorted out.

One of the nice things about staging (indeed the key thing from my point of view) is that Greg does from time to time remove drivers from staging which look like they're not making any progress towards leaving staging. In contrast drivers in the main tree generally sit there indefinitely with minimal impetus to improve them.

Quoted 8 lines
Quoted 7 lines

I'm sorry I don't really understand what you're saying here. The encoder offload stuff is all totally orthogonal to the issue of using the ASoC APIs. On the CPU side the ASoC API is mostly a thin wrapper around the standard ALSA API so anything that works in ALSA should slot fairly readily into ASoC. What I'd expect to see happen is that the CODEC and board stuff would get pulled out and everything else would stay pretty much as-is, including the DSP.

Quoted 7 lines
Quoted 4 lines

CPUs like OMAP (which are obviously already in the ASoC framework) also support this sort of stuff, the issues with mainline for them have been around the API to the DSP, though it looks like the TI stuff in staging is getting sorted out now.

Well, what I don't understand in your argument is why we must stop it being deployed.

Because it's not using the relevant framework at all, it's gone and reinvented the wheel without a pressing reason to do so and this will be very likely to create problems if the part is at all successful. It will also set a really bad precedent for other vendors which is even more worrying than the specific driver.

Throughout the kernel we regularly have to push back on embedded vendors (not just CPU vendors) who produce drivers outside the standard frameworks and get them converted to the standard frameworks so that they can be deployed without having to go into driver specific APIs all the time. Due to the fact that everything gets merged into one mainline tree Linux has much higher standards all round with this sort of thing than most other OSs but it takes work to enforce that.

This does include a bunch of the recently posted Intel drivers, including this one, but there's nothing particularly unusual here.

Quoted 3 lines

Because it doesn't match with the current design of
the framework? If so, a straight question must come next: can't the framework itself be extended to suit with such hardware?

As I wrote several times I can see no problem supporting this hardware with current ASoC. I'm not sure how I can be any clearer on this point.

Quoted 5 lines
Quoted 5 lines

I'm saying I see nothing about this hardware which should prevent it working with ASoC right now. As I have said in terms of the overall structure of the device it's not really doing anything that hasn't been done elsewhere. There's stuff we'd have to bodge in the short term, but only fairly small bits that can be handled fairly straightforwardly.

Quoted 4 lines
Quoted 1 line

OK, then we should fix this first.

This is all driver specific stuff, there's nothing that needs doing here immediately outside of the driver that I can spot right now.

... so the whole messages can be reduced to a sentense:
"Rewrite the driver based on ASoC!"

Then it's a question to Intel guys. If they would like to support for it, we can happily wait for it before merging. If they don't want but keep as is, then questions are:
- whether to keep it in upstream or not
- where to keep it, in staging or in sound tree

and, the latter question is nothing but a bikeshedding; in anyway it's a second choice, after all. We should spend time for more useful things :)

Takashi

#16 lore raw
Quoted 120 lines · Takashi Iwai

At Mon, 18 Oct 2010 08:20:17 +0100,

Quoted 113 lines · Mark Brown
Quoted 10 lines · Takashi Iwai
Quoted 5 lines · Mark Brown

I do have some qualms about staging but given Greg's active policing of it and work to push things into the actual trees the warnings about its quality and general mainlineness are much more meaningful than those for experimental. There's also the tainting of kernels, which is really useful.

But who of the end user would care about it? It's distributor and developer who care.

End users I'm not so worried about in the immediate instance, it's mostly developers and in the embedded space there's way more of them than end users. A lot of the time end users don't get sufficent access to the hardware to worry about kernels (though in this case that's less likely to be the case).

Quoted 3 lines

And, is the code quality is in question, which is supposed to be fixable there? Your argument against this driver doesn't sound like fixable.

What makes you think these problems are unfixable? It should be fairly straightforward to pull out the CODEC and board parts of the driver and factor them out - as I said last night the ASoC CPU side support is a very thin wrapper around vanilla ALSA. The code and board sections of the code look fairly basic and straightforward to redo within the ASoC APIs. I don't think this is an unreasonably difficult thing to do and it's certainly nowhere near starting from scratch.

Quoted 4 lines

So then why you do you think keeping that stuff in staging tree is OK while sound tree is not? It's a question to be or not to be. End-users never hesitate using the staging if it works. They don't notice the difference; they don't notice kernel taint either.

Like I say, I have some qualms about staging but they're pretty minor. The idea of accepting embedded drivers which don't use ASoC seems like a massive step back compared to where what we've got right now, and is going down the path of accepting drivers that don't even sit within ALSA.

Currently with Linux we're able to say that if a CPU is supported and a CODEC is supported then we can use the two together. That's great, and it's good for all concerned. If we're going to start accepting vendor specific audio stacks we'll no longer be in a position to say that. We will be back to having to talk about specific combinations of devices working together.

Quoted 3 lines

The staging driver is also in upstream; distribution enables it almost always, no matter how the quality of each driver is. For developers, the distinction is clear, of course. But for the rest, it's not.

The biggest issues here surround developers.

Quoted 5 lines

So, if you really don't want this style of implementation, you'll have to take an action for getting rid of the driver from staging tree. Otherwise others will submit the similar drivers, and they'll land there, too. Then we can keep the stuff in sound or other git tree in another branch until the things gets sorted out.

One of the nice things about staging (indeed the key thing from my point of view) is that Greg does from time to time remove drivers from staging which look like they're not making any progress towards leaving staging. In contrast drivers in the main tree generally sit there indefinitely with minimal impetus to improve them.

Quoted 8 lines
Quoted 7 lines

I'm sorry I don't really understand what you're saying here. The encoder offload stuff is all totally orthogonal to the issue of using the ASoC APIs. On the CPU side the ASoC API is mostly a thin wrapper around the standard ALSA API so anything that works in ALSA should slot fairly readily into ASoC. What I'd expect to see happen is that the CODEC and board stuff would get pulled out and everything else would stay pretty much as-is, including the DSP.

Quoted 7 lines
Quoted 4 lines

CPUs like OMAP (which are obviously already in the ASoC framework) also support this sort of stuff, the issues with mainline for them have been around the API to the DSP, though it looks like the TI stuff in staging is getting sorted out now.

Well, what I don't understand in your argument is why we must stop it being deployed.

Because it's not using the relevant framework at all, it's gone and reinvented the wheel without a pressing reason to do so and this will be very likely to create problems if the part is at all successful. It will also set a really bad precedent for other vendors which is even more worrying than the specific driver.

Throughout the kernel we regularly have to push back on embedded vendors (not just CPU vendors) who produce drivers outside the standard frameworks and get them converted to the standard frameworks so that they can be deployed without having to go into driver specific APIs all the time. Due to the fact that everything gets merged into one mainline tree Linux has much higher standards all round with this sort of thing than most other OSs but it takes work to enforce that.

This does include a bunch of the recently posted Intel drivers, including this one, but there's nothing particularly unusual here.

Quoted 3 lines

Because it doesn't match with the current design of
the framework? If so, a straight question must come next: can't the framework itself be extended to suit with such hardware?

As I wrote several times I can see no problem supporting this hardware with current ASoC. I'm not sure how I can be any clearer on this point.

Quoted 5 lines
Quoted 5 lines

I'm saying I see nothing about this hardware which should prevent it working with ASoC right now. As I have said in terms of the overall structure of the device it's not really doing anything that hasn't been done elsewhere. There's stuff we'd have to bodge in the short term, but only fairly small bits that can be handled fairly straightforwardly.

Quoted 4 lines
Quoted 1 line

OK, then we should fix this first.

This is all driver specific stuff, there's nothing that needs doing here immediately outside of the driver that I can spot right now.

Quoted 9 lines

... so the whole messages can be reduced to a sentense:
"Rewrite the driver based on ASoC!"

Then it's a question to Intel guys. If they would like to support for it, we can happily wait for it before merging. If they don't want but keep as is, then questions are:
- whether to keep it in upstream or not
- where to keep it, in staging or in sound tree

I've just had a look at the code and my fear is here that this will be dumped in it's current state and forgotten about when Intel moves onto their next big thing(tm). I hope I'm wrong though....

I also have to echo Mark and Pavel's concerns here that re-inventing the wheel in some areas is both unnecessary and divisive. Subsystem frameworks are one of the kernels key strengths and this lessens that to a degree.

Liam

Signature · 3 lines
Freelance Developer, SlimLogic Ltd
ASoC and Voltage Regulator Maintainer.
http://www.slimlogic.co.uk
author
#17 lore raw
In reply to Takashi Iwai
Quoted 5 lines
Quoted 2 lines

This is all driver specific stuff, there's nothing that needs doing here immediately outside of the driver that I can spot right now.

... so the whole messages can be reduced to a sentense:
"Rewrite the driver based on ASoC!"

Rework rather than rewrite I think. Plus fix the abuse of the jack inputs etc. Our intent is to do the job properly.

Quoted 1 line

- whether to keep it in upstream or not

I think so - it gets more visiblity and it is already benefitting from that

Quoted 1 line

- where to keep it, in staging or in sound tree

I would prefer staging as again it gets more visibility. The second reason I would prefer that visibility is that separate to the plain ALSA driver there needs to be a bigger discussion around audio offload interfaces and standardizing them.

Alan

#18 lore raw

At Mon, 18 Oct 2010 11:34:00 +0100,

Quoted 15 lines · Alan Cox
Quoted 6 lines
Quoted 3 lines

This is all driver specific stuff, there's nothing that needs doing here immediately outside of the driver that I can spot right now.

... so the whole messages can be reduced to a sentense:
"Rewrite the driver based on ASoC!"

Rework rather than rewrite I think. Plus fix the abuse of the jack inputs etc. Our intent is to do the job properly.

Quoted 1 line

- whether to keep it in upstream or not

I think so - it gets more visiblity and it is already benefitting from that

Quoted 6 lines
Quoted 1 line

- where to keep it, in staging or in sound tree

I would prefer staging as again it gets more visibility. The second reason I would prefer that visibility is that separate to the plain ALSA driver there needs to be a bigger discussion around audio offload interfaces and standardizing them.

OK, if the current status is so, there is no need to move it to sound tree. I just wanted to make this thing not being laid on staging forever with only coding-style clean-ups here and there.

thanks,

Takashi

author
#19 lore raw
In reply to Mark Brown
Quoted 3 lines

Because it's not using the relevant framework at all, it's gone and reinvented the wheel without a pressing reason to do so and this will be very likely to create problems if the part is at all successful.

Its more a case of predating the wheel as far as I can tell. In terms of frameworks I don't think it matters as of itself - but once that means you have to write two different versions of the same codec chip driver for example yes it matters.

Quoted 2 lines

This is all driver specific stuff, there's nothing that needs doing here immediately outside of the driver that I can spot right now.

Well our agenda right now is to strip out the crap, polish up the various bugs found in review (and in staging its already getting a trickle of very useful community input swatting silly error path bugs, signed/unsigned typing etc) and then assign someone in Intel OTC (hopefully if things go to plan someone with prior ALSA dev experience) to make it a good ALSA citizen which probably means using ASOC or similar.

Putting it in staging allows that work to be done in public in a meaningful way where the code and changes get review.

Alan

#20 lore raw
Quoted 5 lines · Alan Cox
Quoted 3 lines

Because it's not using the relevant framework at all, it's gone and reinvented the wheel without a pressing reason to do so and this will be very likely to create problems if the part is at all successful.

Its more a case of predating the wheel as far as I can tell. In terms

ASoC has been in mainline since 2.6.21 which I imagine predates the Moorestown code.

Quoted 3 lines

of frameworks I don't think it matters as of itself - but once that means you have to write two different versions of the same codec chip driver for example yes it matters.

Yes, exactly - this is the big problem. It's often much worse than just two different versions, with these things it's easy to end up having to have versions per board.

Quoted 2 lines

Putting it in staging allows that work to be done in public in a meaningful way where the code and changes get review.

I agree with the approach you're outlining here.

#21 lore raw

Re: Staging: sst: add Intel SST audio driver

In reply to Alan Cox
Quoted 29 lines · Alan Cox

From: Vinod Koul <[email protected]>

This is the Intel SST audio driver.

As compared to the previous versions it has all the printks and other stuff noted cleaned up and more hardware support. The Aava support is disabled in this patch (is_aava resolves to 0) because the Aava board detection logic is not yet upstream.

The driver itself is a combination of a traditional ALSA driver and a hardware assisted offload driver which can play audio while the processor is asleep but which can't do all the more interactive stuff.

In the general case most software would use the ALSA interface, but the other interface is needed for certain classes of use such as music playback on highly power consumption sensitive devices.

This is going to staging primarily because it depends upon the staging memrar driver.

[Merged together and tweaked for -next]

drivers/staging/Kconfig source "drivers/staging/bcm/Kconfig" · line 168

Quoted 4 lines
drivers/staging/Kconfig +1 -0
@@ -165,5 +165,7 @@ source "drivers/staging/bcm/Kconfig"
 
 source "drivers/staging/ft1000/Kconfig"
 
+source "drivers/staging/intel_sst/Kconfig"

You forgot to include the drivers/staging/intel_sst/Kconfig file in this patch, so it breaks the build :(

Care to add it and resend the whole patch?

thanks,

greg k-h