nebrius / raspi-soft-pwm

Provides access to Software PWM on the Raspberry Pi from Node.js through pigpio
MIT License
5 stars 0 forks source link

audio output failed when created a softPWM instance #3

Closed antonrez89 closed 3 years ago

antonrez89 commented 3 years ago

I have Raspi 2 and do the following steps: 1) start the audio output by omxplayer -o local demo.mp3 2) start my nodejs app with softPWM

once a softPWM instance created, the audio output stopped and doesn't work (even if js app is stopped too) until reboot.

I think that is related to timers, but what it is exactly i dont know.

antonrez89 commented 3 years ago

связано с configureClock(5, CLOCK_PWM); если убрать эту строку, то у меня все заработало, включая I2C

nebrius commented 3 years ago

Hi @antoxxxa-2. Unfortunately this is a limitation of the hardware. Software PWM commandeers some of the registers needed to do audio, and so disables it. This can't be worked around either, so you'll have to pick one or the other. If you really need both, you could look into adding a USB soundcard to the Pi.

antonrez89 commented 3 years ago

thanks for reply, I have already ordered usb sound cart, because in raspberry there is no mic by default.