# PiDog Function Demonstration says I need to run with sudo

**URL:** <https://forum.sunfounder.com/t/pidog-function-demonstration-says-i-need-to-run-with-sudo/2984>\
**Category:** Robotic kit for Raspberry Pi\
**Created:** [April 3, 2025, 8:47pm UTC](https://forum.sunfounder.com/t/pidog-function-demonstration-says-i-need-to-run-with-sudo/2984 "2025-04-03T20:47:29Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![jackfull](https://avatars.discourse-cdn.com/v4/letter/j/9de0a6/32.png) [@jackfull](https://forum.sunfounder.com/u/jackfull)\
**Post date:** [April 3, 2025, 8:47pm UTC](https://forum.sunfounder.com/t/pidog-function-demonstration-says-i-need-to-run-with-sudo/2984/1 "2025-04-03T20:47:29Z")

</div>

![Screenshot 2025-04-03 074130](https://canada1.discourse-cdn.com/flex029/uploads/sunfounder/original/2X/0/021b08ad318460a59c401c639dc69e81c92cafcb.png)

The examples all worked fine after initial calibration and setup. Going back to just running the examples I get no sound. I changed the SD card (32GB) and did a complete reinstall. Mechanical functions all work in the function demo, but still no sound. Screen shot attached indicates in need to run sound effects with sudo. The I2S script seems to install no red flags but no sound test. raspi-config confirms I2S installed.

---

<div class="post-metadata">

**Author:** ![carbone](https://avatars.discourse-cdn.com/v4/letter/c/ee7513/32.png) [@carbone](https://forum.sunfounder.com/u/carbone)\
**Post date:** [April 4, 2025, 6:10pm UTC](https://forum.sunfounder.com/t/pidog-function-demonstration-says-i-need-to-run-with-sudo/2984/2 "2025-04-04T18:10:24Z")

</div>

I get exactly the same message, but my sound works fine. I also hear the test sounds with the I2S script, so likely something wrong with your sound card.

---

<div class="post-metadata">

**Author:** ![jackfull](https://avatars.discourse-cdn.com/v4/letter/j/9de0a6/32.png) [@jackfull](https://forum.sunfounder.com/u/jackfull)\
**Post date:** [April 5, 2025, 3:04pm UTC](https://forum.sunfounder.com/t/pidog-function-demonstration-says-i-need-to-run-with-sudo/2984/3 "2025-04-05T15:04:34Z")

</div>

Thank you for the input. Any idea how I can verify the sound card operation?

---

<div class="post-metadata">

**Author:** ![SunFounder\_Moderator](https://avatars.discourse-cdn.com/v4/letter/s/34f0e0/32.png) [@SunFounder\_Moderator](https://forum.sunfounder.com/u/SunFounder_Moderator)\
**Post date:** [April 7, 2025, 7:19am UTC](https://forum.sunfounder.com/t/pidog-function-demonstration-says-i-need-to-run-with-sudo/2984/5 "2025-04-07T07:19:01Z")

</div>

Please execute the i2samp.sh script to install the audio driver, as documented here: [Install All Modules - PiDog Documentation](https://docs.sunfounder.com/projects/pidog/en/latest/python/python_start/install_all_modules.html) (See attached screenshot)

 ![screenshot-20250407-151523](https://canada1.discourse-cdn.com/flex029/uploads/sunfounder/original/2X/1/199fb2ad9ef8799a858c2e85531f1b62f87e4ade.png)

---

<div class="post-metadata">

**Author:** ![jackfull](https://avatars.discourse-cdn.com/v4/letter/j/9de0a6/32.png) [@jackfull](https://forum.sunfounder.com/u/jackfull)\
**Post date:** [April 7, 2025, 10:45am UTC](https://forum.sunfounder.com/t/pidog-function-demonstration-says-i-need-to-run-with-sudo/2984/6 "2025-04-07T10:45:51Z")

</div>

Hi -

Thanks for reaching out. I have run the I2Samp script more times then I can count. I have changed SD cards using new 32gb cards and complete reinstalls twice. (I am very familiar with the RPi OS and playing with Rpi’s since they were introduced 12 years ago, but not as fluent in Linux/Debian as I’d like).

Audio all worked fine until I ran the IOS app and PiDog script. It initially worked fine but after a shutdown and rerun I cannot get any audio to operate from any sketch. Not sure how to verify if the I2S chip is working … I will try to verify speaker, but I find it hard to think it failed.

tks&rgds

/jack

---

<div class="post-metadata">

**Author:** ![jackfull](https://avatars.discourse-cdn.com/v4/letter/j/9de0a6/32.png) [@jackfull](https://forum.sunfounder.com/u/jackfull)\
**Post date:** [April 7, 2025, 3:17pm UTC](https://forum.sunfounder.com/t/pidog-function-demonstration-says-i-need-to-run-with-sudo/2984/7 "2025-04-07T15:17:27Z")

</div>

… I was wrong. It was the speaker. I patched in another speaker (I also work on model trains with sound decoders that use similar speakers so I had a similar to try). I just assumed that the speaker would be more rugged with regard to its use in this application. Similar speakers I work with I’ve never had a failure. … that’s what I get for assuming … at least I found the issue. 🙂  
rgds/jack

---

<div class="post-metadata">

**Author:** ![SunFounder\_Moderator](https://avatars.discourse-cdn.com/v4/letter/s/34f0e0/32.png) [@SunFounder\_Moderator](https://forum.sunfounder.com/u/SunFounder_Moderator)\
**Post date:** [April 8, 2025, 1:59am UTC](https://forum.sunfounder.com/t/pidog-function-demonstration-says-i-need-to-run-with-sudo/2984/8 "2025-04-08T01:59:53Z")

</div>

Sometimes the speaker switch on the HAT may not be activated. In such cases, you can use the command ‘robot\_hat enable\_speaker’ to turn it on.
