You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG]DEMUX comp not work normally with channel 4 to 2 with format conversion #2533
Also test with #2525 on TGL
wav files attached
2ch_0312_04.wav test on APL with DEMUX and 32le-2ch-sin-100-200hz.wav
4ch_0312_01.wav test on TGL with DEMUX and 32le-8ch-sin-100-800hz.wav
8ch_0312_02.wav test on TGL with DEMUX and 32le-8ch-sin-100-800hz.wav
8ch_0312_03.wav test on TGL with nocodec loopback and 32le-8ch-sin-100-800hz.wav demux_test.zip
@ClarexZhou Could you try to use the sof-apl-demux-pcm512x.tplg on an UP2 to check if the output from codec also have noise?
@lgirdwood ok, it is now very clear what you want, thanks. I've been little bit hesitant to work on the demux on fw side (as it is not done by me), but I'll see what I can do. I'll make some RFC PR suggestions about the structs and topology.
@juimonen thanks - if we look at the config structures used by the binary kcontrol (Ive added comments inline)
structmux_stream_data {
uint32_tpipeline_id;
uint8_tnum_channels;
uint8_tmask[PLATFORM_MAX_CHANNELS];
uint8_treserved[(20-PLATFORM_MAX_CHANNELS-1) % 4]; // padding to ensure proper alignment of following instances
};
structsof_mux_config {
uint16_tframe_format; /* not sure why needed - come from hw_params */uint16_tnum_channels; /* diito, from hw_params */uint16_tnum_streams; /* unclear if this is source or sink or total */uint16_treserved; // padding to ensure proper alignmentstructmux_stream_datastreams[];
};
They need documented for sure alongside the mux code that sets the data.
We either need to represent a mux (N streams -> 1 stream) or a demux (1 stream -> N streams).
For every MUX and DEMUX output channel we create an enum kcontrol that contains all possible input stream channel choices. i.e. pipeline1 left, pipeline 1 right, pipeline 2 left, pipeline 2 right and so on
The enum will only permit 1:1 mapping between. i.e. we cannot mix channels
Channel duplication is allowed i.e. we can route input pipeline1 left to more than 1 output channel.
topology should only create the minimum enums required based on actual channels/streams and not pre-defined max channels and streams.
MUX will create a small number of large enums whilst DEMUX will create a larger number of small enums.
@lgirdwood Do you mean that we need a refine for MUX/DEMUX? I agree that the binary blob is very hard to understand and config. But how long would this take?
@juimonen Do you have any idea why we got this issue with following binary blob?
@xiulipan demux has never worked perfectly. The first version we did was only working with branched demux pipe directly connected to scheduler (pcm) i.e. you could not add any components to branched pipeline. This was because our fw scheduling didn't support this kind of pipe.
So I only recently tried to change the interface to use tokens and faced the same situation as you, so idisp id's we're wrong and the whole topology didn't load. I did not test it further, I just wanted to get to tokens (so loading). if you want to play with the blob, check #2536, there are examples for demux with -h option.
I'll try the demux myself, but I'm little bit in "slow mode" now as I'm working from home.
@lgirdwood Do you mean that we need a refine for MUX/DEMUX? I agree that the binary blob is very hard to understand and config. But how long would this take?
Yes, we only refine the topology so that we create enum kcontrols instead of this undecipherable blob. The ABI between FW and kernel remains the same.The FW will still support the blob method, but should also be able to use the enums.
Kernel needs some helper functions to store a local blob for each mux/demux component in topology. It then allows the enum kcontrol to change the internal blobs before updating FW.
FW - may not need any update
Topology needs new macros for constructing enum text arrays and attaching to demux/mux components.
@juimonen Ack, demux topology doesn't work with today's FW master. I tried going back to 1.4.2 and there it still works as expected. So something has broke.
@juimonen Ack, demux topology doesn't work with today's FW master. I tried going back to 1.4.2 and there it still works as expected. So something has broke.
Tested it with latest sof-dev (commit:fce7f93) + master (commit: d7ad0c1), issue can still be reproduced on APL-UP2-PCM512X.
tplg: same as fw branch: rename sof-apl-demux-pcm512x.tplg to sof-apl-pcm512x.tplg
changed the title [-][BUG] DEMUX comp not work normally with channel 4 to 2 mapping.[/-][+][BUG]DEMUX comp not work normally with channel 4 to 2 with format conversion[/+]on May 20, 2020
Activity
xiulipan commentedon Mar 12, 2020
Also test with #2525 on TGL
wav files attached
2ch_0312_04.wav test on APL with DEMUX and 32le-2ch-sin-100-200hz.wav
4ch_0312_01.wav test on TGL with DEMUX and 32le-8ch-sin-100-800hz.wav
8ch_0312_02.wav test on TGL with DEMUX and 32le-8ch-sin-100-800hz.wav
8ch_0312_03.wav test on TGL with nocodec loopback and 32le-8ch-sin-100-800hz.wav
demux_test.zip
@ClarexZhou Could you try to use the sof-apl-demux-pcm512x.tplg on an UP2 to check if the output from codec also have noise?
dengyangchao commentedon Mar 12, 2020
@xiulipan Applied #2524 and rename sof-apl-demux-pcm512x.tplg to sof-apl-pcm512x.tplg on platform APL-UP2-PCM512X. Then tried below scenarios:
Seems different with yours, did i do something wrong here?
dmesg.log
amixer.txt
xiulipan commentedon Mar 12, 2020
@dengyangchao Interesting. I only care about the 0,0 headset codec output. Can you check amixer setting with normal UP2 PCM512X.
lgirdwood commentedon Mar 12, 2020
I would like to see demux/mux fixed to remove the binary blobs. this is related to poor understaning and usage complexity. @juimonen fyi.
juimonen commentedon Mar 12, 2020
@lgirdwood ok, it is now very clear what you want, thanks. I've been little bit hesitant to work on the demux on fw side (as it is not done by me), but I'll see what I can do. I'll make some RFC PR suggestions about the structs and topology.
lgirdwood commentedon Mar 12, 2020
@juimonen thanks - if we look at the config structures used by the binary kcontrol (Ive added comments inline)
They need documented for sure alongside the mux code that sets the data.
We either need to represent a mux (N streams -> 1 stream) or a demux (1 stream -> N streams).
xiulipan commentedon Mar 13, 2020
@lgirdwood Do you mean that we need a refine for MUX/DEMUX? I agree that the binary blob is very hard to understand and config. But how long would this take?
@juimonen Do you have any idea why we got this issue with following binary blob?
sof/tools/topology/m4/demux_coef_default.m4
Lines 1 to 11 in 366aa67
It should work with the sof-apl-demux-pcm512x.tplg but I think we may got some issue with the total copy function.
juimonen commentedon Mar 13, 2020
@xiulipan demux has never worked perfectly. The first version we did was only working with branched demux pipe directly connected to scheduler (pcm) i.e. you could not add any components to branched pipeline. This was because our fw scheduling didn't support this kind of pipe.
So I only recently tried to change the interface to use tokens and faced the same situation as you, so idisp id's we're wrong and the whole topology didn't load. I did not test it further, I just wanted to get to tokens (so loading). if you want to play with the blob, check #2536, there are examples for demux with -h option.
I'll try the demux myself, but I'm little bit in "slow mode" now as I'm working from home.
lgirdwood commentedon Mar 13, 2020
Yes, we only refine the topology so that we create enum kcontrols instead of this undecipherable blob. The ABI between FW and kernel remains the same.The FW will still support the blob method, but should also be able to use the enums.
tlauda commentedon Mar 16, 2020
@xiulipan What is the final statement? I'm not sure whether it's worth looking into or maybe your configuration is wrong?
xiulipan commentedon Mar 17, 2020
@tlauda Still testing, not sure if it is some configure issue or comp issue.
25 remaining items
juimonen commentedon Apr 1, 2020
and yes sorry I had my up2 dusting for a while, so no idea what he old firmware was. I was updating everything to latest and greatest.
kv2019i commentedon Apr 1, 2020
@juimonen Ack, demux topology doesn't work with today's FW master. I tried going back to 1.4.2 and there it still works as expected. So something has broke.
lgirdwood commentedon Apr 1, 2020
See #2687 lets simplify.
keyonjie commentedon Apr 3, 2020
@juimonen @kv2019i can you try the latest master as @akloniex 's #2600 was merged yesterday?
YvonneYang2 commentedon Apr 3, 2020
Tested it with latest sof-dev (commit:fce7f93) + master (commit: d7ad0c1), issue can still be reproduced on APL-UP2-PCM512X.
tplg: same as fw branch: rename sof-apl-demux-pcm512x.tplg to sof-apl-pcm512x.tplg
Reproduce steps:
Screenshot:

wav_files_and_demsg_sof_trace.zip
slawblauciak commentedon Apr 28, 2020
@akloniex mind taking a look at it?
juimonen commentedon Apr 29, 2020
latest firmware af38b20 and latest topology sof-apl-demux-pcm512x.tplg I can get proper sound from echoref pipe!
terminal 1:
aplay test_play.wav
Terminal 2:
arecord -Dhw:0,4 -f S16_LE -c 2 -r 48000 -d 10 test.wav
So maybe someone else can also verify?
juimonen commentedon Apr 30, 2020
@akloniex any idea why we didn't use the "caps" in ipc_buffer for underrun/overrun flags and defined new flags?
struct sof_ipc_buffer {
struct sof_ipc_comp comp;
uint32_t size; /< buffer size in bytes */
uint32_t caps; /< SOF_MEM_CAPS_ */
uint32_t flags; /**< SOF_BUF_ flags defined above */
I think it is also 32bit bit value which is using only couple of bits for memory related flags...
[-][BUG] DEMUX comp not work normally[/-][+][BUG] DEMUX comp not work normally with channel 4 to 2 mapping.[/+][-][BUG] DEMUX comp not work normally with channel 4 to 2 mapping.[/-][+][BUG]DEMUX comp not work normally with channel 4 to 2 with format conversion[/+]xiulipan commentedon May 20, 2020
Move to new #2959 with new test and new issue.