All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jaroslav Kysela <perex@perex.cz>
To: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>,
	ALSA development <alsa-devel@alsa-project.org>
Cc: Takashi Iwai <tiwai@suse.de>, Mark Brown <broonie@kernel.org>,
	Kai Vehmanen <kai.vehmanen@linux.intel.com>
Subject: Re: [alsa-devel] UCM extensions
Date: Tue, 5 Nov 2019 21:19:09 +0100	[thread overview]
Message-ID: <f16e60b0-dd72-d84f-a01c-886e48a86bbc@perex.cz> (raw)
In-Reply-To: <2598c6a8-ce64-ad7e-ee34-8ea930b3cf7d@linux.intel.com>

Dne 05. 11. 19 v 20:52 Pierre-Louis Bossart napsal(a):
> 
> 
> On 11/5/19 1:36 PM, Jaroslav Kysela wrote:
>> Hi all,
>>
>>       I make some internal ucm code cleanups in alsa-lib and added three
>> major extensions to allow more complex configurations which we require
>> for the SOF kernel driver.
> 
> Great, thanks for working on this!
> 
>>
>>       The first thing is the added substitution for the value strings:
>>
>> https://github.com/alsa-project/alsa-lib/commit/f1e637b285e8e04e6761248a070f58f3a8fde6fc
>>
>>
>>       The second thing is the If block:
>>
>> https://github.com/alsa-project/alsa-lib/commit/985715ce8148dc7ef62c8e3d8ce5a0c2ac51f8df
> 
> is it possible for the Condition to check if the card contains the SOF
> prefix?
> 
> For Baytrail/Cherrytrail support, we have a ton of existing UCM files,
> and the only thing needed is e.g.
> - to change from hw:bytcrrt5640 to hw:sofbytcrt5640

It is easy with the proposed substitution, just use hw:${CardId} here. It can 
for any values (like PCM device names etc.).

> - make the controls for the legacy driver conditional
> 
> SectionVerb {
> 	EnableSequence [
> 		
> 		if (card name does not contain SOF)
> 		<platforms/bytcr/PlatformEnableSeq.conf>
> 		endif
> 		<codecs/rt5640/EnableSeq.conf>
> 	]

The If blocks cannot be used in sequences, but you can do basically this with 
the proposed If extension:

SectionVerb {
	If.1 {
		Condition {
			Type StringEqual
			String1 "${CardName}"
			String2 "bytcrt5640"
		}
		True {
			EnableSequence [
				<platforms/bytcr/PlatformEnableSeq.conf>
				<codecs/rt5640/EnableSeq.conf>
			]
		}
		False {
			EnableSequence [
				<codecs/rt5640/EnableSeq.conf>
			]
		}
	}
}

The condition with "Type StringEqual" is not implemented yet, but it's easy to 
add new conditions to my proposed code. If you see something else to be 
compared, just let me know to add those conditions in the first phase.

> Most of the information that matters for those UCM files is the type of
> peripherals and the matching mixer configuration for the codec driver,
> and we should reuse this information between legacy and SOF.

Yes, I see the demand to make the description more universal and easy to read.

Note that cdev is already initialized from the ValueDefaults {} section 
PlaybackCTL/CaptureCTL values even in the old code, so the most of cdev 
declarations are not necessary in the current UCM configs too. When the 
use-case configuration is tied to the one card, I added the code to use it 
implicitly, so cdev can be really omitted. With the proposed code, the 
PlaybackCTL/CaptureCTL are always available for the one card configs:

https://github.com/alsa-project/alsa-lib/commit/c099329ce6ffdb26fc7a4a6ffb6fbb166a1e856b

					Jaroslav

-- 
Jaroslav Kysela <perex@perex.cz>
Linux Sound Maintainer; ALSA Project; Red Hat, Inc.
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

  reply	other threads:[~2019-11-05 20:20 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-05 19:36 [alsa-devel] UCM extensions Jaroslav Kysela
2019-11-05 19:52 ` Pierre-Louis Bossart
2019-11-05 20:19   ` Jaroslav Kysela [this message]
2019-11-05 20:27     ` Pierre-Louis Bossart
2019-11-06 11:50 ` Kai Vehmanen
2019-11-06 13:10   ` Jaroslav Kysela
2019-11-06 13:51     ` Jaska Uimonen
2019-11-06 17:04       ` Jaroslav Kysela
2019-11-07  6:48 ` Takashi Iwai
2019-11-07  8:33   ` Jaroslav Kysela
2019-11-07  9:23     ` Takashi Iwai
2019-11-07 11:08       ` Jaroslav Kysela
2019-11-07 11:16         ` Takashi Iwai
2019-11-07 13:14           ` Jaroslav Kysela
2019-11-07 10:18 ` Cezary Rojewski
2019-11-07 11:01   ` Jaroslav Kysela
2019-11-07 11:54     ` Kai Vehmanen

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=f16e60b0-dd72-d84f-a01c-886e48a86bbc@perex.cz \
    --to=perex@perex.cz \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=kai.vehmanen@linux.intel.com \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=tiwai@suse.de \
    /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.