Hi ADI,
we using ssm4567 on linux 3.10, while driver init, write soft_reset(0xff) to 0, return error code -5. other register can read write ok. what's the problem?
attach debug log
[edited by: sarvdo at 1:43 AM (GMT -5) on 10 Nov 2021]
Hi ADI,
we using ssm4567 on linux 3.10, while driver init, write soft_reset(0xff) to 0, return error code -5. other register can read write ok. what's the problem?
Hi ADI,
we using ssm4567 on allwinner A40i platform(Linux 3.10).i2c(0x34) interface can detect and read register value as following,but while insmod the codec driver module which got from github.com,…
Hi,
Sorry but I missed the link to wiki page for amixer. You can find it here: Linux Sound Driver [Analog Devices Wiki]
Unfortunately we don't support that "tinyalsa" lib so you have to figure out by yourself…
if we using alsamix, (not tinymix) pls list the setting cmd.
the driver is download from your web site........
Hi Dave Thib # echo -n "file soc-core.c +p" >/sys/kernel/debug/dynamic_debug/control # insmod /lib/modules/3.10.65/snd-soc-ssm4567.ko # insmod /lib/modules/3.10.65/snd-soc-ssm4567-i2c.ko [ 685.418075] ssm4567 4-0034: probe [ 685.422026] ssm4567 4-0034: Error in caching of register: f890 ret: -5 [ 685.429207] ssm4567 4-0034: codec register 4-0034 [ 685.434634] ssm4567 4-0034: ASoC: dai register 4-0034 #1 [ 685.440578] ssm4567 4-0034: ASoC: Mapped DAI ssm4567-hifi to CODEC ssm4567.4-0034 [ 685.448784] ssm4567 4-0034: ASoC: Registered DAI 'ssm4567-hifi' [ 685.455531] ssm4567 4-0034: ASoC: Registered codec 'ssm4567.4-0034' [ 685.462694] i2c-core: driver [ssm4567] registered the addr of soft_reset in the spec of ssm4567 is 0xFF, not 0xF890, Thanks.
Hi,
Change soft_reset to 0xF890 still has error. the addr of soft_reset in the spec of ssm4567 is 0xFF, not 0xF890, Thanks.
# mount -t debugfs none /sys/kernel/debug/
# echo -n "file soc-core.c +p" >/sys/kernel/debug/dynamic_debug/control
# insmod /lib/modules/3.10.65/snd-soc-ssm4567.ko
# insmod /lib/modules/3.10.65/snd-soc-ssm4567-i2c.ko
[ 58.767379] ssm4567 4-0034: probe
[ 58.771305] ssm4567 4-0034: Error in caching of register: ff ret: -5
[ 58.778253] ssm4567 4-0034: codec register 4-0034
[ 58.783631] ssm4567 4-0034: ASoC: dai register 4-0034 #1
[ 58.789440] ssm4567 4-0034: ASoC: Mapped DAI ssm4567-hifi to CODEC ssm4567.4-0034
[ 58.797928] ssm4567 4-0034: ASoC: Registered DAI 'ssm4567-hifi'
[ 58.804613] ssm4567 4-0034: ASoC: Registered codec 'ssm4567.4-0034'
[ 58.811792] i2c-core: driver [ssm4567] registered
[ 58.812103] snddaudio0 sound.4: ASoC: binding sysvoice at idx 0
[ 58.812388] ssm4567 4-0034: read 0 => 81
[ 58.812454] snddaudio0 sound.4: ASoC: probe snddaudio0 dai link 0 late -2
[ 58.812460] snddaudio0 sound.4: ASoC: probe snddaudio0 dai link 0 late -1
[ 58.812466] snddaudio0 sound.4: ASoC: probe snddaudio0 dai link 0 late 0
[ 58.812504] snddaudio0 sound.4: ASoC: probe snddaudio0 dai link 0 late 1
[ 58.812509] snddaudio0 sound.4: ASoC: probe snddaudio0 dai link 0 late 2
[ 58.812544] ssm4567 4-0034: read 0 => 81
[ 58.812558] ssm4567 4-0034: read 0 => 81
[ 58.812573] ssm4567 4-0034: read 0 => 81
[ 58.812595] ssm4567 4-0034: read 0 => 81
[ 58.812634] ssm4567 4-0034: read 0 => 81
[ 58.812764] i2c i2c-4: master_xfer[0] W, addr=0x34, len=2
[ 58.813182] i2c i2c-4: master_xfer[0] W, addr=0x34, len=2
[ 58.813481] i2c i2c-4: master_xfer[0] W, addr=0x34, len=2
# [ 58.907585] snddaudio0 sound.4: ssm4567-hifi <-> 1c22000.daudio mapping ok
Our Questions #2. how to config/ctrl the audio path let the speak play wav file by tinymix and aplay tools? Thanks. It's so urgent issue for us. Please help us on it. Thanks.
Mixer name: 'snddaudio0'
Number of controls: 10
ctl type num name value
0 BOOL 1 DAC High Pass Filter Switch On
1 BOOL 1 DAC Low Power Switch On
2 INT 1 Master Playback Volume 225
3 BOOL 1 Low-EMI Switch On
4 ENUM 1 Limiter Mode Enable Limiter
5 ENUM 1 Limiter Attack Rate 20 us/dB
6 ENUM 1 Limiter Release Rate 1600 ms/dB
7 ENUM 1 Limiter Attack Threshold 6.0Vp
8 ENUM 1 sunxi daudio audio hub mode hub_enable
9 BOOL 1 Amplifier Boost Switch On
Hello,
The SOFT_RESET register address is 0xFF not 0xF890.
This register is Write Once type. It will always read 0. It does not store its value. i.e. when you write 0 to this register it will issue a RESET to internal blocks and bring all the register values to default.
I assume the part when configured is working correctly and the issue is only related to read value of this register.
I do not see any value in reading this register 0xFF. Since you are getting error in the driver reading this register, is it possible for you to either ignore or remove the read for this register?
Regards
Rajeev
Hi,
First can you please point us to the source of the driver you use for ssm4567? I'm asking this because I see that you have kernel 3.10.65 but I was not able to find ssm4567 in the sources for that version and it looks like the driver was merged in upstream later. Did you backported it from a newer kernel version?
Related to the problems you're seeing:
The error "Error in caching of register: ff ret: -5" can be expected because register 0xFF is write only. I think in datasheet there is a mistake being marked R only. So when regmap framework tries to read that register in order to cache it is failing.
In 5.15 upstream the SSM4567_REG_SOFT_RESET register is not in readable_reg list so check to be the same on your version of the driver.
#2: For configuring I think the tool you want is amixer. It can list you all available controls and allows you to read the current state of a control and also set the state. We have a good wiki page for this topic here.
#3: If you want to just readback registers and check if what you set over amixer applied correctly to the chip I think you can leverage the Linux debugfs regmap interface.
Hi btogorean
Thanks.
#2 we has the tinymix already, we need tinymix cmds list to let the speak play wav audio.
Mixer name: 'snddaudio0'
Number of controls: 10
ctl type num name value
0 BOOL 1 DAC High Pass Filter Switch On
1 BOOL 1 DAC Low Power Switch On
2 INT 1 Master Playback Volume 225
3 BOOL 1 Low-EMI Switch On
4 ENUM 1 Limiter Mode Enable Limiter
5 ENUM 1 Limiter Attack Rate 20 us/dB
6 ENUM 1 Limiter Release Rate 1600 ms/dB
7 ENUM 1 Limiter Attack Threshold 6.0Vp
8 ENUM 1 sunxi daudio audio hub mode hub_enable
9 BOOL 1 Amplifier Boost Switch On
where is the wiki page for this topic?
#3. Could you confirm that the driver we porting is OK or NOT. we need to know wether it works well ok not.
the following log is right or wrong? or we need to check other item for confirm that the driver which we loaded is ok or not?
# mount -t debugfs none /sys/kernel/debug/
# echo -n "file soc-core.c +p" >/sys/kernel/debug/dynamic_debug/control
# insmod /lib/modules/3.10.65/snd-soc-ssm4567.ko
# insmod /lib/modules/3.10.65/snd-soc-ssm4567-i2c.ko
[ 58.767379] ssm4567 4-0034: probe
[ 58.771305] ssm4567 4-0034: Error in caching of register: ff ret: -5
[ 58.778253] ssm4567 4-0034: codec register 4-0034
[ 58.783631] ssm4567 4-0034: ASoC: dai register 4-0034 #1
[ 58.789440] ssm4567 4-0034: ASoC: Mapped DAI ssm4567-hifi to CODEC ssm4567.4-0034
[ 58.797928] ssm4567 4-0034: ASoC: Registered DAI 'ssm4567-hifi'
[ 58.804613] ssm4567 4-0034: ASoC: Registered codec 'ssm4567.4-0034'
[ 58.811792] i2c-core: driver [ssm4567] registered
[ 58.812103] snddaudio0 sound.4: ASoC: binding sysvoice at idx 0
[ 58.812388] ssm4567 4-0034: read 0 => 81
[ 58.812454] snddaudio0 sound.4: ASoC: probe snddaudio0 dai link 0 late -2
[ 58.812460] snddaudio0 sound.4: ASoC: probe snddaudio0 dai link 0 late -1
[ 58.812466] snddaudio0 sound.4: ASoC: probe snddaudio0 dai link 0 late 0
[ 58.812504] snddaudio0 sound.4: ASoC: probe snddaudio0 dai link 0 late 1
[ 58.812509] snddaudio0 sound.4: ASoC: probe snddaudio0 dai link 0 late 2
[ 58.812544] ssm4567 4-0034: read 0 => 81
[ 58.812558] ssm4567 4-0034: read 0 => 81
[ 58.812573] ssm4567 4-0034: read 0 => 81
[ 58.812595] ssm4567 4-0034: read 0 => 81
[ 58.812634] ssm4567 4-0034: read 0 => 81
[ 58.812764] i2c i2c-4: master_xfer[0] W, addr=0x34, len=2
[ 58.813182] i2c i2c-4: master_xfer[0] W, addr=0x34, len=2
[ 58.813481] i2c i2c-4: master_xfer[0] W, addr=0x34, len=2
# [ 58.907585] snddaudio0 sound.4: ssm4567-hifi <-> 1c22000.daudio mapping ok
Hi,
Sorry but I missed the link to wiki page for amixer. You can find it here: Linux Sound Driver [Analog Devices Wiki]
Unfortunately we don't support that "tinyalsa" lib so you have to figure out by yourself the adaptations ad commands you have to issue through "tinyalsa"
You ask if the driver you ported is ok but please provide its sources to be able to respond that. Otherwise we don't know what are you porting. DMESG looks fine. Did you probed the I2S lines? Is your CPU putting any data out?
SSM4567 is a single output channel (mono) part. That's why it has only one channel.
Hi,
Sorry but I missed the link to wiki page for amixer. You can find it here: Linux Sound Driver [Analog Devices Wiki]
Unfortunately we don't support that "tinyalsa" lib so you have to figure out by yourself the adaptations ad commands you have to issue through "tinyalsa"
You ask if the driver you ported is ok but please provide its sources to be able to respond that. Otherwise we don't know what are you porting. DMESG looks fine. Did you probed the I2S lines? Is your CPU putting any data out?
SSM4567 is a single output channel (mono) part. That's why it has only one channel.
I'm pretty sure that it is a mono part. In order to have stereo output you have to use two SSM4567 chips.
The register you are referring (0x04) is used to configure the serial audio interface to accept I2S stereo mode frames. SSM4567 can be used in configurations of up to 4 chips (Multichip I2S) or up to 8 chips (TDM) sharing the same audio serial bus. So you can send stereo I2S frames from host processor but you have to have connected two SSM4567 chips for stereo output and configure one of the chips to take its data from FSYNC low and the other from FSYNC high.
Also take care that the output of SSM4567 is created with an H bridge and that's why you have OUTN and OUTP. If you connected two loudspeakers with GND reference that's not how this part is designed to work!
Hi, I mean the right connection is the one showed in the datasheet with only one speaker connected to one SSM4567 part.
If you connect two speakers like bellow that's wrong. You can tell that even from sense lines because current through speaker connected to OUTN would not be monitored.