Skip to content
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

gpioInitialise cause I2S DAC sound card does not work properly #87

Closed
howardqiao opened this issue Oct 4, 2016 · 2 comments
Closed

Comments

@howardqiao
Copy link

howardqiao commented Oct 4, 2016

gpioInitialise cause I2S interface DAC sound card does not work properly, I do not know you have not tried, when MPD playing music, run gpioInitialise, will cause the player to stop, when the replay, the sound is not normal.(tested on raspberry pi Zero)

@joan2937
Copy link
Owner

joan2937 commented Oct 4, 2016

Yes, it will do.

The I2S peripheral uses the PCM hardware on the Pi. By default pigpio also uses the PCM hardware to time DMA transfers.

You can tell pigpio to use the PWM hardware instead of the PCM hardware. You do that by calling gpioCfgClock before calling gpioInitialise.

E.g.

gpioCfgClock(5, 0, 0);
if (gpioInitialise() < 0) exit(-1);
...
gpioTerminate();

Of course this means you can't use the PWM hardware for ordinary audio.

N.B. if you use the wave functions that forces the use of the other PWM/PCM hardware. So you will still lose PCM if you use waves from pigpio. If you don't know what waves are you probably aren't using them.

@NBroomfield
Copy link

I'm having the same issue, I added gpioCfgClock(5, 0, 0) which seem to fix the issue but now my comms via /dev/serial0 are messed up, any suggestions? I'm not actually using pigpio for anything complex just reading an writing to some pins, so I don't need complex PWM or interrupts on pins.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants