Hi Jeremy, > On 11/5/21 15:34, Mario Bălănică via groups.io wrote: >> >> Also fix PWM0 on the Raspberry Pi 4, but we can't expose both yet. > > Why is that? The rpi4 needs both PWM devices to output stereo right? So > with this patch is still mono?
Each PWM controller has two channels, so only one controller is needed for stereo output. > Assuming we are just aiming for mono on the rpi4, Do we need a separate > set of buffers here for both the rpi3 and 4, can't the buffers be reused > below? > I would expect that the pi4 just reuses 17-30 here, or it uses both PWM > channels. Right, they could be reused, but the plan is to expose both controllers on RPi 4 in the future. We can't do it right now because of some conflicts in the Windows drivers. The Clock Manager is shared, which may cause a race condition if both devices try to change the PWM clock. > But, that said. I think there might be a better, but much more complex > way to do this. > So, instead of trying to _DSD the base freq/etc in the next patch we > just define a _DSM() method which sets the audio/pwm rate. Maybe it > takes the audio sample rate and depth, sets up the PWM divisor and > returns the pwm rate. (along with errors about boundaries, or we assume > the sample rate is 4 bits and bound the sample rate/etc). Yeah, a _DSM would be better. This way, I can also get rid of the clock handling code in the PWM driver. But then only the audio driver would be able to set the clock divisor. I guess it's not really an issue, as long as we set an initial divisor so that the PWM peripherals can be used without the audio driver being installed. Even though I don't really like having those clock values in the audio _DSD, I think it's fine until we decide on / implement a better solution. --Mario -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#83788): https://edk2.groups.io/g/devel/message/83788 Mute This Topic: https://groups.io/mt/86850797/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-