All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Henningsson <david.henningsson-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
To: Feng Wei <feng.wei-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Cc: alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw@public.gmane.org,
	linaro-dev-cunTk1MwBs8s++Sfvej+rw@public.gmane.org,
	General PulseAudio Discussion
	<pulseaudio-discuss-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>,
	Colin Guthrie <gmane-D409yXkIzt2rnn0nCzrM/w@public.gmane.org>,
	Mark Brown
	<broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>,
	Liam Girdwood <lrg-l0cyMroinI0@public.gmane.org>
Subject: Re: [pulseaudio-discuss] alsa ucm in pulseaudio
Date: Fri, 14 Oct 2011 12:57:39 +0200	[thread overview]
Message-ID: <4E9815A3.7090304@canonical.com> (raw)
In-Reply-To: <CAJ4+uhX1bYr3HEUwtKCSLkzsa71OLo4KSP00+Kx25H=t1Ves7g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

On 10/14/2011 12:40 PM, Feng Wei wrote:
> 2011/10/14 David Henningsson<david.henningsson-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>:
>> On 10/14/2011 11:42 AM, Feng Wei wrote:
>>>
>>> 2011/10/14 David Henningsson<david.henningsson-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>:
>>>>
>>>> On 10/14/2011 09:39 AM, Feng Wei wrote:
>>>>>
>>>>> 2011/10/14 David Henningsson<david.henningsson-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>:
>>>>>>
>>>>>> On 10/14/2011 04:47 AM, Feng Wei wrote:
>>>>>>>
>>>>>>> Hi Liam, Mark, Colin, and all,
>>>>>>>    I study the codes in pulseaudio and alsa ucm patch recently, and
>>>>>>> create a page of my study result. I appreciate your feedback. The page
>>>>>>> is at
>>>>>>>
>>>>>>>
>>>>>>> https://wiki.linaro.org/WorkingGroups/Middleware/Multimedia/Specs/1111/AudioIntegration/UCMPulseAudio/Analyzation.
>>>>>>>    Also if needed, I'm glad to contribute to the integration of alsa
>>>>>>> ucm in pulseaudio.
>>>>>>>    Thank you.
>>>>>>
>>>>>> Oh, nice diagrams :-) Some of them might be useful additions to the
>>>>>> PulseAudio wiki.
>>>>>
>>>>> Thanks :-)
>>>>>>
>>>>>> I think the modelling of UCM concepts onto PulseAudio concepts is an
>>>>>> important discussion. In PulseAudio, profiles are mainly connected to
>>>>>> device
>>>>>> strings, how to open the devices, channels supported, whereas ports are
>>>>>> just
>>>>>> alsa mixer kcontrol changes. UCM verbs, as I understand it, contain
>>>>>> both.
>>>>>
>>>>> My understanding is profile:port and verb:device/modifier are both
>>>>> hierarchical. e.g. we have an alsa device string hw:0,0, and some
>>>>> mixer controls for route speaker or headset. In pa profile, we
>>>>> describe a profile output:analog-stereo with two ports, one for
>>>>> speaker, and the other for  headset. In ucm, we define verb "hifi" and
>>>>> two excluded devices speaker and headset, both of the devices have
>>>>> PlaybackPCM hw:0,0. And we can also define two modifiers to switch
>>>>> between speaker and headset. So we can create profile by verb and
>>>>> create profile input/output mappings by devices(merge the same hw
>>>>> device) and create ports by modifier. I'm not sure if it break the
>>>>> original ucm concepts, but I think it can work.
>>>>
>>>> There is also the "Use Case" concept in UCM, Is there always exactly one
>>>> verb for every use case? If not, one might wonder if "Use Case" or "Verb"
>>>> is
>>>> what should correspond to the "Profile" concept.
>>>
>>> verb is equal to use case. "use case" is a concept and verb is in the
>>> source code.
>>
>> Ok.
>>
>>>> Card, Sink/Source, Profile and Port are the core concepts in PulseAudio.
>>>> I
>>>> think UCM should use alsa-sink, alsa-card and alsa-source, but the rest
>>>> of
>>>> the stuff: pa_alsa_profile_*, pa_alsa_path_*, pa_alsa_mapping - in short,
>>>> everything in alsa-mixer.h, I don't think the UCM implementation should
>>>> touch them. They are too tightly coupled with the existing ideas of how
>>>> to
>>>> map ALSA kcontrols to Profiles and Ports, something that UCM does in its
>>>> own
>>>> way. So in my opinion, you should forget about mappings - it's Profile
>>>> and
>>>> Port (and Sink/Source) we need to match against.
>>>
>>> Actually we must map the concepts because ucm is designed for abstract
>>> the complicated kcontrol. In my mind, if we use ucm in pa, the
>>> original profile configuration files and mixer configuration files
>>> will be replaced by ucm configuration files.
>>
>> I beg to differ: In UCM, PulseAudio is not modifying the mixer controls
>> directly, it's just doing calls to alsa ucm library to enable and disable
>> stuff verbs/devices/etc.
> I absolutely agree. mixer controls are hidden behind the ucm.
>> That's why we should not map against existing
>> routines that are mainly for modifying mixer controls.
> If not mapping port, I just can't find the way to do extra things as
> switching mutually exclusive device in pa client. Do you mean still
> using original alsa mixer configurations, not the alsa ucm?

Aha, I think this is a misunderstanding of the word "mapping". There is 
an object "pa_alsa_mapping" which IMO should not be used when UCM is 
used (it does this in the existing UCM patch set, and I think this is 
wrong). When I said "forget about mappings" I meant "forget about using 
pa_alsa_mapping in PulseAudio's UCM implementation".

We should probably use the "pa_device_port" object. Exactly how depends 
on how Mark answers to my question about constraints/concurrency.

>> Removing the original profile configuration files might be possible in an
>> embedded scenario, but for all hundreds of different snd-hda-intel/AC'97/etc
>> configurations out there, writing UCM configurations to fit all of them is
>> just not scalable. (If so, one would have to write an auto-UCM tool that
>> autogenerates UCM profiles based on present hardware.)
> So I suggest to add a new module alsa ucm card, so that platform
> provider can choose which module to use. If some platform uses alsa
> ucm module, then the mixer configurations in alsa module will be
> ignored.

Have you had a look at the patches for UCM already posted several months 
ago, and that I spent quite some time reviewing? Or are you planning to 
start over from scratch?

-- 
David Henningsson, Canonical Ltd.
http://launchpad.net/~diwic

  parent reply	other threads:[~2011-10-14 10:57 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-14  2:47 alsa ucm in pulseaudio Feng Wei
2011-10-14  6:35 ` [pulseaudio-discuss] " David Henningsson
     [not found]   ` <4E97D81E.4080607-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
2011-10-14  7:39     ` Feng Wei
     [not found]       ` <CAJ4+uhUL-mR_=Tot4XBbQuMRgbg45raL+058prXgEmrpG5Jukg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-10-14  8:57         ` David Henningsson
2011-10-14  9:39           ` Mark Brown
2011-10-14 10:00             ` David Henningsson
2011-10-14 11:35               ` Mark Brown
     [not found]           ` <4E97F964.4080701-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
2011-10-14  9:42             ` Feng Wei
     [not found]               ` <CAJ4+uhUGgcFtZrYdu4-kzd8Er5tr0rFuAu4foY04Ku2JyQaeyw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-10-14 10:19                 ` David Henningsson
     [not found]                   ` <4E980CC9.2050303-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
2011-10-14 10:40                     ` Feng Wei
     [not found]                       ` <CAJ4+uhX1bYr3HEUwtKCSLkzsa71OLo4KSP00+Kx25H=t1Ves7g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-10-14 10:57                         ` David Henningsson [this message]
2011-10-14 12:18                           ` Mark Brown
2011-10-17  7:14                             ` Arun Raghavan
2011-10-17  7:45                               ` Feng Wei
2011-10-17  8:32                               ` David Henningsson
2011-10-17 10:23                                 ` Mark Brown
2011-10-17 10:55                                   ` Arun Raghavan
2011-10-17 11:03                                     ` Takashi Iwai
2011-10-14 12:01                   ` Mark Brown

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=4E9815A3.7090304@canonical.com \
    --to=david.henningsson-z7wlfzj8ewms+fvcfc7uqw@public.gmane.org \
    --cc=alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw@public.gmane.org \
    --cc=broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org \
    --cc=feng.wei-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=gmane-D409yXkIzt2rnn0nCzrM/w@public.gmane.org \
    --cc=linaro-dev-cunTk1MwBs8s++Sfvej+rw@public.gmane.org \
    --cc=lrg-l0cyMroinI0@public.gmane.org \
    --cc=pulseaudio-discuss-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    /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.