Thank you for your donation!


Problem: Pi with PhatDac and pigpio
#1
Hello,

I use the my Pi Zero with PHATDAC module and - btw. well done - moode 6.3 and have a problem as soon as I run the pigpiod (http://abyz.me.uk/rpi/pigpio/index.html).
Without the pigpiod the sound is fine and everything works, but as soon as I start the daemon, there are two cases:
(1) pigpiod start without options: The sound gets very slow and deep, that's very bad. It seems this is a conflict with the used PCM, therefore I tried the next.
(2) pigpiod start with option "-t 0": This way it uses PWM and the sound's still fine. But as soon as I send something via IR using the pigpio functionality it sounds like I can hear the transmission and the sound get's a bit crazy then, unrepairable.

So in summary it seems like there's a conflict with raspberry sources in both cases  Huh
Is there any solution or does someone have an idea how to solve this problem?
I want so use moode and also control IR devices with this raspberry...
(and no, lirc is not a solution because it always hangs after some commands unfortunately, not very stable)

Thanks for all input!

Best regards,
Matthias
Reply
#2
Thats an interesting project.

Maybe ask the maintainer what might be happening.

moOde uses hw:0 for On-board and I2S audio and hw:1 for USB audio
Reply
#3
(10-08-2019, 11:27 PM)Tim Curtis Wrote: Thats an interesting project.

Maybe ask the maintainer what might be happening.

moOde uses hw:0 for On-board and I2S audio and hw:1 for USB audio

Hi Tim, thanks for your answer.


I assume you want me to contact the pigpio maintainer or do you think that's more related to the PHATDAC module? I think I'll contact both.
I know this module uses I2S.
Just to double check, moode is using nothing else then hw:0 ? (DMA or similar?)

Moode would be my choice for the flat wide http streaming raspberry including the complete control via IR of my TV-Motor and HiFi Tuner.
Hope to get this running stable...
Reply
#4
Ya, I would ping the pigpio maintainer and mention (1) using a HAT DAC, (2) MPD is configured to output to ALSA hw:0 and (3) Pi On-board audio device is disabled via /boot/config.txt setting "dtparam=audio=off".

-Tim
Reply
#5
I've never explored the PCM/PWM capabilities of the RPi boards at the GPIO-pin level, but is it possible you have a collision in GPIO pin usage here? The pHAT DAC apparently interfaces through the physical* pins 2, 12, and 40, which are +5V, BCM 18, and BCM 21. These BCM pins are mapped into I2S usage through the kernel device-tree overlay invoked in the /boot/config.txt file (e.g., dtparam=i2s=on).

I'm wondering if your application might also be exercising BCM 18 and/or BCM 21. (See https://pinout.xyz/pinout/phat_dac and click through the pins to see their alternative uses).

Perhaps this could be avoided by using the  -x mask option described in http://abyz.me.uk/rpi/pigpio/pigpiod.html?

Regards,
Kent

*not to be confused with WiringPi pin numbers.
Reply
#6
(10-09-2019, 06:58 PM)TheOldPresbyope Wrote: I've never explored the PCM/PWM capabilities of the RPi boards at the GPIO-pin level, but is it possible you have a collision in GPIO pin usage here? The pHAT DAC apparently interfaces through the physical* pins 2, 12, and 40, which are +5V, BCM 18, and BCM 21. These BCM pins are mapped into I2S usage through the kernel device-tree overlay invoked in the /boot/config.txt file (e.g., dtparam=i2s=on).

I'm wondering if your application might also be exercising BCM 18 and/or BCM 21. (See https://pinout.xyz/pinout/phat_dac and click through the pins to see their alternative uses).

Perhaps this could be avoided by using the  -x mask option described in http://abyz.me.uk/rpi/pigpio/pigpiod.html?

Regards,
Kent

*not to be confused with WiringPi pin numbers.

Thanks, good idea. But I also checked this before posting here. I'm using BCM14 and 15 for IR transmit and receive, shouldn't lead to any collision of GPIOs as far as I see.
But nice info from you how the overlay maps the pins!

In the meantime I had contact to the pigpio maintainer and the final answer was:

Quote:If you are using waves to generate the IR signal you will not be able
to use either of PWM or PCM for sound.

http://abyz.me.uk/rpi/pigpio/faq.html#So...nt_working

You will have to find an IR alternative.  Perhaps LIRC or look at one

of the other libraries such as wiringPi or bcm2835.

Even I'm confused about "using waves to generate the IR signal" this means I need an alternative or have to stop the pigpiod if playing sound and vice versa.
Does anyone have experience with wiringPi or bcm2835 fir IR? At the moment I have no idea about both (and no time to try the next 2 weeks).
Maybe it's better to switch back to my unstable solution with LIRC and try to clarify the issues with the lirc maintainer(s)... Confused
Reply


Forum Jump: