Sound volume is always the same

I have Picar-X wit Robot Hat v4.
The sound works, all the tests in “3.tts_example.py” work fine.
The Music.play_tone_for() methods work too.

The issue is that executing set_volume() does not change the volume at all - no matter if it is set_volume(10) or set_volume(100) the volume is the same.
This applies to bot TTS and Music.

I get this when executing e.g. set_volume(10):

Simple mixer control 'PCM',0
  Capabilities: pvolume pswitch pswitch-joined
  Playback channels: Front Left - Front Right
  Limits: Playback -10239 - 400
  Mono:
  Front Left: Playback -5600 [10%] [-56.00dB] [on]
  Front Right: Playback -5600 [10%] [-56.00dB] [on]

so it does attempt to change the volume but the volume stays the same.

I did run sudo bash i2samp.sh, of course.
One curious thing is that, when it runs the testing part, only the sound “Front Right” is heard - as though it thinks that the Robot Hat speaker is a front-right speaker …
Shouldn’t it be a mono-speaker, i.e. all sound is directed to that single speaker?

Incidentally, there is a whole bunch of errors printed out in terminal when play_tone_for() is called the first time :

ALSA lib pcm.c:2666:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.front
ALSA lib pcm.c:2666:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2666:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2666:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm.c:2666:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround21
ALSA lib pcm.c:2666:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround21
ALSA lib pcm.c:2666:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround40
ALSA lib pcm.c:2666:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround41
ALSA lib pcm.c:2666:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround50
ALSA lib pcm.c:2666:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround51
ALSA lib pcm.c:2666:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround71
ALSA lib pcm.c:2666:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2666:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2666:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib confmisc.c:1369:(snd_func_refer) Unable to find definition 'cards.0.pcm.hdmi.0:CARD=0,AES0=4,AES1=130,AES2=0,AES3=2'
ALSA lib conf.c:5180:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5703:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2666:(snd_pcm_open_noupdate) Unknown PCM hdmi
ALSA lib confmisc.c:1369:(snd_func_refer) Unable to find definition 'cards.0.pcm.hdmi.0:CARD=0,AES0=4,AES1=130,AES2=0,AES3=2'
ALSA lib conf.c:5180:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5703:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2666:(snd_pcm_open_noupdate) Unknown PCM hdmi
ALSA lib pcm.c:2666:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2666:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2666:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pcm.c:2666:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pcm_oss.c:397:(_snd_pcm_oss_open) Cannot open device /dev/dsp
ALSA lib pcm_oss.c:397:(_snd_pcm_oss_open) Cannot open device /dev/dsp
XDG_RUNTIME_DIR (/run/user/1000) is not owned by us (uid 0), but by uid 1000! (This could e.g. happen if you try to connect to a non-root PulseAudio as a root user, over the native protocol. Don't do that.)
ALSA lib pulse.c:242:(pulse_connect) PulseAudio: Unable to connect: Connection refused

XDG_RUNTIME_DIR (/run/user/1000) is not owned by us (uid 0), but by uid 1000! (This could e.g. happen if you try to connect to a non-root PulseAudio as a root user, over the native protocol. Don't do that.)
ALSA lib pulse.c:242:(pulse_connect) PulseAudio: Unable to connect: Connection refused

ALSA lib pcm_a52.c:1001:(_snd_pcm_a52_open) a52 is only for playback
ALSA lib conf.c:5670:(snd_config_expand) Unknown parameters {AES0 0x6 AES1 0x82 AES2 0x0 AES3 0x2 CARD 0}
ALSA lib pcm.c:2666:(snd_pcm_open_noupdate) Unknown PCM iec958:{AES0 0x6 AES1 0x82 AES2 0x0 AES3 0x2 CARD 0}
ALSA lib confmisc.c:160:(snd_config_get_card) Invalid field card
ALSA lib pcm_usb_stream.c:482:(_snd_pcm_usb_stream_open) Invalid card 'card'
ALSA lib confmisc.c:160:(snd_config_get_card) Invalid field card
ALSA lib pcm_usb_stream.c:482:(_snd_pcm_usb_stream_open) Invalid card 'card'
ALSA lib pcm_dmix.c:972:(snd_pcm_dmix_open) The dmix plugin supports only playback stream
ALSA lib pcm_dmix.c:972:(snd_pcm_dmix_open) The dmix plugin supports only playback stream
ALSA lib pcm_dmix.c:972:(snd_pcm_dmix_open) The dmix plugin supports only playback stream

Next call to play_tone_for() produces only this:
XDG_RUNTIME_DIR (/run/user/1000) is not owned by us (uid 0), but by uid 1000! (This could e.g. happen if you try to connect to a non-root PulseAudio as a root user, over the native protocol. Don't do that.)

Is there some fix/solution for setting the volume?

Oh, the music_set_volume() also does nothing.

I run alsamixer in a terminal on the GUI and run my code over SSH.
As soon as ˙set_volume(100)’ is executed in my code, the alsamixer’s volume bar jumps to maximum.

And yet the sound level remains the same.

While the “ALSA lib” errors are one-time and can be tolerated, the “XDG_RUNTIME_DIR” errors keep popping up by themselves every 3 to 4 seconds!
They mess up anything being shown in terminal :person_facepalming: :roll_eyes:

Thank you for reaching out.
I recommend providing us with a video of the issue to help us analyze the speaker volume problem more effectively.If the video file is too large, you can upload it to OneDrive and share the link with access enabled.
In the meantime, you can try executing the following command to adjust the volume:
sudo amixer -c 1 sset PCM 80%
Please let us know if you notice any changes.

Unfortunately, the amixer command did not change anything - the volume is the same a before.
When I run the sudo amixer -c 1 sset PCM 80% command I get this response:

Simple mixer control 'PCM',0
  Capabilities: volume
  Playback channels: Front Left - Front Right
  Capture channels: Front Left - Front Right
  Limits: 0 - 255
  Front Left: 204 [80%]
  Front Right: 204 [80%]

As I wrote before, all the software controls behave normally and show expected result, however, the sound volume coming from the speaker is very low.

Incidental, apart from low sound volume I have observed following 2 issues related to motors:

  1. Running motors interfere with ultrasound sensor readings (there is a lot of readings that differ from actual value by up to 50%, as opposed to same piece of code giving consistent results when motors are not running)

  2. Driving at the same power for the same time results in different travel distances. No wheel slipping, same battery level.
    The difference is mostly not in the consecutive drives, but happens every now and then (e.g. robot now drives for 1m consistently in 10 tests, and one hour later it suddenly drives 0.8m, consistently in repeated tests, then after half hour it starts driving 0.85m, 0.88m, 0.9m, 0.94m in consecutive drives and then drives 0.95m in 10 tests)

Not sure if these behaviors have anything to do with sound level, though, but point to some quality issues, which may be a common cause.

Could you please provide us with an image of the Robot Hat so we can confirm which version it is?
And contact service@sunfounder.com with your address for the replacement.

OK, here is the photo of my Robot Hat:

I have sent an email with my address as you instructed too.

Thank you!

I got the replacement Robot HAT yesterday, thank you!

I replaced the old one today and … it worked at first (after running sudo bash i2samp.sh), however it stopped working soon after.

I rerun sudo bash i2samp.sh couple of times, rebooted couple of times, reinstalled all the modules as per instructions at 5. Install All the Modules(Important) — SunFounder PiCar-X Kit documentation, all in vain - all I get is “resource busy” errors.

For example, when runnig sudo python3 3.tts_example.py I get this:

Traceback (most recent call last):
  File "/home/theadmin/picar-x/example/3.tts_example.py", line 9, in <module>
    music = Music()
            ^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/robot_hat/music.py", line 71, in __init__
    self.pygame.mixer.init()
pygame.error: ALSA: Couldn't open audio device: Device or resource busy

When runningsudo amixer -c 1 sset PCM 80% I get this:

Simple mixer control 'PCM',0
  Capabilities: pvolume pswitch pswitch-joined
  Playback channels: Front Left - Front Right
  Limits: Playback -10239 - 400
  Mono:
  Front Left: Playback -1728 [80%] [-17.28dB] [on]
  Front Right: Playback -1728 [80%] [-17.28dB] [on]

Interestingly, in my code, when I try to initialize a pin to access RST button ilke this:
thePin_RST = Pin("RST", mode=Pin.IN, pull=Pin.PULL_UP, active_state=False)

I get also “GPIO busy” exception (but only for RST and not for USR button!):

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/gpiozero/pins/pi.py", line 411, in pin
    pin = self.pins[info]
          ~~~~~~~~~^^^^^^
KeyError: PinInfo(number=36, name='GPIO16', names=frozenset({16, 'WPI27', 'J8:36', 'BCM16', 'GPIO16', '16', 'BOARD36'}), pull='', row=18, col=2, interfaces=frozenset({'', 'uart', 'dpi', 'gpio', 'spi'}))

...

File "/usr/local/lib/python3.11/dist-packages/robot_hat/pin.py", line 96, in __init__
    self.setup(mode, pull, active_state)
  File "/usr/local/lib/python3.11/dist-packages/robot_hat/pin.py", line 137, in setup
    self.gpio = InputDevice(self._pin_num, pull_up=True, active_state=None)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/gpiozero/devices.py", line 108, in __call__
    self = super().__call__(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/gpiozero/input_devices.py", line 79, in __init__
    super().__init__(pin, pin_factory=pin_factory)
  File "/usr/lib/python3/dist-packages/gpiozero/devices.py", line 553, in __init__
    pin = self.pin_factory.pin(pin)
          ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/gpiozero/pins/pi.py", line 413, in pin
    pin = self.pin_class(self, info)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/gpiozero/pins/lgpio.py", line 126, in __init__
    lgpio.gpio_claim_input(
  File "/usr/lib/python3/dist-packages/lgpio.py", line 755, in gpio_claim_input
    return _u2i(_lgpio._gpio_claim_input(handle&0xffff, lFlags, gpio))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/lgpio.py", line 458, in _u2i
    raise error(error_text(v))
lgpio.error: 'GPIO busy'

Am I doing something wrong?

Do you have any other running programs that are using the sound card and pins? Try checking for running programs using commands like ps -aux | grep python or top.

Thank you for answering.

I have not started anything, especially not something that would run in the background and automatically start on reboot.
That is, I have not done that on purpose … Could have something been started by amixer or 12samp.sh?

This is what I get by running ps -aux | grep python (I’m logged in as “theadmin”):

64757       1112  0.1  0.7  37368 27464 ?        Ss   16:46   0:00 python3 /usr/sbin/wsdd --shortlog --chroot=/run/wsdd
theadmin    1975  1.0  1.0 126384 42296 ?        Sl   16:47   0:02 /bin/python /home/theadmin/.vscode-server/extensions/ms-python.autopep8-2025.2.0/bundled/tool/lsp_server.py
theadmin    1997 29.1 17.4 12486964 678876 ?     Sl   16:47   1:05 /home/theadmin/.vscode-server/cli/servers/Stable-2901c5ac6db8a986a5666c3af51ff804d05af0d4/server/node /home/theadmin/.vscode-server/extensions/ms-python.vscode-pylance-2025.6.2/dist/server.bundle.js --cancellationReceive=file:9d7495a8fae7b80cdcce0b7c9a8eae8cb3998b58b0 --node-ipc --clientProcessId=1874
theadmin    2784  0.0  0.0   6092  1936 pts/3    S+   16:51   0:00 grep --color=auto python

It does not look like anything is running that shouldn’t be running.

I also did ps -aux | grep theadmin but also don’t see anything there either.

Here is a complete list of tasks I get with ps -aux:

USER         PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root           1  0.0  0.2 168920 11652 ?        Ss   16:46   0:01 /sbin/init splash
root           2  0.0  0.0      0     0 ?        S    16:46   0:00 [kthreadd]
root           3  0.0  0.0      0     0 ?        S    16:46   0:00 [pool_workqueue_release]
root           4  0.0  0.0      0     0 ?        I<   16:46   0:00 [kworker/R-kvfree_rcu_reclaim]
root           5  0.0  0.0      0     0 ?        I<   16:46   0:00 [kworker/R-rcu_gp]
root           6  0.0  0.0      0     0 ?        I<   16:46   0:00 [kworker/R-sync_wq]
root           7  0.0  0.0      0     0 ?        I<   16:46   0:00 [kworker/R-slub_flushwq]
root           8  0.0  0.0      0     0 ?        I<   16:46   0:00 [kworker/R-netns]
root          12  0.0  0.0      0     0 ?        I    16:46   0:00 [kworker/u16:0-ipv6_addrconf]
root          13  0.0  0.0      0     0 ?        I<   16:46   0:00 [kworker/R-mm_percpu_wq]
root          14  0.0  0.0      0     0 ?        I    16:46   0:00 [rcu_tasks_kthread]
root          15  0.0  0.0      0     0 ?        I    16:46   0:00 [rcu_tasks_rude_kthread]
root          16  0.0  0.0      0     0 ?        I    16:46   0:00 [rcu_tasks_trace_kthread]
root          17  0.0  0.0      0     0 ?        S    16:46   0:00 [ksoftirqd/0]
root          18  0.0  0.0      0     0 ?        I    16:46   0:00 [rcu_preempt]
root          19  0.0  0.0      0     0 ?        S    16:46   0:00 [rcu_exp_par_gp_kthread_worker/0]
root          20  0.0  0.0      0     0 ?        S    16:46   0:00 [rcu_exp_gp_kthread_worker]
root          21  0.0  0.0      0     0 ?        S    16:46   0:00 [migration/0]
root          22  0.0  0.0      0     0 ?        S    16:46   0:00 [cpuhp/0]
root          23  0.0  0.0      0     0 ?        S    16:46   0:00 [cpuhp/1]
root          24  0.0  0.0      0     0 ?        S    16:46   0:00 [migration/1]
root          25  0.0  0.0      0     0 ?        S    16:46   0:00 [ksoftirqd/1]
root          28  0.0  0.0      0     0 ?        S    16:46   0:00 [cpuhp/2]
root          29  0.0  0.0      0     0 ?        S    16:46   0:00 [migration/2]
root          30  0.0  0.0      0     0 ?        S    16:46   0:00 [ksoftirqd/2]
root          33  0.0  0.0      0     0 ?        S    16:46   0:00 [cpuhp/3]
root          34  0.0  0.0      0     0 ?        S    16:46   0:00 [migration/3]
root          35  0.0  0.0      0     0 ?        S    16:46   0:00 [ksoftirqd/3]
root          37  0.0  0.0      0     0 ?        I<   16:46   0:00 [kworker/3:0H-events_highpri]
root          38  0.0  0.0      0     0 ?        I    16:46   0:00 [kworker/u17:0-events_unbound]
root          39  0.0  0.0      0     0 ?        I    16:46   0:00 [kworker/u18:0-async]
root          42  0.0  0.0      0     0 ?        S    16:46   0:00 [kdevtmpfs]
root          43  0.0  0.0      0     0 ?        I<   16:46   0:00 [kworker/R-inet_frag_wq]
root          44  0.0  0.0      0     0 ?        S    16:46   0:00 [kauditd]
root          45  0.0  0.0      0     0 ?        S    16:46   0:00 [khungtaskd]
root          46  0.0  0.0      0     0 ?        S    16:46   0:00 [oom_reaper]
root          47  0.0  0.0      0     0 ?        I    16:46   0:00 [kworker/u17:1-events_unbound]
root          48  0.0  0.0      0     0 ?        I<   16:46   0:00 [kworker/R-writeback]
root          49  0.0  0.0      0     0 ?        S    16:46   0:00 [kcompactd0]
root          50  0.0  0.0      0     0 ?        S    16:46   0:00 [kcompactd1]
root          51  0.0  0.0      0     0 ?        I<   16:46   0:00 [kworker/R-kintegrityd]
root          52  0.0  0.0      0     0 ?        I<   16:46   0:00 [kworker/R-kblockd]
root          53  0.0  0.0      0     0 ?        I<   16:46   0:00 [kworker/R-blkcg_punt_bio]
root          54  0.0  0.0      0     0 ?        I    16:46   0:00 [kworker/u18:1-events_unbound]
root          56  0.0  0.0      0     0 ?        S    16:46   0:00 [watchdogd]
root          57  0.0  0.0      0     0 ?        I<   16:46   0:00 [kworker/1:1H-kblockd]
root          59  0.0  0.0      0     0 ?        I<   16:46   0:00 [kworker/R-rpciod]
root          60  0.0  0.0      0     0 ?        I<   16:46   0:00 [kworker/R-xprtiod]
root          62  0.0  0.0      0     0 ?        I    16:46   0:00 [kworker/u19:1-kvfree_rcu_reclaim]
root          63  0.0  0.0      0     0 ?        S    16:46   0:00 [kswapd0]
root          64  0.0  0.0      0     0 ?        S    16:46   0:00 [kswapd1]
root          65  0.0  0.0      0     0 ?        I<   16:46   0:00 [kworker/R-nfsiod]
root          66  0.0  0.0      0     0 ?        I<   16:46   0:00 [kworker/R-kthrotld]
root          67  0.0  0.0      0     0 ?        I    16:46   0:00 [kworker/2:2-mm_percpu_wq]
root          70  0.0  0.0      0     0 ?        I    16:46   0:00 [kworker/u19:2-events_unbound]
root          74  0.0  0.0      0     0 ?        S    16:46   0:00 [irq/27-aerdrv]
root          75  0.0  0.0      0     0 ?        S    16:46   0:00 [hwrng]
root          76  0.0  0.0      0     0 ?        I<   16:46   0:00 [kworker/R-iscsi_conn_cleanup]
root          77  0.0  0.0      0     0 ?        I<   16:46   0:00 [kworker/R-nvme-wq]
root          78  0.0  0.0      0     0 ?        I<   16:46   0:00 [kworker/R-nvme-reset-wq]
root          79  0.0  0.0      0     0 ?        I<   16:46   0:00 [kworker/R-nvme-delete-wq]
root          82  0.0  0.0      0     0 ?        I<   16:46   0:00 [kworker/R-DWC Notification WorkQ]
root          83  0.0  0.0      0     0 ?        I<   16:46   0:00 [kworker/R-uas]
root          84  0.0  0.0      0     0 ?        S    16:46   0:00 [vchiq-keep/0]
root          85  0.0  0.0      0     0 ?        S<   16:46   0:00 [vchiq-slot/0]
root          86  0.0  0.0      0     0 ?        S<   16:46   0:00 [vchiq-recy/0]
root          87  0.0  0.0      0     0 ?        S<   16:46   0:00 [vchiq-sync/0]
root          88  0.0  0.0      0     0 ?        I<   16:46   0:00 [kworker/2:1H-kblockd]
root          89  0.1  0.0      0     0 ?        I<   16:46   0:03 [kworker/u21:0-brcmf_wq/mmc1:0001:1]
root          90  0.0  0.0      0     0 ?        I<   16:46   0:00 [kworker/u22:0]
root          91  0.0  0.0      0     0 ?        I<   16:46   0:00 [kworker/u23:0]
root          92  0.0  0.0      0     0 ?        I<   16:46   0:00 [kworker/u24:0]
root          93  0.0  0.0      0     0 ?        I<   16:46   0:00 [kworker/u25:0]
root          94  0.0  0.0      0     0 ?        I    16:46   0:00 [kworker/u19:3-events_unbound]
root          96  0.0  0.0      0     0 ?        I<   16:46   0:00 [kworker/R-sdhci]
root          97  0.0  0.0      0     0 ?        I<   16:46   0:00 [kworker/0:1H-mmc_complete]
root          98  0.0  0.0      0     0 ?        S    16:46   0:00 [irq/40-mmc0]
root         126  0.0  0.0      0     0 ?        I<   16:46   0:00 [kworker/3:1H-kblockd]
root         139  0.0  0.0      0     0 ?        I<   16:46   0:00 [kworker/R-mmc_complete]
root         172  0.0  0.0      0     0 ?        I<   16:46   0:00 [kworker/R-v3d_bin]
root         173  0.0  0.0      0     0 ?        I<   16:46   0:00 [kworker/R-v3d_render]
root         174  0.0  0.0      0     0 ?        I<   16:46   0:00 [kworker/R-v3d_tfu]
root         175  0.0  0.0      0     0 ?        I<   16:46   0:00 [kworker/R-v3d_csd]
root         176  0.0  0.0      0     0 ?        I<   16:46   0:00 [kworker/R-v3d_cache_clean]
root         177  0.0  0.0      0     0 ?        I<   16:46   0:00 [kworker/R-v3d_cpu]
root         178  0.0  0.0      0     0 ?        I    16:46   0:00 [kworker/u20:1-kvfree_rcu_reclaim]
root         205  0.0  0.0      0     0 ?        S    16:46   0:00 [jbd2/mmcblk0p2-8]
root         206  0.0  0.0      0     0 ?        I<   16:46   0:00 [kworker/R-ext4-rsv-conversion]
root         225  0.0  0.0      0     0 ?        I<   16:46   0:00 [kworker/R-mld]
root         226  0.0  0.0      0     0 ?        I<   16:46   0:00 [kworker/R-ipv6_addrconf]
root         227  0.0  0.0      0     0 ?        I    16:46   0:00 [kworker/u16:1]
root         240  0.0  0.0      0     0 ?        I<   16:46   0:00 [kworker/0:2H-mmc_complete]
root         266  0.0  0.4  50304 16612 ?        Ss   16:46   0:00 /lib/systemd/systemd-journald
root         296  0.0  0.1  27128  6752 ?        Ss   16:46   0:00 /lib/systemd/systemd-udevd
root         337  0.0  0.0      0     0 ?        S    16:46   0:00 [spi0]
root         338  0.0  0.0      0     0 ?        S    16:46   0:00 [irq/45-vc4 hdmi hpd connected]
root         339  0.0  0.0      0     0 ?        S    16:46   0:00 [irq/46-vc4 hdmi hpd disconnected]
root         340  0.0  0.0      0     0 ?        S    16:46   0:00 [cec-vc4-hdmi-0]
root         341  0.0  0.0      0     0 ?        S    16:46   0:00 [irq/47-vc4 hdmi cec rx]
root         342  0.0  0.0      0     0 ?        S    16:46   0:00 [irq/48-vc4 hdmi cec tx]
root         343  0.0  0.0      0     0 ?        S    16:46   0:00 [irq/49-vc4 hdmi hpd connected]
root         344  0.0  0.0      0     0 ?        S    16:46   0:00 [irq/50-vc4 hdmi hpd disconnected]
root         346  0.0  0.0      0     0 ?        S    16:46   0:00 [cec-vc4-hdmi-1]
root         347  0.0  0.0      0     0 ?        S    16:46   0:00 [irq/51-vc4 hdmi cec rx]
root         348  0.0  0.0      0     0 ?        S    16:46   0:00 [irq/52-vc4 hdmi cec tx]
root         361  0.0  0.0      0     0 ?        S    16:46   0:00 [card1-crtc0]
root         362  0.0  0.0      0     0 ?        S    16:46   0:00 [card1-crtc1]
root         365  0.0  0.0      0     0 ?        S    16:46   0:00 [card1-crtc2]
root         366  0.0  0.0      0     0 ?        S    16:46   0:00 [card1-crtc3]
root         367  0.0  0.0      0     0 ?        S    16:46   0:00 [card1-crtc4]
root         368  0.0  0.0      0     0 ?        S    16:46   0:00 [card1-crtc5]
root         388  0.0  0.0      0     0 ?        S<   16:46   0:00 [SMIO]
root         399  0.0  0.0      0     0 ?        I<   16:46   0:00 [kworker/R-mmal-vchiq]
root         402  0.0  0.0      0     0 ?        I<   16:46   0:00 [kworker/R-mmal-vchiq]
root         403  0.0  0.0      0     0 ?        I<   16:46   0:00 [kworker/R-mmal-vchiq]
root         404  0.0  0.0      0     0 ?        I<   16:46   0:00 [kworker/R-mmal-vchiq]
root         406  0.0  0.0      0     0 ?        S    16:46   0:00 [irq/59-feb00000.codec]
root         409  0.0  0.0      0     0 ?        I<   16:46   0:00 [kworker/R-mmal-vchiq]
root         410  0.0  0.0      0     0 ?        I<   16:46   0:00 [kworker/R-mmal-vchiq]
root         411  0.0  0.0      0     0 ?        I<   16:46   0:00 [kworker/R-mmal-vchiq]
root         450  0.0  0.0      0     0 ?        I<   16:46   0:00 [kworker/R-cfg80211]
systemd+     483  0.0  0.1  90776  6960 ?        Ssl  16:46   0:00 /lib/systemd/systemd-timesyncd
root         514  0.0  0.0      0     0 ?        I<   16:46   0:00 [kworker/R-brcmf_wq/mmc1:0001:1]
root         516  0.0  0.0      0     0 ?        S    16:46   0:00 [brcmf_wdog/mmc1:0001:1]
root         524  0.0  0.1 238540  7504 ?        Ssl  16:46   0:00 /usr/libexec/accounts-daemon
root         527  4.0  0.1  18704  6000 ?        Ss   16:46   1:26 /usr/bin/aplay -D default -t raw -r 44100 -c 2 -f S16_LE /dev/zero
avahi        529  0.0  0.0   7364  3136 ?        Ss   16:46   0:00 avahi-daemon: running [raspberrypi4b.local]
root         535  0.0  0.1  13380  5572 ?        Ss   16:46   0:00 /usr/libexec/bluetooth/bluetoothd
root         536  0.0  0.0   6696  2404 ?        Ss   16:46   0:00 /usr/sbin/cron -f
message+     537  0.0  0.1   9700  4460 ?        Ss   16:46   0:00 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation --syslog-only
polkitd      541  0.0  0.2 311092  8776 ?        Ssl  16:46   0:00 /usr/lib/polkit-1/polkitd --no-debug
root         557  0.0  0.0      0     0 ?        I<   16:46   0:00 [kworker/u21:3-hci0]
root         561  0.0  0.1  33984  7596 ?        Ss   16:46   0:00 /lib/systemd/systemd-logind
nobody       562  0.0  0.0   5832  2552 ?        Ss   16:46   0:00 /usr/sbin/thd --triggers /etc/triggerhappy/triggers.d/ --socket /run/thd.socket --user nobody --deviceglob /dev/input/event*
root         564  0.0  0.3 396204 12240 ?        Ssl  16:46   0:00 /usr/libexec/udisks2/udisksd
avahi        575  0.0  0.0   7184  1424 ?        S    16:46   0:00 avahi-daemon: chroot helper
root         658  0.0  0.4 262824 18668 ?        Ssl  16:46   0:00 /usr/sbin/NetworkManager --no-daemon
root         659  0.0  0.2  17228 10216 ?        Ss   16:46   0:00 /sbin/wpa_supplicant -u -s -O DIR=/run/wpa_supplicant GROUP=netdev
root         696  0.0  0.2 249716 11468 ?        Ssl  16:46   0:00 /usr/sbin/ModemManager
root         735  0.0  0.1 307420  6696 ?        Ssl  16:46   0:00 /usr/sbin/lightdm
root         740  0.0  0.0  11760  1872 ?        S    16:46   0:00 /usr/sbin/xrdp-sesman
root         754  0.0  0.2  16460  8708 ?        Ss   16:46   0:00 sshd: /usr/sbin/sshd -D [listener] 0 of 10-100 startups
xrdp         757  0.0  0.0  12172  1960 ?        S    16:46   0:00 /usr/sbin/xrdp
root         771  0.0  0.0   7564  3132 tty1     Ss   16:46   0:00 /bin/login -f
root         772  0.0  0.1 162252  7216 ?        Sl   16:46   0:00 lightdm --session-child 10 14
theadmin     783  0.0  0.2  20052 10452 ?        Ss   16:46   0:00 /lib/systemd/systemd --user
theadmin     784  0.0  0.1 170520  5068 ?        S    16:46   0:00 (sd-pam)
theadmin     799  0.0  0.1  98916  6904 ?        S<sl 16:46   0:00 /usr/bin/pipewire
theadmin     800  0.0  0.1  87376  5032 ?        Ssl  16:46   0:00 /usr/bin/pipewire -c filter-chain.conf
theadmin     802  0.0  1.8 419796 70372 ?        Ss   16:46   0:00 /usr/bin/labwc -m
theadmin     813  0.0  0.0   8620  3860 ?        Ss   16:46   0:00 /usr/bin/dbus-daemon --session --address=systemd: --nofork --nopidfile --systemd-activation --syslog-only
rtkit        814  0.0  0.0  22796  2792 ?        SNsl 16:46   0:00 /usr/libexec/rtkit-daemon
theadmin     862  0.0  0.0   7396  1944 ?        Ss   16:46   0:00 /usr/bin/ssh-agent /usr/bin/labwc-pi
root         934  0.0  0.0      0     0 ?        S<   16:46   0:00 [krfcommd]
theadmin     951  0.0  0.0   2324  1220 ?        S    16:46   0:00 /bin/sh /usr/bin/lwrespawn /usr/bin/pcmanfm --desktop --profile LXDE-pi
theadmin     952  0.0  0.0   2324  1300 ?        S    16:46   0:00 /bin/sh /usr/bin/lwrespawn /usr/bin/wf-panel-pi
theadmin     953  0.0  0.0   2496  1364 ?        S    16:46   0:00 /usr/bin/kanshi
theadmin     963  0.0  0.4 340316 19208 ?        Sl   16:46   0:00 /usr/libexec/polkit-mate-authentication-agent-1
theadmin     977  0.0  0.1  16820  5868 ?        S    16:46   0:00 systemd-inhibit --what=handle-power-key gtk-nop
theadmin     981  0.0  2.0 316576 81500 ?        Sl   16:46   0:00 /usr/bin/Xwayland -auth /home/theadmin/.Xauthority :0 -rootless -core -terminate 10 -listenfd 23 -listenfd 24 -displayfd 49 -wm 46
theadmin     989  0.0  0.0   7500  3592 ?        S    16:46   0:00 xsettingsd
theadmin    1003  0.0  0.4 339940 18948 ?        Sl   16:46   0:00 gtk-nop
theadmin    1006  0.0  1.4 876384 54768 ?        Sl   16:46   0:02 /usr/bin/wf-panel-pi
theadmin    1008  0.0  1.9 540252 76208 ?        Sl   16:46   0:01 /usr/bin/pcmanfm --desktop --profile LXDE-pi
theadmin    1042  0.0  0.1 238432  7068 ?        Ssl  16:46   0:00 /usr/libexec/gvfsd
theadmin    1048  0.0  0.1   8116  4740 tty1     S+   16:46   0:00 -bash
theadmin    1067  0.0  0.1 381324  6092 ?        Sl   16:46   0:00 /usr/libexec/gvfsd-fuse /run/user/1000/gvfs -f
theadmin    1080  0.0  0.3 394236 12876 ?        Ssl  16:46   0:00 /usr/libexec/xdg-desktop-portal
theadmin    1089  0.0  0.1 461368  6588 ?        Ssl  16:46   0:00 /usr/libexec/xdg-document-portal
theadmin    1094  0.0  0.1 237500  6292 ?        Ssl  16:46   0:00 /usr/libexec/xdg-permission-store
root        1100  0.0  0.0   2224  1340 ?        Ss   16:46   0:00 fusermount3 -o rw,nosuid,nodev,fsname=portal,auto_unmount,subtype=portal -- /run/user/1000/doc
theadmin    1105  0.0  0.5 341092 21272 ?        Ssl  16:46   0:00 /usr/libexec/xdg-desktop-portal-gtk
theadmin    1107  0.0  0.3 353424 12020 ?        Ssl  16:46   0:00 /usr/libexec/gvfs-udisks2-volume-monitor
64757       1112  0.0  0.7  37368 27464 ?        Ss   16:46   0:00 python3 /usr/sbin/wsdd --shortlog --chroot=/run/wsdd
theadmin    1126  0.0  0.1 313384  7292 ?        Ssl  16:46   0:00 /usr/libexec/gvfs-afc-volume-monitor
theadmin    1133  0.0  0.1 234180  5600 ?        Ssl  16:46   0:00 /usr/libexec/gvfs-goa-volume-monitor
theadmin    1138  0.0  1.5 293068 58508 ?        Ssl  16:46   0:00 /usr/libexec/xdg-desktop-portal-wlr
theadmin    1141  0.0  0.1 234080  5836 ?        Ssl  16:46   0:00 /usr/libexec/gvfs-mtp-volume-monitor
theadmin    1145  0.0  0.1 235516  6088 ?        Ssl  16:46   0:00 /usr/libexec/gvfs-gphoto2-volume-monitor
theadmin    1150  0.0  0.2 240668  7872 ?        Sl   16:46   0:00 /usr/bin/gnome-keyring-daemon --start --foreground --components=secrets
theadmin    1153  0.0  0.2 240796  8972 ?        Ssl  16:46   0:00 /usr/bin/gnome-keyring-daemon --foreground --components=pkcs11,secrets --control-directory=/run/user/1000/keyring
theadmin    1160  0.0  0.2 312700  8156 ?        Sl   16:46   0:00 /usr/libexec/gvfsd-trash --spawner :1.14 /org/gtk/gvfs/exec_spaw/0
root        1170  0.0  0.3  78912 14680 ?        Ss   16:46   0:00 /usr/sbin/nmbd --foreground --no-process-group
root        1174  0.0  0.5  94344 21104 ?        Ss   16:46   0:00 /usr/sbin/smbd --foreground --no-process-group
theadmin    1178  0.0  0.1 157604  5604 ?        Sl   16:46   0:00 /usr/lib/menu-cache/menu-cached /run/user/1000/menu-cached-:0
root        1187  0.0  0.3  92576 11752 ?        S    16:46   0:00 /usr/sbin/smbd --foreground --no-process-group
root        1188  0.0  0.1  92568  6084 ?        S    16:46   0:00 /usr/sbin/smbd --foreground --no-process-group
root        1716  0.0  0.2  30780  8304 ?        Ss   16:46   0:00 /usr/sbin/cupsd -l
root        1717  0.0  0.3 178888 11976 ?        Ssl  16:46   0:00 /usr/sbin/cups-browsed
root        1726  0.0  0.2  19656  9620 ?        Ss   16:47   0:00 sshd: theadmin [priv]
theadmin    1732  0.1  0.1  20300  6880 ?        S    16:47   0:03 sshd: theadmin@notty
theadmin    1733  0.0  0.0   2324  1360 ?        Ss   16:47   0:00 sh
theadmin    1751  0.2  0.4  34872 16040 ?        Sl   16:47   0:05 /home/theadmin/.vscode-server/code-2901c5ac6db8a986a5666c3af51ff804d05af0d4 command-shell --cli-data-dir /home/theadmin/.vscode-server/cli --parent-process-id 1733 --on-host=127.0.0.1 --on-p
theadmin    1842  0.0  0.0   2324  1236 ?        S    16:47   0:00 sh /home/theadmin/.vscode-server/cli/servers/Stable-2901c5ac6db8a986a5666c3af51ff804d05af0d4/server/bin/code-server --connection-token=remotessh --accept-server-license-terms --start-server 
theadmin    1846  0.7  3.0 11562080 119772 ?     Sl   16:47   0:14 /home/theadmin/.vscode-server/cli/servers/Stable-2901c5ac6db8a986a5666c3af51ff804d05af0d4/server/node /home/theadmin/.vscode-server/cli/servers/Stable-2901c5ac6db8a986a5666c3af51ff804d05af0d
theadmin    1874  3.0  6.0 32965444 235924 ?     Sl   16:47   1:01 /home/theadmin/.vscode-server/cli/servers/Stable-2901c5ac6db8a986a5666c3af51ff804d05af0d4/server/node --dns-result-order=ipv4first /home/theadmin/.vscode-server/cli/servers/Stable-2901c5ac6d
theadmin    1885  0.3  1.7 1125864 69860 ?       Sl   16:47   0:06 /home/theadmin/.vscode-server/cli/servers/Stable-2901c5ac6db8a986a5666c3af51ff804d05af0d4/server/node /home/theadmin/.vscode-server/cli/servers/Stable-2901c5ac6db8a986a5666c3af51ff804d05af0d
theadmin    1896  0.4  2.0 898956 79612 ?        Sl   16:47   0:09 /home/theadmin/.vscode-server/cli/servers/Stable-2901c5ac6db8a986a5666c3af51ff804d05af0d4/server/node /home/theadmin/.vscode-server/cli/servers/Stable-2901c5ac6db8a986a5666c3af51ff804d05af0d
theadmin    1930  0.0  0.1   8252  4928 pts/3    Ss+  16:47   0:00 /bin/bash --init-file /home/theadmin/.vscode-server/cli/servers/Stable-2901c5ac6db8a986a5666c3af51ff804d05af0d4/server/out/vs/workbench/contrib/terminal/common/scripts/shellIntegration-bash.
theadmin    1963  0.0  0.1   8252  4808 pts/4    Ss+  16:47   0:00 /bin/bash --init-file /home/theadmin/.vscode-server/cli/servers/Stable-2901c5ac6db8a986a5666c3af51ff804d05af0d4/server/out/vs/workbench/contrib/terminal/common/scripts/shellIntegration-bash.
theadmin    1975  0.1  1.0 200192 42296 ?        Sl   16:47   0:02 /bin/python /home/theadmin/.vscode-server/extensions/ms-python.autopep8-2025.2.0/bundled/tool/lsp_server.py
theadmin    1997  3.8 19.0 12546868 742568 ?     Sl   16:47   1:17 /home/theadmin/.vscode-server/cli/servers/Stable-2901c5ac6db8a986a5666c3af51ff804d05af0d4/server/node /home/theadmin/.vscode-server/extensions/ms-python.vscode-pylance-2025.6.2/dist/server.b
root        2752  0.0  0.0      0     0 ?        I    16:51   0:00 [kworker/u18:3-events_unbound]
root        2753  0.0  0.0      0     0 ?        I    16:51   0:00 [kworker/u17:4-kvfree_rcu_reclaim]
root        2819  0.0  0.0      0     0 ?        I    16:52   0:00 [kworker/3:1-mm_percpu_wq]
root        2848  0.0  0.0      0     0 ?        I    16:52   0:00 [kworker/u20:0-kvfree_rcu_reclaim]
root        2849  0.0  0.0      0     0 ?        I    16:52   0:00 [kworker/u20:2-events_unbound]
root        2880  0.0  0.0      0     0 ?        I<   16:52   0:00 [kworker/1:0H]
root        2890  0.0  0.0      0     0 ?        I<   16:54   0:00 [kworker/2:0H-kblockd]
root        3023  0.0  0.0      0     0 ?        I    17:06   0:00 [kworker/1:1-mm_percpu_wq]
root        3137  0.0  0.0      0     0 ?        I    17:10   0:00 [kworker/0:0-events]
root        3138  0.0  0.0      0     0 ?        I    17:11   0:00 [kworker/1:2-mm_percpu_wq]
root        3152  0.0  0.0      0     0 ?        I    17:13   0:00 [kworker/3:0-events_power_efficient]
root        3180  0.0  0.0      0     0 ?        I    17:13   0:00 [kworker/2:1-mm_percpu_wq]
root        3250  0.0  0.0      0     0 ?        I    17:16   0:00 [kworker/0:2-events]
theadmin    3375  0.0  0.1   8120  4744 pts/5    Ss   17:18   0:00 /bin/bash
root        3937  0.0  0.0      0     0 ?        I    17:19   0:00 [kworker/3:2-events_power_efficient]
root        4056  0.0  0.0      0     0 ?        I    17:19   0:00 [kworker/1:0-events_freezable]
root        4131  0.0  0.0      0     0 ?        I    17:20   0:00 [kworker/2:0-events_freezable]
theadmin    4132  0.0  0.0   5204  1384 ?        S    17:20   0:00 sleep 180
root        4139  0.0  0.0      0     0 ?        I    17:21   0:00 [kworker/0:1-events]
theadmin    4140  500  0.1  11272  4256 pts/5    R+   17:21   0:00 ps -aux

I suggest you restart the Picar-X and then run the example code again to see if the same error persists.

Regarding the speaker not working, after executing sudo bash i2samp.sh, please run the audio example to check if the speaker produces sound.

If there is no sound, please execute the alsamixer command to increase the speaker volume to the maximum, and then run the audio example again to see the results.

I have restarted Picar-X many times by now and the problem persists.

I have also run the i2samp and alsamixer many times without getting the sound back.

When running the i2samp.sh (after powering up, nothing else done before), in the test part I get no sound and this:

Do you wish to test your system now? [y/N] y
Testing...

speaker-test 1.2.8

Playback device is default
Stream parameters are 48000Hz, S16_LE, 2 channels
WAV file(s)
Playback open error: -16,Device or resource busy

Please note that for both issues, the sound and the pin, the actual error is “GPIO busy” - as if there is some automatically started process running in the background that uses both GPIOS and that process was not running before.

How can I figure out which process is running now and wasn’t before?
Can you give me output from ps -aux on a “clean” Picar-X?

Based on the information you provided, the error message indicates that GPIO16 (BCM16, physical pin 36) is occupied, preventing your program from accessing it.
Aside from the normal connection to our product hardware, are the GPIO pins connected to anything else?
Have you made any software configurations?

If a restart doesn’t resolve the issue, I recommend reinstalling the operating system, then installing all the library codes again, and running the example to see how it works.

I haven’t done any changes to software configuration or similar - it just started behaving like that suddenly.

I will make a fresh install on a new SD card and see what happens. It may take some time as I’m busy with other stuff right now. I’ll report back when I have something new.

Thank you for assistance!

Should you encounter any further issues during setup or have additional questions, please don’t hesitate to contact us—we’ll be glad to assist.