I'm working on a pi zero alarm clock project which uses the internal pwm hardware pin for audio generation. There are some tutorials (like this adafruit tutorial) online explaining how to do this, by using the alternative gpio functions.
Now I want to add some WS2812 LEDs for an additional "light wake up function". Those LEDs are very common and easy to control... if you have one spare pwm pin.
I know Raspberry Pi has two different pwm channels, which you can access by using the following alternative functions of the given GPIOs:
GPIO18 ALT5 = PWM0 GPIO19 ALT5 = PWM1 GPIO12 ALT0 = PWM0 GPIO13 ALT0 = PWM1
Using libraries like pigpio or wiringpi I'm able to set those alternative functions and control either the audio generation or the leds. Independent of the pwm channels the applications seem to conflict with each other and switching between applications is just possible after doing a reboot.
Doing some research about this I found some help in the raspberry pi forum, suggesting of adding the following line to the /boot/config.txt file:
This enables the pi to switch between pwm applications, but using one python script to run my alarm clock still blocks the pwm for controlling the leds after running the ALSA audio module.
Now I'm looking for possible other solutions of how to work around this. Are there some IC which I could use for the generation of an additional pwm channel?