-
Notifications
You must be signed in to change notification settings - Fork 5.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Kernel 6.6.y and DAC Allo Piano 2.1+Kali fails init #6527
Comments
The last working kernel version was 6.1.y. |
517 is EPROBEDEFER, which means "not yet" - the kernel will try again later. It's nice if drivers suppress those error messages as they can be confusing, but otherwise I don['t see anything wrong there. The stall is probably caused by something failing to release a mutex. Like most of the drivers we host in our kernel, we can't offer any support for them unless they reveal an underlying problem in the bits we do maintain. Our involvement consists of forward-porting the patches to new kernel versions, which is basically just a matter of getting them to compile again when the APIs change. Allo seems to be long gone - your best hope would be that one of the users out there has some coding experience. Even a relative novice could learn quite a bit about the problem by scattering a few pr_info() calls around the driver. |
Thank you for looking into this. Appreciated. Being a "novice" as you mention I can dive into the module, however will need a bit of guidance: mutex. What troubleshooting steps or actions would you suggest? |
Here's a rough plan of action:
|
Thank you for the steps. This round, the module was built against "stock" Pi kernel - 6.6.62-v7+ #1816 using cross-compiler. load dtoverlay -> http://paste.debian.net/1339146/ I would expect a bit more output at this time, however the test was on Pi 3B+, moving to Pi5 or CM5 to speed-up the native build work. |
Stock kernel: dmesg -l err,warn
There are no new messages from test other than |
Kernel from repo: dmesg -l err,warn
Same behaviour as before. |
Odd. Can you put another pr_err (any message you like) before the "return 0;" at the end of snd_allo_piano_dac_probe? That should confirm whether the driver initialisation is completing or not. |
Kernel with updated module: dmesg -l err,warn
Same behaviour as before. |
Result: https://paste.debian.net/hidden/0aaf8bb3/ Looks like it does. |
(I'll take your word that there is no change - you don't need to upload the logs each time) |
|
Nothing, just empty:
|
It doesn't. |
This is getting interesting - https://paste.debian.net/hidden/168f11aa/ Purely boot only, nothing touched... yet. |
Well that's a bit of a relief - I was beginning to wonder how you could be getting so far if the probe() had never succeeded. |
The fact it is still deferred would be listed, just not what the dependency was. |
Honestly, I'm scratching my head for past two weeks, doubting my sanity with this. |
It seems unlikely, since it only provides a static configuration - by the time you've exited the probe function, the overlay plays no further part. |
To add to the confusion, when using basic overlay: allo-piano-dac-pcm512x-audio the DAC works with limited functionality. This bypasses all channels separation 2xPCM, lowpass, etc. |
Are you seeing any of my debug output when you use the controls? If not, which controls are available to you in this subset? |
I think I made my last remark confusing.
Will add debug params to |
The Comparing with working DAC on kernel 6.1.y, the node |
A simple test, forcing bogus return 0; from snd_allo_piano_dac_probe and it is clear that all the params are not available to alsa. There is literally nothing in dmesg nor journalctl to follow up on. Any ideas? |
Hey @pelwell, This is getting interesting. After adding #include <linux/i2c.h> all of the sudden:
|
The output here (https://paste.debian.net/hidden/168f11aa/) showed it reaching the end of snd_allo_piano_dac_probe ("DAC issue #6527"), so why do you need to force it? And what changed between that run and the previous one (that produced much less output), other than the addition of the "DAC probe begin" message? |
The only differences at this point were:
|
Your log above shows the output from snd_allo_piano_dual_mode_put, turning dual_mode off. Do any other controls exist/work? |
The amixer is used to set specific hwdevice with params. However, module once loaded renders alsa completely unresponsive and console hungs. No other controls are available. The continuous message |
Well, the DAC init is stuck here, indefinite loop:
I think without addressing this part, we can't progress further. |
Thank you for looking into this. If you can spare a bit of time, and take a look into the last week discussions in community thread. dmesg:
|
Calling snd_soc_limit_volume from within a kcontrol put handler seems to cause a deadlock as it attempts to claim a write lock that is already held. Call snd_soc_limit_volume from the main initialisation code instead, to avoid the recursive locking. See: #6527 Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Calling snd_soc_limit_volume from within a kcontrol put handler seems to cause a deadlock as it attempts to claim a write lock that is already held. Call snd_soc_limit_volume from the main initialisation code instead, to avoid the recursive locking. See: #6527 Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Calling snd_soc_limit_volume from within a kcontrol put handler seems to cause a deadlock as it attempts to claim a write lock that is already held. Call snd_soc_limit_volume from the main initialisation code instead, to avoid the recursive locking. See: #6527 Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Hey @pelwell, Let me know, which version/combination I can help testing. I still have the debug build from our initial investigation. Something I have not noticed before:
Regarding audio stage itself, it is over-amplified. Raspberry Pi 4B, Pi5 2/4/8GB with the same results. |
Hey @pelwell, Question regarding snd_allo_piano_dac_init linux/sound/soc/bcm/allo-piano-dac-plus.c Line 735 in 7a4972f
In 6.1 this is controlled by linux/sound/soc/bcm/allo-piano-dac-plus.c Line 451 in fbd8b3f
linux/sound/soc/bcm/allo-piano-dac-plus.c Line 561 in fbd8b3f
|
Perhaps move to linux/sound/soc/bcm/allo-piano-dac-plus.c Line 722 in 7a4972f
int i, j, ret = 0; would make sense? Comparing with other dacs, the struct snd_soc_card *card = rtd->card; is part of if (digital_gain_0db_limit) {} . In piano case, it is directly under snd_soc_pcm_runtime .
|
Another place I am looking at do bolt on
|
The same system, only kernel is different. From amixer -c<num> scontents there is clear evidence that the digital_gain_0db_limit is ineffective and range 0 -> 255 is always set in kernel 6.6.y.
|
The variable is initialised on the very next (non-blank) line. This isn't the cause of the problem.
I don't understand what you mean. I'm back looking at this issue (it would be nice to be rid of it). It seems likely that my initial uneasiness ("I'm not sure if the code was arranged as it was for good reasons or just carelessness.") may have been justified. |
Sometimes it is possible to nudge with an overlay parameters. Ignore this please, makes no effect. I can share module code via Pastezone if this helps. |
Thanks, but that won't be necessary - it's completely reproducible here. |
Controls which only exist when snd_soc_register_card returns can't be modified before then. Move the setting of volume limits to just before the end of the probe function. Link: raspberrypi#6527 Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Hey @pelwell , Excellent result. No distortion, no dmesg errors. Kernel 6.6.y amixer -c0 scontents: http://paste.debian.net/1344094/ I will test with 24db_digital_gain and glb_mclk in dtoverlay, just to check if gain and Kali still works. |
Hey @pelwell,
All checks out. |
And that's with all three patches applied? |
All three. Code with extra traces (will remove in final build) here: https://dpaste.com/AYHDNNBNL |
Controls which only exist when snd_soc_register_card returns can't be modified before then. Move the setting of volume limits to just before the end of the probe function. Link: #6527 Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Thanks - that's merged now. |
Thank you. Will trigger community build and get this tested. Perhaps let's leave this open for a day or two, test results pending. |
Controls which only exist when snd_soc_register_card returns can't be modified before then. Move the setting of volume limits to just before the end of the probe function. Link: #6527 Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Controls which only exist when snd_soc_register_card returns can't be modified before then. Move the setting of volume limits to just before the end of the probe function. Link: #6527 Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Calling snd_soc_limit_volume from within a kcontrol put handler seems to cause a deadlock as it attempts to claim a write lock that is already held. Call snd_soc_limit_volume from the main initialisation code instead, to avoid the recursive locking. See: #6527 Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Controls which only exist when snd_soc_register_card returns can't be modified before then. Move the setting of volume limits to just before the end of the probe function. Link: #6527 Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Based on community feedback, closing as resolved. |
Calling snd_soc_limit_volume from within a kcontrol put handler seems to cause a deadlock as it attempts to claim a write lock that is already held. Call snd_soc_limit_volume from the main initialisation code instead, to avoid the recursive locking. See: #6527 Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Controls which only exist when snd_soc_register_card returns can't be modified before then. Move the setting of volume limits to just before the end of the probe function. Link: #6527 Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Describe the bug
It seems that sound/soc/bcm/allo-piano-dac-plus.c is not parsing parameters for alsa use. What I can observe is that the dtoverlay partly fails register the card:
However module somewhat loads:
ls -la /sys/module/snd_soc_allo_piano_dac_plus/
Simple test with alsa-info shows that the expected DAC's control parameters are missing:
In addition, there seems to be a deadlock after module load preventing init level change.
Steps to reproduce the behaviour
Load overlay with config.txt:
Load manually:
sudo dtoveraly allo-piano-dac-plus-pcm512x-audio
Device (s)
Raspberry Pi 3 Mod. B+, Raspberry Pi 4 Mod. B, Raspberry Pi 400, Raspberry Pi 5, Raspberry Pi CM4, Raspberry Pi CM4 Lite, Other
System
cat /etc/rpi-issue
vcgencmd version
uname -a
Linux bookworm 6.6.62+rpt-rpi-v8 #1 SMP PREEMPT Debian 1:6.6.62-1+rpt1 (2024-11-25) aarch64 GNU/Linux
Logs
dmesg shows continuously:
Additional context
No response
The text was updated successfully, but these errors were encountered: