Skip to content

[BUG] topology1 build broken #5039

@yongzhi1

Description

@yongzhi1

With alsa-project/alsa-lib#187 merged on alsa-lib, the topology build was broken for two cases:

  1. safe_strtol_base() returns error due to null input string:

In the following example, "base" field of C_CONTROLBYTES is NULL, so it returns:

[  0%] Built target abi_v1
[  0%] Generating sof-tgl-max98373-rt5682-xperi.conf
[  0%] Generating sof-tgl-max98373-rt5682-xperi.tplg
ALSA lib parser.c:231:(tplg_load_config) failed to parse topology
Unable to load configuration: Invalid argument
make[2]: *** [topology/topology1/CMakeFiles/topology1_sof-tgl-max98373-rt5682-xperi.dir/build.make:61: topology/topology1/sof-tgl-max98373-rt5682-xperi.tplg] Error 1
make[1]: *** [CMakeFiles/Makefile2:5109: topology/topology1/CMakeFiles/topology1_sof-tgl-max98373-rt5682-xperi.dir/all] Error 2
make: *** [Makefile:130: all] Error 2
# Smart_amp Bytes control for config
SectionControlBytes."Smart_amp Config" {

	# control belongs to this index group
	index "1"

	# control uses bespoke driver get/put/info ID for io ops
	ops."ctl" {
		info "bytes"
		#258 binds the mixer control to bytes get/put handlers
	}
	# control uses bespoke driver get/put/info ID for ext ops
	extops."extctl" {
		#258 binds the mixer control to bytes get/put handlers
		get "258"
		put "258"
	}

	base ""
	num_regs ""
	mask ""
	#
	max "304"
	
	access [
		tlv_write
		tlv_read
		tlv_callback
	]
	data [
		SMART_AMP_priv
	]
}

  1. safe_strtol_base() returns error due to non-NULL endptr, this happened in demux_priv_1 due to spaces followed the last number 0x00 in the array:
SectionData."demux_priv_1" {
bytes "0x53,0x4f,0x46,0x00,0x00,0x00,0x00,0x00,
	0x28,0x00,0x00,0x00,0x00,0x40,0x01,0x03,
	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
	0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,
	0x01,0x00,0x00,0x00,0x00,0x01,0x02,0x04,
	0x08,0x10,0x20,0x40,0x80,0x00,0x00,0x00,
	0x09,0x00,0x00,0x00,0x00,0x01,0x02,0x04,
	0x08,0x10,0x20,0x40,0x80,0x00,0x00,0x00
	"
	}

Metadata

Metadata

Assignees

No one assigned

    Labels

    alsa-libIssues caused by alsa-libbugSomething isn't working as expectedtopologyTopology issues

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions