Re: [Question][ASoC][Topology] Question about ASoC Topology

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Takashi,

Thanks for your explanation on how topology works! I cc the ML since potential users may also benefit from this info.

Hi Lee,

Now Intel SKL (Skylake) audio driver is using topology, which might be a reference for you.

For the text conf file in user space, please see alsa-lib/src/conf/topology/sklrt286/skl_i2s.conf. The topology user space tool alsatplg will generate the SKL topology binary file for kernel.
The doxygen doc also introduces the syntax.

Besides the text conf file, you may also define topology objects by C API, declared in alsa-lib/include/topology.h

For how the SKL platform driver loads the toplogy binary file, please see the kernel src code: sound/soc/intel/skylake/skl-topology.c, where snd_soc_tplg_component_load() is called to load the topology info and trigger ops binding in kernel.

Now the upstreamed topology code support: controls, widgets, routes and PCM (Front-ends DAI & DAI links).

And now we're upstreaming support for Back-end DAIs and BE links. This may be bring some ABI update and last for several weeks. You may try using topology atm, but you'll need to rebuild your topology binary info after the ABI update. I'll keep you updated when it's done.

If you have any further questions, please let us know.

Thanks
Mengdong

On 07/18/2016 03:19 PM, Takashi Sakamoto wrote:
Hi,

(C.C.ed to Intel developers, who committed to ALSA topology feature.)

On Jul 18 2016 14:07, 이경택 wrote:
At first, sorry about interrupting you and thank you for giving your
attention to an email from stranger.

No worry.

I'm a software engineer in Samsung and writing a device driver for
our audio.

In recent kernel source code(version 4.4), I found out there is a new
feature called topology.

I thought that it is a framework for seperating data and logic of audio
drivers,

so I wanted to write my driver on that framework.

But, it is hard to find out a starting point. (example, documentation,
......)

If you give me an starting point, it would be very helpful to me.

The feature of 'topology' was originally developed by Intel developers.
So I think it better to ask your questions to them.


As long as I know, the original goal of this feature is to write
parsable blobs for new HDA driver to PCH in Skylake architecture
(Skylake, Kabylake, etc).

The new HDA driver (snd-soc-skl) doesn't directly enumerate widgets in
HDA codecs at all. Instead, the parsable blob represents the codec
internal. As a result of parsing the blob, some control elements, some
DAI links and so on are added. When you're interested in the functions
to add them, please start at soc_tplg_load_header().
http://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/tree/sound/soc/soc-topology.c#n1772

In kernel driver side, the blobs are loaded by usual way;
request_firmware().
https://www.kernel.org/doc/Documentation/firmware_class/README

Then, each kernel drivers parse the image by snd_soc_tplg_component_load().
http://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/tree/sound/soc/soc-topology.c#n1864

Of cource, you need to put the blobs to typical file path; /lib/firmware.


When writing files to generate the blob, you need to check two items;
one is UAPI of ASoC (include/uapi/sound/asoc.h) and another is runtime
configuration of ALSA userspace library.

What you can do via topology feature is defined in the UAPI header. The
way to describe them to files is the same way as runtime configuration
of ALSA userspace library.
http://www.alsa-project.org/alsa-doc/alsa-lib/conf.html

When you write the files, you can generate the blobs by 'alsatplg' utils
in alsa-utils.git. I believe it can detect parse errors.
http://git.alsa-project.org/?p=alsa-utils.git;a=tree;f=topology

That's all of what I know. I hope this will help you or you can get
enough support about the new feature from Intel developers.

p.s. I'm committing to ALSA in my private time, so I sometimes need to
stop discussions because of my limited time. I'm not a developer belongs
to semi-conductors or hardware vendors and have paid work for my life.


Regards

Takashi Sakamoto

_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel




[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux