Re: No sound card on Olimex A20 SOM EVB with FreeBSD 12.4
- Reply: Jirka Novak : "Re: No sound card on Olimex A20 SOM EVB with FreeBSD 12.4"
- Reply: Jirka Novak : "Re: No sound card on Olimex A20 SOM EVB with FreeBSD 12.4"
- In reply to: Jirka Novak : "No sound card on Olimex A20 SOM EVB with FreeBSD 12.4"
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sat, 28 Oct 2023 04:58:48 UTC
Hello Jirka, On Fri, 27 Oct 2023 18:19:00 +0200 Jirka Novak <j.novak@netsystem.cz> wrote: > Hello, > > We made custom device based on Olimex A20 SOM EVB board. I'm > migrating our application from FreeBSD 11.2 to FreeBSD 12.4. Our > application requires sound card and I found that if I install fresh OS, > I'm missing sound card device (/dev/dsp). > Sound card supported by the board has source in > src/sys/arm/allwinner/a10_codec.c and code was not changed for ages and > is part of 11.2, 12.x and 13.x branch. > > I spend hours by checking why I'm missing sound device and I learn > that during boot is printed: > > FreeBSD 11.2: > pcm0: <Allwinner Audio Codec> mem 0x1c22c00-0x1c22c3f irq 35 on simplebus0 > pcm0: Mixer "vol": > pcm0: Mixer "line": > pcm0: Mixer "rec": > > FreeBSD 12.4: > pcm0: <Allwinner Audio Codec> mem 0x1c22c00-0x1c22c3f irq 46 on simplebus0 > pcm0: cannot find codec clock > > I searched source code of sound card driver and I found: > > if (clk_get_by_ofw_name(dev, 0, "codec", &clk_codec) != 0) { > device_printf(dev, "cannot find codec clock\n"); > goto fail; > } > > so it tries to find "codec" clock. > I expect it should be found/configured based on dtb file and I expect > that dtb was changed between releases. I hope I'm able to extend dtb for > the board. > The issue is that I don't know which codec clock it searches for. I > analyzed boot -v from 11.2 and 12.4 and I'm not able to identify it. > There are several "codec" word in boot log, but I don't know how the > code decide which one is correct/missing just based on word "codec" from > source code. > I went thru dts sources, but I'm not able to identify "codec" neither. > > Can I ask for help to identify which clock shown in 11.2 boot log are > missing in 12.4 boot log? > > Best regards, > > Jirka Novak It seems that we are missing some clocks. We don't support the audio pll and so don't support the codec gate which is the one that the driver is expecting to find. It looks like we've never supported this pll since the switch to the new clock driver (in 2018). Back then a lot of clock were directly found in the DTB but that ship has sailed a long time ago. FreeBSD 11 still have the old clock drivers (and the old DTB) which is why it worked for you. I don't think that anybody have any plan to work on that tbh. -- Emmanuel Vadot <manu@bidouilliste.com> <manu@freebsd.org>