Skip to content

[RFC] add TGL 1ch and 8ch nocodec tplg - #2121

Closed
xiulipan wants to merge 2 commits into
thesofproject:masterfrom
xiulipan:pr/tgl18ch
Closed

[RFC] add TGL 1ch and 8ch nocodec tplg#2121
xiulipan wants to merge 2 commits into
thesofproject:masterfrom
xiulipan:pr/tgl18ch

Conversation

@xiulipan

Copy link
Copy Markdown
Contributor

Add 1ch and 8ch nocodec tplg for test.
Find an issue with PCM_CAPABILITIES about restrict min channel to 2.

test nocodec topology for 1-ch and 8-ch.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
If do not strict channel, the playback will try to always use 2 channel as min channel.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
@xiulipan

Copy link
Copy Markdown
Contributor Author

Issue with channel detail:

2ch file will map to 2 ch and failed, no error in error trace

aplay log and error logger
$ aplay -Dhw:0,2 -c 8 -r 48000 -f s16_le -t raw doreimi-48k-s16le-stereo.wav -vvv --dump-hw-params
Playing WAVE 'doreimi-48k-s16le-stereo.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo
HW Params of device "hw:0,2":
--------------------
ACCESS:  MMAP_INTERLEAVED RW_INTERLEAVED
FORMAT:  S16_LE S24_LE S32_LE
SUBFORMAT:  STD
SAMPLE_BITS: [16 32]
FRAME_BITS: [32 256]
CHANNELS: [2 8]
RATE: 48000
PERIOD_TIME: [125 85000]
PERIOD_SIZE: [6 4080]
PERIOD_BYTES: [192 16320]
PERIODS: [2 16]
BUFFER_TIME: [250 341000]
BUFFER_SIZE: [12 16368]
BUFFER_BYTES: [192 65472]
TICK_TIME: ALL
--------------------
Hardware PCM card 0 'sof-nocodec' device 2 subdevice 0
Its setup is:
  stream       : PLAYBACK
  access       : RW_INTERLEAVED
  format       : S16_LE
  subformat    : STD
  channels     : 2
  rate         : 48000
  exact rate   : 48000 (48000/1)
  msbits       : 16
  buffer_size  : 16368
  period_size  : 4080
  period_time  : 85000
  tstamp_mode  : NONE
  tstamp_type  : MONOTONIC
  period_step  : 1
  avail_min    : 4080
  period_event : 0
  start_threshold  : 16368
  stop_threshold   : 16368
  silence_threshold: 0
  silence_size : 0
  boundary     : 9214364837600034816
  appl_ptr     : 0
  hw_ptr       : 0
Max peak (8160 samples): 0x00000007 #                    0%
Max peak (8160 samples): 0x00000007 #                    0%
Max peak (8160 samples): 0x00000009 #                    0%
Max peak (8160 samples): 0x00000008 #                    0%
Max peak (96 samples): 0x00000005 #                    0%
Max peak (1728 samples): 0x00000009 #                    0%
aplay: pcm_write:2011: write error: Input/output error
sudo ./sof-logger -l sof-tgl.ldc -e
 CORE  LEVEL      COMP_ID                TIMESTAMP            DELTA                FILE_NAME    CONTENT
    0      1           SA         4716159095.989584              nan      src/lib/agent.c:57    validate(), ll drift detected, delta = 41554

/dev/zero map to 8 ch

aplay work
$ aplay -Dhw:0,2 -c 8 -r 48000 -f s16_le /dev/zero -vvv
Playing raw data '/dev/zero' : Signed 16 bit Little Endian, Rate 48000 Hz, Channels 8
Hardware PCM card 0 'sof-nocodec' device 2 subdevice 0
Its setup is:
  stream       : PLAYBACK
  access       : RW_INTERLEAVED
  format       : S16_LE
  subformat    : STD
  channels     : 8
  rate         : 48000
  exact rate   : 48000 (48000/1)
  msbits       : 16
  buffer_size  : 4092
  period_size  : 1020
  period_time  : 21250
  tstamp_mode  : NONE
  tstamp_type  : MONOTONIC
  period_step  : 1
  avail_min    : 1020
  period_event : 0
  start_threshold  : 4092
  stop_threshold   : 4092
  silence_threshold: 0
  silence_size : 0
  boundary     : 9214364837600034816
  appl_ptr     : 0
  hw_ptr       : 0

It seems the 8 ch pipeline can not work with 2 ch from host.
@lrgirdwo @plbossart @ranj063 @tlauda
What do you think here? Do we support channel convention in FW pipeline?
If yes, are we facing a topology issue or FW issue?

@lgirdwood

Copy link
Copy Markdown
Member

@xiulipan I would expect our (upto) 8chn pipeline to switch to 2chan mode when asked by the host. However, it may be the pipeline/component is taking min/max channels as 8 instead of min 2 and max 8 channels. Best to check. Please rule out topology and kconfig first (as kconfig now has max channel option)

# 48000, 48000, 48000)

# Low Latency capture pipeline 2 on PCM 0 using max 2 channels of s16le.
# Schedule 48 frames per 1000us deadline on core 0 with priority 0

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you fix all comments to describe support for 8 channels? It's all 'max 2 channels of s16le'

# 1000, 0, 0,
# 48000, 48000, 48000)

# Low Latency playback pipeline 5 on PCM 2 using max 2 channels of s16le.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

max 8 of S16le

# TGL Host GW DMAC support max 6 playback and max 6 capture channels so some
# pipelines/PCMs/DAIs are commented out to keep within HW bounds. If these
# are needed then they can be used provided other PCMs/pipelines/SSPs are
# commented out in their place.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is really awful to review. You should use one file and macros to select the configuration you want.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xiulipan also commented out code doesn't get compiled. So, if possible, better make this compile-time selectable without the need to edit. Then it can also be included in CI.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would also include a commen here that multi DAI config is blocking on certain features being implemented (and link to the features).

@xiulipan

xiulipan commented Dec 5, 2019

Copy link
Copy Markdown
Contributor Author

@plbossart @lyakh I agreed that this PR is ugly. But what I want is to have some discuss about if we can support 1-ch to 8-ch in one tplg?
If so how do we write the tplg?
Do we need other patches for Kernel or FW.

@plbossart

Copy link
Copy Markdown
Member

@plbossart @lyakh I agreed that this PR is ugly. But what I want is to have some discuss about if we can support 1-ch to 8-ch in one tplg?
If so how do we write the tplg?
Do we need other patches for Kernel or FW.

use -DNUM_CH=1 or 8 and conditional code.
see e.g. how it's done for byt-codec.m4 when the SSP_NUM is changed.

you only need to test and generate two files from the same .m4 file.

#DAI_ADD(sof/pipe-dai-capture.m4,
# 4, SSP, 1, NoCodec-1,
# PIPELINE_SINK_4, 2, s16le,
# 1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should really be using multi DAI config. i.e. we load all the different SSP configs and select at runtime. However, I'm fine if this is commented out providing there is a big comment explaining this.

DAI_ADD(sof/pipe-dai-capture.m4,
6, SSP, 2, NoCodec-2,
PIPELINE_SINK_6, 2, s16le,
1000, 0, 0, SCHEDULE_TIME_DOMAIN_TIMER)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This goes upto 6 chans, where are 7 and 8. To be honest, you could probably drop support for 3,5 and 7 in this as I dont think there are any use cases unless I'm mistaken.

# TGL Host GW DMAC support max 6 playback and max 6 capture channels so some
# pipelines/PCMs/DAIs are commented out to keep within HW bounds. If these
# are needed then they can be used provided other PCMs/pipelines/SSPs are
# commented out in their place.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would also include a commen here that multi DAI config is blocking on certain features being implemented (and link to the features).

#PCM_DUPLEX_ADD(Port1, 1, PIPELINE_PCM_3, PIPELINE_PCM_4)
PCM_DUPLEX_ADD(Port2, 2, PIPELINE_PCM_5, PIPELINE_PCM_6)
# PCM_CAPTURE_ADD(DMIC01, 6, PIPELINE_PCM_13)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably confusing here for users to uncomment the correct PCM/DAI config. Could the PCM s be next to there DAI_ADD so it's easy to uncomment the correct items when changing mode.

@lgirdwood

Copy link
Copy Markdown
Member

@xiulipan any update ? I've marked for v1.6

@lgirdwood lgirdwood added this to the v1.6 milestone Jan 6, 2020
@zrombel

zrombel commented Jan 24, 2020

Copy link
Copy Markdown

Due to merge of PR#2303 this PR must be rebased or test results for KD tests with audio format 24b/32b ignored.

@lgirdwood

Copy link
Copy Markdown
Member

SOFCI TEST

@zrombel

zrombel commented May 28, 2020

Copy link
Copy Markdown

Please rebase for Python tests to pass.

@lgirdwood

Copy link
Copy Markdown
Member

@xiulipan any update ?

@lgirdwood

Copy link
Copy Markdown
Member

@xiulipan ping. Moved to v1.7

@lgirdwood lgirdwood modified the milestones: v1.6, v1.7 Sep 17, 2020
@xiulipan

Copy link
Copy Markdown
Contributor Author

@mengdonglin @lgirdwood Do we still need 1 and 8 channel test topology for TGL?

@lgirdwood

Copy link
Copy Markdown
Member

@xiulipan lets close, we can always revisist if this is needed for test but it doesn't look like it today.

@lgirdwood lgirdwood closed this Jan 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants