Picar-X AI Sound Problem

Hello,
I bought this Kit :
“Picar-X AI Video Robot Car Kit for Raspberry Pi 5/4/3B+/3B, ChatGPT-4o Enabled with Voice Command & Video Recognition, Python, Scratch, Camera, Mic, Rechargeable Batterry (RPI NOT Included)”

I connected it with my Raspberry PI 3B and installed the Raspberry Pi OS (Legacy,32-bit).

Unfortunately I have an Issue with the sound driver.

After several installation from the driver “i2samp.sh” and any restarts I have no sound.
According to the manual I used this Install-Link “https://picar-x-v20.rtfd.io
If I start the Desktop I receive this briefly message : "Failed to load overlay ‘i2s-mmap’ ".
What could I do ?

Is i2s enabled in raspi-config?

Hello,
Yes i2s is enabeld in raspi-config!

1.After installing “i2samp.sh” according to the tutorial steps, restart the Raspberry Pi and run the sound example to see how it works. Remember to run the script with sudo. Check if it can produce sound. Tip: Please remove the robot hat and check if the speaker on the back is functioning properly. Another possibility is that if a metal heatsink is installed on the Raspberry Pi CPU, it may be pressing against the speaker’s diaphragm, preventing it from producing sound.
2.If the speaker still does not produce sound, please remove the robot hat and take a photo of the back to confirm whether the speaker is burnt out.

Good morning,

that is the output after playing the example:
"
pi@pirobot:~ $ cd ~/picar-x/example
sudo python3 3.tts_example.py
/bin/sh: 1: pinctrl: not found

Input key to call the function!
space: Play sound effect (Car horn)
c: Play sound effect with threads
t: Text to speak
q: Play/Stop Music

Beep beep beep !
Beep beep beep !
"
But no sound !!!

After restarting the PI I got this messages on the screen:
"Failed to load overlay ‘i2s-mmap’ "

Kind regards !

It is possible that not all of your library code was installed correctly.

We recommend that you reinstall all the library code following the tutorial steps:
Install All the Modules.

During the installation process, please pay attention to any error messages. If there are any errors, provide us with a complete screenshot of the error message to help us analyze and resolve the issue.

After successfully installing all the library software, restart your Raspberry Pi and then run the sound example to see if it works properly.

If you still cannot hear any sound, please execute the alsamixer command:

  1. Press F6 to select the correct audio device.
  2. Use the up and down arrow keys to adjust the volume to the maximum.
  3. After adjusting, press Esc to exit.

Then, try running the sound example again to see if it produces sound.

I received this message:

git clone -b picamera2 GitHub - sunfounder/vilib: Vision library for python
cd vilib
sudo python3 install.py
fatal: destination path ‘vilib’ already exists and is not an empty directory.
Start installing vilib 0.3.11 for user pi
Python version: 3.9.2
Raspbian version: 11 (32bit)

mediapipe is only supported on 64bit system.
apt install dependency:

  • dpkg configure … Done
  • update apt-get … Done
  • install python3-libcamera … Done
  • install python3-picamera2 … Done
  • install python3-pyqt5 … Done
  • install python3-opengl … Done
  • install python3-opencv … Done
  • install opencv-data … Done
  • install ffmpeg … Done
  • install libgtk-3-0 … Done
  • install libxcb-shm0 … Done
  • install libcdio-paranoia-dev … Done
  • install libsdl2-2.0-0 … Done
  • install libxv1 … Done
  • install libtheora0 … Done
  • install libva-drm2 … Done
  • install libva-x11-2 … Done
  • install libvdpau1 … Done
  • install libharfbuzz0b … Done
  • install libbluray2 … Done
  • install libatlas-base-dev … Done
  • install libhdf5-103 … Done
  • install libzbar0 … Done
  • install libopenblas-dev … Done
    pip3 install dependency:
    pip3 install with --break-system-packages
  • update pip3 … Done
  • install tflite-runtime … Done
  • install Flask … Done
  • install imutils … Done
  • install qrcode … Done
  • install pyzbar … Done
  • install pyzbar[scripts] … Done
  • install readchar … Done
  • install protobuf>=3.20.0 … Done
  • install numpy==1.26.4 … Done
    mediapipe is not supported on this platform… Skip
    Create workspace
  • create dir … Done
  • copy workspace … Done
    Install vilib python package
  • run setup file … Done
  • cleanup … Done
    Finished
    and this:
    sudo bash i2samp.sh
    Support for your operating system is experimental. Please visit
    forums.adafruit if you experience issues with this product.

This script will install everything needed to use
i2s amplifier

— Warning —

Always be careful when running scripts and commands
copied from the internet. Ensure they are from a
trusted source.

If you want to see what this script does before
running it, you should run:
\curl -sS github.com/adafruit/Raspberry-Pi-Installer-Scripts/i2samp

Do you wish to continue? [y/N] y

Checking hardware requirements…

Adding Device Tree Entry to /boot/config.txt
dtoverlay already active
i2s mmap dtoverlay already active

Commenting out Blacklist entry in
/etc/modprobe.d/raspi-blacklist.conf
Reading package lists… Done
Building dependency tree… Done
Reading state information… Done
alsa-utils is already the newest version (1.2.4-1+rpt1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Installing aplay systemd unit
Removed /etc/systemd/system/multi-user.target.wants/aplay.service.

You can optionally activate ‘/dev/zero’ playback in
the background at boot. This will remove all
popping/clicking but does use some processor time.

Activate ‘/dev/zero’ playback in background? [RECOMMENDED] [y/N] yy

Configuring sound output
card_num=1
systemctl restart aplay.service
set volume to 100
Simple mixer control ‘PCM’,0
Capabilities: volume
Playback channels: Front Left - Front Right
Capture channels: Front Left - Front Right
Limits: 0 - 255
Front Left: 255 [100%]
Front Right: 255 [100%]

We can now test your i2s amplifier
Set your speakers if possible!
Do you wish to test your system now? [y/N] y
Testing…
i2samp.sh: line 536: pinctrl: command not found

speaker-test 1.2.4

Playback device is default
Stream parameters are 48000Hz, S16_LE, 2 channels
WAV file(s)
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 2229 to 8916
Period size range from 1114 to 1115
Using max buffer size 8916
Periods = 4
was set period_size = 1114
was set buffer_size = 8916
0 - Front Left
1 - Front Right
Time per period = 2.863930
0 - Front Left
1 - Front Right
Time per period = 2.998499
0 - Front Left
1 - Front Right
Time per period = 3.018485
0 - Front Left
1 - Front Right
Time per period = 3.015508
0 - Front Left
1 - Front Right
Time per period = 3.018127

All done!

Enjoy your new i2s amplifier!

Still, no sound after adjust sound per alsamixer.

Hi friend, we are very sorry, this is because the robot_hat code is not compatible with the bullseye system, because bullseye lacks the pinctrl used to set gpio 20 high to enable the speaker. We have fixed the robot code. Please update and reinstall:
cd ~/robot-hat
git pull
sudo python3 setup.py install
sudo bash i2samp.sh

In addition, it is recommended to use the latest bookworm version system of Raspberry Pi. For some compatibility issues of the old system, the code maintenance may not be so timely.

Hi, thank you for the quick response and that you solved this issue.
Now It works fine.
Have a nice week.

Kind regards
Michael

1 Like

Greetings. Similar situation. No sound. Raspberry Pi 3. No issues with installing all of the modules. I installed the updated code referenced in this thread. Still no sound.

1.Please remove robot-hat, and check if the speaker on the back is good. --Please provide pictures for us to see.
2. Another possible situation is that if a metal cooling pad is installed on the Raspberry Pi CPU it may press on the speaker diaphragm and prevent it from producing sound.
3. Please follow the steps in the tutorial link to install all library code:
https://docs.sunfounder.com/projects/picar-x-v20/en/latest/python/python_start/install_all_modules.html
Finally install i2samp.sh:
cd ~/picar-x
sudo bash i2samp.sh
Go run the sound example again, the code needs to be executed using sudo, otherwise there will be no sound.