please help this noob understand how Linux drivers work

Sooo... i finally received the PCB for my project, and after soldering the connections and checking everything works, yesterday i started to play with i2c and the wm8805... no driver, just started playing with i2cset and i2cget etc. and the first unexpected surprise:
except registers 1 2 and 3 that provide the chip model and revision, the rest of the registers are at 00. No matter if i try to write to them with i2cset, nothing happens, everything stays always at 00, even though most of the registers have other values as default. i would think that there is a bad contact or a short, but the fact that the 3 first registers work ok makes me think it must be something i am missing.... any ideas?
thanks!!

this is what i2cdump shows:

1682017004258.png




1682016693636.png
 
  • Like
Reactions: 1 user
hm, might be that what i see is normal... not sure though:
according to the datasheet, all the registers except the 3 first and the satatus ones (11 to 17) are not readable... maybe that makes it appear as 00??
and the status ones, that refer mostly to signal reception status, even though some of them dont default to 0, maybe are not readable unless the chip is set up and acually receiving a signal??
To me, not readable and 0 value are different things, hence my confusion, but i dont know how these things normally behave...
 
yeah, it must be that. After setting it up properly, with the right pll parameters and all that, i have the wm8805 outputting sound and now some of the readable registers show some activity. I am so happy to have it working without even using the driver! now i just need to draft a python script with all the functions i was aiming for, it seems easier than i thought. Thanks for your help @phofman
Ah, one last question. I am using smbus2 package to control i2c from python. is this a good way to go or are there better ones? (it is my first time using something like this...) thanks!

1682103257771.png
 
Last edited:
@phofman , all, i am trying to find out how to be able to use the Audio Interface (that is, the i2s to spdif and spdif to i2s) of the wm8805 without using any driver or overlay.
Of course, my other audio software (camilladsp, squeezelite) expect a soundcard from the list of alsa soundcards, but without drivers, my wm8805 does not show up on the list.... How could i overcome this limitation? do you know about any examples or can you maybe indicate where to start searching....? i cannot find anything.... do i need to run a script from user space that does what the driver does or something similar?
thanks for any indication
 
You may not need a kernel ASoC codec driver for wm8805, if you can control it from userspace. But you need to configure and load the ASoC driver for the I2S controller - see https://www.diyaudio.com/community/...nd-how-linux-drivers-work.396428/post-7283105

hi,
just wanted to report back that i managed to have the soundcard working with the generic overlay you suggested as an alsa i2s > spdif device. It took me much longer than expected due to a few culprits and the complexity of finding the right settings for the 8805, but i need to say i am very happy with the result. i can switch sources, sample rates etc with both the soundcard and the spdif multiplexer with no audible gaps and no pops or noises whatsoever.

I basically have everything working now, only need to code the auto source select software, that will also be a bit more complex than expected as most of my sources lock the spdif all the time, my tv even when switched off! but i think i know how to sort it out...
thank you so much again for your help
 
  • Like
Reactions: 1 user
as a side note, i am surprised how sensitive is the i2s connection, at least with these chips. Only trying to read the lrclk pin to measure the actual sample rate makes all the connection go bad and i get noise from that moment on. I can live with that, but find it quite surprising.
 
您好,在我的 Raspberry Pi 上安装 PICOREPLAYER 并连接 TRAMSPORTPI 扩展板后,我在让 SQUEEZELITE 正常运行时遇到了一些问题。具体来说,当我尝试在 SQUEEZELITE 设置中将输出设备设置为 HIFIBerry DIGI+ Pro 时,它无法启动。我已经仔细检查了所有连接,甚至重新启动了连接,但问题仍然存在。是否有其他人遇到过类似的问题,或者对如何解决此问题有任何建议?任何帮助或建议将不胜感激。提前致谢!

Translated by Moderation:
Hi, after installing the PICOREPLAYER on my Raspberry Pi and connecting the TRANSPORTPI expansion board, I'm having some issues getting the SQUEEZELITE to run properly. Specifically, when I try to set the output device to a HIFIBerry DIGI+ Pro in the SQUEEZELITE settings, it fails to boot. I've double checked all connections and even restarted them but the problem persists. Has anyone else encountered a similar problem or have any suggestions on how to resolve this issue? Any help or advice would be greatly appreciated. Thanks in advance!

微信图片_20240327062525.png
 
Last edited by a moderator: