Brave testers of Picochess V4

691 views
Skip to first unread message

Johan Sjöblom

unread,
May 25, 2025, 4:35:22 AMMay 25
to PicoChess
Hi

For the brave testers of Picochess V4 I have now fixed the PicoTalker to be asynchronous. This means that Pico V4 now talks without blocking anything else. You can go ahead and move faster now, without waiting for the move announcements. This is now version 4.1.3.

It no longer uses the sox Linux system library to produce sounds, it uses the Python pygame library. This could cause some issues, but it could also solve some issues. One upside could be that it should no longer is depending on how you configure your Linux, its possible that you no longer need to use PulseAudio... I have not tested that yet.

If it produces any side effects that we switch to a full Python async solution please let me know. Hopefully it can be fixed.

yours, Johan


Johan Sjöblom

unread,
May 25, 2025, 7:08:30 AMMay 25
to PicoChess
One idea for improvement is to try to normalize the sound.  For example Al’s OGG files are ”louder” than Christina’s.

It would be easy to set a sound level in Picochess Python, but that level would not be absolute. Different voice files would need different gains. At the moment I am not setting the sound level.

A fairly complex solution would be to scan all the sound OGG files for decibel gain (plus or minus) need. Store that fairly static information as a file, and then adjust the gain in PicoTalker. A little bit simpler solution would be to store an average gain for all voices, not per voice file.

Maybe someone knows how the current Pico 3.3 handles this? Maybe that could give other ideas?

Dirk

unread,
May 25, 2025, 7:12:06 AMMay 25
to pico...@googlegroups.com, PicoChess
I think Randy normalized all sound files in his images but I am not sure…

We can already set up the sound volume for the voices in picochess but as you have noticed this is for all sound files independent of their specific sound levels…

Von meinem iPad gesendet

Am 25.05.2025 um 13:08 schrieb Johan Sjöblom <messi...@gmail.com>:

One idea for improvement is to try to normalize the sound.  For example Al’s OGG files are ”louder” than Christina’s.
--
You received this message because you are subscribed to the Google Groups "PicoChess" group.
To unsubscribe from this group and stop receiving emails from it, send an email to picochess+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/picochess/cd3a64b2-5750-4c43-b42d-3961554db9d6n%40googlegroups.com.

Randy Reade

unread,
May 25, 2025, 11:11:08 AMMay 25
to pico...@googlegroups.com
Yes, I normalized all the voices in my images a few years ago using the vorbisgain program.

I think if you switch to pygame you will lose the ability to change the speed/tempo of the voices. Also, if someone is using xrdp they should test the audio (e.g. for the retro engine artwork).

Randy

Johan Sjöblom

unread,
May 25, 2025, 12:38:26 PMMay 25
to PicoChess
As the installation script and repo still have bugs, please make sure you have a backup of your voices.ini file.
When I fix it from disappearing it will reset at least one more time. For instance, if I remove it from the repository (where no ini file should be) the next update will delete your local copy. For the moment, please use a backup.

Yes, pygame cannot change speed or pitch. I added pydub logic, which supports speed changes, but not pitch, so you currently get a Mickey Mouse effect for speeding. It should be possible to use add the use of numpy and librosa to also update the pitch and still have a pure Python solution without any system calls.

Just wondering, Do we really need a speed setting? If talking no longer blocks anything, why would we need speed? Could an alternative be that we skip some talking if the talking ”queue” gets too large (=lags). Or some other solution.

And should I add a small pause beteeen different voices in the voice playing queue?

BR, Johan

Randy Reade

unread,
May 25, 2025, 12:59:05 PMMay 25
to pico...@googlegroups.com
Some of the voice recordings are a bit slow so it's nice to be able to make them faster and sound more natural. It's a personal preference of course. And I only use the English voices. Can't comment on the other languages.

Dirk

unread,
May 26, 2025, 7:15:08 AMMay 26
to PicoChess
another reason for speed changing is when you play Blitz or Bullet then voice announcement are way quicker so you can play (and win!?) longer without loosing (and when using DGT eBoards  you rely on speech move announcements!) ;-)

Dirk

unread,
May 26, 2025, 7:27:16 AMMay 26
to PicoChess
Regarding a pause between voice announcements: I don't think we need this at least this has never been an issue  in 3.3.

But I think we might need something to display all TEXT messages in full-length with correct display times: If there are multiple text messages in the display queue sometimes the display of a text is skipped by showing immediately the newest one which shouldn't happen.

I think in 3.3 (and beyond) this (the pause between or display time) was controlled correctly by some parameters when throwing an event with text and voice output (but I never have understood the exact logic)...

RandyR

unread,
May 26, 2025, 1:24:58 PMMay 26
to PicoChess
Just to explain this a bit further - the vorbisgain program does not alter the actual sound file (.ogg) but instead adds metadata specifying the amount of gain or attenuation needed to normalize the volume. Not every player recognizes or reads this (replaygain) data. SoX does and it defaults to track normalization. Using 'play' (the SoX player that PicoChess v3 uses) will produce volume normalization:

play /opt/picochess/talker/voices/en/christina/engine_setup.ogg
play /opt/picochess/talker/voices/en/christina/picoChess.ogg

To hear how the .ogg files sound without normalization you can use the following examples (the volume difference of these is quite noticeable):

play --replay-gain off /opt/picochess/talker/voices/en/christina/engine_setup.ogg
play --replay-gain off /opt/picochess/talker/voices/en/christina/picoChess.ogg

You can use the vorbiscomment program to read the tags added by vorbisgain:

vorbiscomment /opt/picochess/talker/voices/en/christina/engine_setup.ogg
vorbiscomment /opt/picochess/talker/voices/en/christina/picoChess.ogg

I don't think pygame or pydub utilize this metadata to normalize volume.

Randy

Johan Sjöblom

unread,
May 26, 2025, 1:40:24 PMMay 26
to PicoChess
At the moment the pygame/pydub Python solution does not normalize sounds no. But it can. A script could scan all voice files and write the gains needed (chatgpt already made me an example script when I asked it). The python can then apply + or - gain for all deviations larger than 1%. This will reduce the speed of producing voice of course as the python needs to process the normalization, so the absolute best way would be to normalize or make new speedy voice files for Blitz use! Even the use of speed adjustment makes the Python solution slower, but in particular dependent on more libraries. The best solution would of course be to pre-process all sound files or get new speedy ones.

Other stuff: I tried to fix a few other issues now, while waiting for the white paint to dry for another round on my yard :-) Yes, it starts to be summer even here in mid-Finland!

First of all I have removed voices.ini from the repository. No ini file should be in the repository. Next update might unfortunately still reset your voices ini once more,... Because first it deletes voices.ini from your local repository and then the install script sees that you don't have one, and it will copy the new example-voices.ini there as if you were a totally new user. Now after this you can overwrite the voices.ini with your own voices ini and this should not happen again in any further updates as its now removed from the repo and ignored by git. If there are more ini files somewhere in the repo that I have not notices please let me know. The repo should not contain any ini files, only example ini files that are copied on empty/first installs.

Secondly there was something wrong with trying to exclude engines and mame folders... I hard-coded them into the script instead of trying to be clever and using env variables. It should now work and engines and mame folders should not be backed up.

Thirdly, I now tested to add a 300msec between different voice announcements as that is the standard way to do with UX nowadays (according to the experts in my day job). It now sounds more like Pico 3.3, especially when starting up. The reason I believe is that there is now longer any pico 3.3 delay between talking caused by external system call to SOX library and the fact that Pico 3.3 "only used 1 thread" for the entire PicoTalker while I use several async tasks and also async thread when loading the files. In essence the new talker runs all the time, ... talking from the queue. So to get them to the same level I think this 300msec was necessary between different talk events. I thought it sounded better now.

And I would also need more time to play... but I thought that the clock would not start before I make the computer move on my DGT board... Have to test... If the clock starts immediately after the move announcement we need to consider how we could get that upside back to us human players :-)

Thanks for the hint on TEXT message display times... There indeed seems to be a parameter in the message with name "wait".
    DISPLAY_TEXT = ClassFactory(
        DgtApi.DISPLAY_TEXT,
        ["web_text", "large_text", "medium_text", "small_text", "beep", "maxtime", "devs", "wait", "ld", "rd"],
    )
But taking a quick look through all the display_text_on_clock I could not see that wait parameter being used. Need to find out more on how to time TEXT displays. Maybe one simply has to add fixed sleep times on the correct places?

Johan


Johan Sjöblom

unread,
May 27, 2025, 10:31:24 AMMay 27
to PicoChess
I think speed is fixable with pitch compensation (to avoid Mickey Mouse effect).
Also sound volume normalisation is fixable. For clarity I will open these as separate issues.

On the topic of timing Display Text, I would need an example of a situation where timing is important and where it is currently wrong. Wait parameter mentioned is a True/False. I need to investigate Pico 3.3 code to see if there is a timing mechanism.

Dirk

unread,
May 27, 2025, 11:03:41 AMMay 27
to pico...@googlegroups.com, PicoChess
Regarding the text Display problems: I have written Game comments active and the opening Explorer somewhere might be lots of additional text messages besides the engines answer move ( score and after that) which might oberride the engine answer move before it had been executed on the board. But you are right: this happens not all the time (maybe only when the display queue has a certain length!?

As I did not know how the wait statements etc. in the display routine  exactly worked I added probably some python sleep statements to achieve that - that might have been lost by the new async handling…

Am 27.05.2025 um 16:31 schrieb Johan Sjöblom <messi...@gmail.com>:

I think speed is fixable with pitch compensation (to avoid Mickey Mouse effect).
--
You received this message because you are subscribed to the Google Groups "PicoChess" group.
To unsubscribe from this group and stop receiving emails from it, send an email to picochess+...@googlegroups.com.

Johan Sjöblom

unread,
May 27, 2025, 11:29:01 AMMay 27
to PicoChess
Thanks for the clarification. To test and repeat the problem I guess I therefore need to use a DGT board and have the following setting to get a lot of additional text messages:
tutor-comment = all
Yes, the non-async time.sleep(X) are removed. They can, and have to great extent been replaced by "await asyncio.sleep(X)". That async flow stops for a while and it switches to run something else... so Yes that could be the problem. Lets see if I can learn whats going on...

Johan Sjöblom

unread,
May 27, 2025, 2:01:46 PMMay 27
to PicoChess
Did some serious detective work, but no concrete results yet, except for the last line of this message, skip there if you think that could help.

I did not find any missing sleep when comparing to Pico 3.3. I did find some timing mechanisms ...  Nothing that explains this yet. The wait in the COMPUTER_MOVE and DISPLAY_MOVE message is True if inbook is being shown. But that wait parameter is not used to show text or clock. There is also a maxtime given on DISPLAY_TEXT messages... sometimes 0,1 sometimes 1,0 second. That mechanism delays all the other tasks.

We would need a mechanism to delay all other messages on the clock between COMPUTER_MOVE and COMPUTER_MOVE_DONE when using DGT boards. This way it would in my understanding keep showing the computer move I need to perform on the DGT board.
The sequence for the normal computer move is this in both Pico V4 and V3.3
1. DisplayMsg.show(Message.BOOK_MOVE())
2. DisplayMsg.show(Message.COMPUTER_MOVE(...))
Logic here has not changed.
From here nothing should happen until user performs the move on the DGT board... So maybe one option would to be to try to empty potential overflow of messages happening in parallel with this computer move?

After looking through many candidates I found self.play_move in display.py. It only contains a non-null move between these two events while waiting for the user. So maybe this could be used as a "signal".

Experiment: I can prevent PICOTUTOR_MSG while we are waiting for a user move on the DGT board if we think that could help?? That's the only thing I found this evening in the "detective work". It would be a one-line change, and it would be easy to change back, if someone can verify that it helps?!

Johan

Dirk

unread,
May 28, 2025, 8:02:47 AMMay 28
to PicoChess
Hi Johan, 

I just have answered onIMG_7806.jpeg github:

Don't know why the display output is so faulty now: I still get text message outputs during the display of the engines answer move when picochess should wait for the user executing the engines move on the board (by the way this has nothing to do with DGT eBoards - it is independent of the type of eBoard).

Even worse: Now the clock starts to run for the user although the engines move has not been executed on the board!? (clocks should pause for this period otherwise running clock changes would be displayed instead of the engines move...

Normally the text display and voice output events are only triggered by the picochess logic when the corresponding text outputs could be displayed without any problems (eg PicoTutor only triggers when it is YOUR move and only after the tutor display the engine will get the (eventually Patzer move) of the user and starts sthinking etc. So normally there are no pause/waits etc. necessary if I remember correctly.

Here you see the flashing LED answer move to be executed by the user although time is running already and no display of the move anymore: (of course id clock is running it will override the text display but there are also cases when a comment output will override the engines answer move! 

Johan Sjöblom

unread,
May 28, 2025, 12:35:49 PMMay 28
to PicoChess
I am debugging on my DGT board now... It seems the computer clock is not stopped when the computer BEST_MOVE is announced... Thats at least one reason why the display gets overridden... Lets see if I can find the spot to fix.

Johan Sjöblom

unread,
May 28, 2025, 1:27:01 PMMay 28
to PicoChess
Well,... could it actually be this sensitive to timing... I added a sleep of 0.7 that I had removed thinking that it would not be needed in async any more.
Maybe someone would recognize the below part of the picochess code comment :-)

Could it really be this simple? And sensitive? It indeed seems that the missing 0.7 sleep caused the computer clock to not stop before user made move on the DGT (or other electronic) board?

await DisplayMsg.show(Message.CLOCK_STOP(devs={"ser", "i2c", "web"}))
await asyncio.sleep(0.7)
# @todo give some time to clock to really do it. Check this solution!

Strange indeed... Let me know if this really fixes at least the worst part of issue 45... You should now see the computer move all the time on the display, and no clocks running before you have moved on the computers behalf on the electronic board.

Johan

Johan Sjöblom

unread,
May 29, 2025, 10:48:29 AMMay 29
to PicoChess
I think I found one basic problem. The program used async create_task a little bit too heavily. I have not taken a step back on that. Hopefully that did not make the program slower in any way. This fix should make the messages appear more like they are in Pico 3.3, hopefully without losing speed or that something blocks.
Johan

Dirk

unread,
May 30, 2025, 4:54:13 AMMay 30
to pico...@googlegroups.com

Yes Johan,

first tests look promising!

I never experienced any (severe?) processing speed problems in 3.3 because of the text or speech displaying queues or blocking of other functions (only when an engine crashes or could not be selected correctly because of corrupted ini files…)

Thanks
Dirk

Johan Sjöblom

unread,
May 30, 2025, 7:38:56 AMMay 30
to PicoChess
Thanks for the feedback. Good to know.

Randy found a bug in the install script ( https://github.com/JohanSjoblom/picochess/issues/67 ), and yes indeed the current install script had an error that some git commands where performed without "sudo -u pi" which caused the git command to be performed as root (because you need to run the install script as root). Not good. Good catch by Randy. Thanks for that.

I have now fixed it, but the old buggy install script that you have on your local disc might cause problems for some users, especially if you have done a system update. The safest way would be for you do fetch a new installer and not run the existing installer at all.

do this (copy paste from readme), you can be in your home dir when you do this
You can post a reply here if you have problems, or add comments to the above mentioned and linked issue 67

Johan

Johan Sjöblom

unread,
May 30, 2025, 7:57:22 AMMay 30
to PicoChess
PS Later I need to do one more fix to the install script. NOTE: if you have an empty /opt/picochess the script will be fooled into thinking it can do a git update. So if you have deleted the content of picochess folder, at the moment you also need to remove the folder itself. DS

Henri

unread,
May 31, 2025, 2:03:09 PMMay 31
to PicoChess
Hi Johan

I tried to (re)install picochess as stated above. I deleted the picochess folder, downloaded the script 'install-picochess.sh' to home/pi, make it executable and ran it:

---------------------------------------------------
System updates done - Starting Picochess installation
 ---------------------------------------------------
 -------
fetching picochess...
fatal: could not create work tree dir 'picochess': Permission denied
chown: cannot access '/opt/picochess': No such file or directory
./install-picochess.sh: 147: cd: can't cd to picochess
creating logs dir for pi user
mkdir: cannot create directory ‘/opt/picochess/logs’: No such file or directory

-------
So I created the folder /opt/picochess and ran it again:
-------

picochess already exists, creating BACKUP ...
Creating backup in: /home/pi/pico_backups/current
Saving git diff...
warning: Not a git repository. Use --no-index to compare two paths outside a working tree
usage: git diff --no-index [<options>] <path> <path>

Diff output format options
    -p, --patch           generate patch
    -s, --no-patch        suppress diff output
    -u                    generate patch
    -U, --unified[=<n>]   generate diffs with <n> lines context
    -W, --function-context
                          generate diffs with <n> lines context
    --raw                 generate the diff in raw format
    --patch-with-raw      synonym for '-p --raw'
    --patch-with-stat     synonym for '-p --stat'
    --numstat             machine friendly --stat
    --shortstat           output only the last line of --stat
    -X, --dirstat[=<param1,param2>...]
                          output the distribution of relative amount of changes for each sub-directory
    --cumulative          synonym for --dirstat=cumulative
    --dirstat-by-file[=<param1,param2>...]
                          synonym for --dirstat=files,param1,param2...
    --check               warn if changes introduce conflict markers or whitespace errors
    --summary             condensed summary such as creations, renames and mode changes
    --name-only           show only names of changed files
    --name-status         show only names and status of changed files
    --stat[=<width>[,<name-width>[,<count>]]]
                          generate diffstat
    --stat-width <width>  generate diffstat with a given width
    --stat-name-width <width>
                          generate diffstat with a given name width
    --stat-graph-width <width>
                          generate diffstat with a given graph width
    --stat-count <count>  generate diffstat with limited lines
    --compact-summary     generate compact summary in diffstat
    --binary              output a binary diff that can be applied
    --full-index          show full pre- and post-image object names on the "index" lines
    --color[=<when>]      show colored diff
    --ws-error-highlight <kind>
                          highlight whitespace errors in the 'context', 'old' or 'new' lines in the diff
    -z                    do not munge pathnames and use NULs as output field terminators in --raw or --numstat
    --abbrev[=<n>]        use <n> digits to display object names
    --src-prefix <prefix>
                          show the given source prefix instead of "a/"
    --dst-prefix <prefix>
                          show the given destination prefix instead of "b/"
    --line-prefix <prefix>
                          prepend an additional prefix to every line of output
    --no-prefix           do not show any source or destination prefix
    --inter-hunk-context <n>
                          show context between diff hunks up to the specified number of lines
    --output-indicator-new <char>
                          specify the character to indicate a new line instead of '+'
    --output-indicator-old <char>
                          specify the character to indicate an old line instead of '-'
    --output-indicator-context <char>
                          specify the character to indicate a context instead of ' '

Diff rename options
    -B, --break-rewrites[=<n>[/<m>]]
                          break complete rewrite changes into pairs of delete and create
    -M, --find-renames[=<n>]
                          detect renames
    -D, --irreversible-delete
                          omit the preimage for deletes
    -C, --find-copies[=<n>]
                          detect copies
    --find-copies-harder  use unmodified files as source to find copies
    --no-renames          disable rename detection
    --rename-empty        use empty blobs as rename source
    --follow              continue listing the history of a file beyond renames
    -l <n>                prevent rename/copy detection if the number of rename/copy targets exceeds given limit

Diff algorithm options
    --minimal             produce the smallest possible diff
    -w, --ignore-all-space
                          ignore whitespace when comparing lines
    -b, --ignore-space-change
                          ignore changes in amount of whitespace
    --ignore-space-at-eol
                          ignore changes in whitespace at EOL
    --ignore-cr-at-eol    ignore carrier-return at the end of line
    --ignore-blank-lines  ignore changes whose lines are all blank
    -I, --ignore-matching-lines <regex>
                          ignore changes whose all lines match <regex>
    --indent-heuristic    heuristic to shift diff hunk boundaries for easy reading
    --patience            generate diff using the "patience diff" algorithm
    --histogram           generate diff using the "histogram diff" algorithm
    --diff-algorithm <algorithm>
                          choose a diff algorithm
    --anchored <text>     generate diff using the "anchored diff" algorithm
    --word-diff[=<mode>]  show word diff, using <mode> to delimit changed words
    --word-diff-regex <regex>
                          use <regex> to decide what a word is
    --color-words[=<regex>]
                          equivalent to --word-diff=color --word-diff-regex=<regex>
    --color-moved[=<mode>]
                          moved lines of code are colored differently
    --color-moved-ws <mode>
                          how white spaces are ignored in --color-moved

Other diff options
    --relative[=<prefix>]
                          when run from subdir, exclude changes outside and show relative paths
    -a, --text            treat all files as text
    -R                    swap two inputs, reverse the diff
    --exit-code           exit with 1 if there were differences, 0 otherwise
    --quiet               disable all output of the program
    --ext-diff            allow an external diff helper to be executed
    --textconv            run external text conversion filters when comparing binary files
    --ignore-submodules[=<when>]
                          ignore changes to submodules in the diff generation
    --submodule[=<format>]
                          specify how differences in submodules are shown
    --ita-invisible-in-index
                          hide 'git add -N' entries from the index
    --ita-visible-in-index
                          treat 'git add -N' entries as real in the index
    -S <string>           look for differences that change the number of occurrences of the specified string
    -G <regex>            look for differences that change the number of occurrences of the specified regex
    --pickaxe-all         show all changes in the changeset with -S or -G
    --pickaxe-regex       treat <string> in -S as extended POSIX regular expression
    -O <file>             control the order in which files appear in the output
    --rotate-to <path>    show the change in the specified path first
    --skip-to <path>      skip the output to the specified path
    --find-object <object-id>
                          look for differences that change the number of occurrences of the specified object
    --diff-filter [(A|C|D|M|R|T|U|X|B)...[*]]
                          select files by diff type
    --output <file>       output to a specific file

Backing up untracked files...
fatal: not a git repository (or any of the parent directories): .git
Syncing working directory...
Backup safely stored at: /home/pi/pico_backups/current
 -------
picochess already exists, updating code...
fatal: not a git repository (or any of the parent directories): .git
WARNING: You are on branch '', not 'master'.
Skipping update to avoid interfering with work on another branch.
Backup completed at: /home/pi/pico_backups/current

--------
So where do I go from here?

Henri

Op vrijdag 30 mei 2025 om 13:57:22 UTC+2 schreef messi...@gmail.com:

Randy Reade

unread,
May 31, 2025, 2:06:15 PMMay 31
to pico...@googlegroups.com
sudo ./install-picochess.sh

--
You received this message because you are subscribed to the Google Groups "PicoChess" group.
To unsubscribe from this group and stop receiving emails from it, send an email to picochess+...@googlegroups.com.

Henri

unread,
May 31, 2025, 2:13:58 PMMay 31
to PicoChess
Done that, been there.

 ---------------------------------------------------
System updates done - Starting Picochess installation
 ---------------------------------------------------
 -------
fetching picochess...
fatal: could not create work tree dir 'picochess': Permission denied
chown: cannot access '/opt/picochess': No such file or directory
./install-picochess.sh: 147: cd: can't cd to picochess
creating logs dir for pi user
mkdir: cannot create directory ‘/opt/picochess/logs’: No such file or directory

etc..

Johan Sjöblom

unread,
May 31, 2025, 2:16:17 PMMay 31
to pico...@googlegroups.com
Did you run the script as sudo?

--
You received this message because you are subscribed to the Google Groups "PicoChess" group.
To unsubscribe from this group and stop receiving emails from it, send an email to picochess+...@googlegroups.com.

Randy Reade

unread,
May 31, 2025, 2:19:35 PMMay 31
to pico...@googlegroups.com
sudo rm -rf /opt/picochess 
sudo ./install-picochess.sh

--
You received this message because you are subscribed to the Google Groups "PicoChess" group.
To unsubscribe from this group and stop receiving emails from it, send an email to picochess+...@googlegroups.com.

Henri

unread,
May 31, 2025, 2:19:38 PMMay 31
to PicoChess
Yes

Op zaterdag 31 mei 2025 om 20:16:17 UTC+2 schreef messi...@gmail.com:

Henri

unread,
May 31, 2025, 2:26:53 PMMay 31
to PicoChess
Result of:
sudo rm -rf /opt/picochess 
sudo ./install-picochess.sh

---------------------------------------------------
System updates done - Starting Picochess installation
 ---------------------------------------------------
 -------
fetching picochess...
fatal: could not create work tree dir 'picochess': Permission denied
chown: cannot access '/opt/picochess': No such file or directory
./install-picochess.sh: 147: cd: can't cd to picochess
creating logs dir for pi user
mkdir: cannot create directory ‘/opt/picochess/logs’: No such file or directory

etc.

Op zaterdag 31 mei 2025 om 20:19:35 UTC+2 schreef RandyR:

Randy Reade

unread,
May 31, 2025, 2:36:34 PMMay 31
to pico...@googlegroups.com
Did you mistakenly remove the /opt folder?

What do you see with:

ls -la /opt

Henri

unread,
May 31, 2025, 2:40:36 PMMay 31
to PicoChess
It's there alright:

pi@picochess:~ $ pi@picochess:~ $ ls -la /opt
total 16
drwxr-xr-x  4 root root 4096 May 31 19:54 .
drwxr-xr-x 19 root root 4096 May 31 19:24 ..
drwxr-xr-x  3 root root 4096 May  6 15:24 pigpio
drwxr-xr-x  4 root root 4096 May  6 15:26 WidevineCdm

Op zaterdag 31 mei 2025 om 20:36:34 UTC+2 schreef RandyR:

Henri

unread,
May 31, 2025, 2:43:01 PMMay 31
to PicoChess
I'll stick to Picochess betaversion 4.1.0 for now. I do not feel brave, I feel utterly stupid.

Henri

Op zaterdag 31 mei 2025 om 20:36:34 UTC+2 schreef RandyR:
Did you mistakenly remove the /opt folder?

RandyR

unread,
May 31, 2025, 2:44:51 PMMay 31
to PicoChess
That's very strange. Perhaps the script got corrupted?

cd ~
rm ./install-picochess.sh
wget -L https://raw.github.com/JohanSjoblom/Picochess/master/install-picochess.sh
chmod a+x install-picochess.sh
sudo ./install-picochess.sh

Johan Sjöblom

unread,
May 31, 2025, 2:52:48 PMMay 31
to PicoChess
Sounds like a good advice to try downloading the script again. A little bit of strange bad luck somewhere now. Maybe patience is what is needed, not bravery. We can still learn something from this :-) … I hope.

Henri

unread,
May 31, 2025, 3:20:31 PMMay 31
to PicoChess
Sure, tried a fresh image. Same outcome. I'll wait until there is an image with a proper update option. At least that is a lesson I have learned today :)

Henri

Op zaterdag 31 mei 2025 om 20:52:48 UTC+2 schreef messi...@gmail.com:

Johan Sjöblom

unread,
May 31, 2025, 3:52:38 PMMay 31
to PicoChess
I think I figured out what is wrong. Its late now, but I will fix the install script tomorrow. I used chatgpt to review the script for errors and I think I was fooled by one of the chatgpt suggestions. I will post her when I have fixed the install script.
Johan

Henri

unread,
May 31, 2025, 4:11:49 PMMay 31
to PicoChess
Good, can't wait! :) And sorry for sounding a bit negative. On the positive, I am really impressed by the increase of speed of picochess I noticed in the betaversion, it's quite snappy, impressive!

Henri

Op zaterdag 31 mei 2025 om 21:52:38 UTC+2 schreef messi...@gmail.com:

Johan Sjöblom

unread,
Jun 1, 2025, 2:40:32 AMJun 1
to PicoChess
Good morning.
Seems its easy to make mistakes in the install script. Sorry about that. I have now tried to fix the install script to handle more situations. I will test it myself later today on my Pi 4 setup, for now I only test ran it on my Debian machine. It was not a major change, but a needed one. So using the famous words "now it should work" :-)

Let me know if the install script still doesn't work. If you already have a working solution you will get the new install script by running your existing install script or updating pico (which will pull the new install script for next update). If you don't have a working update or install script you need to do the wget according to the readme (same as Randys advice above).

Open a new terminal window from the menu, or do cd ~ (to home dir in an existing terminal)
chmod a+x install-picochess.sh
sudo ./install-picochess.sh

- Johan

Henri

unread,
Jun 1, 2025, 6:06:23 AMJun 1
to PicoChess
Yes, the install script now works well over here on my Pi4, I have successfully upgraded Picochess to version 4.1.3. Thanks for all the effort!

Henri

Op zondag 1 juni 2025 om 08:40:32 UTC+2 schreef messi...@gmail.com:

Johan Sjöblom

unread,
Jun 1, 2025, 6:32:21 AMJun 1
to PicoChess
Wow. Nice to hear. I also tested on my Pi4 with display and it worked. These temporary problems were basically caused by that I needed to make sure that all git commands was performed as normal pi user. This is considered good practice. The only reason why the install script needs root is because it needs to upgrade the system and install needed libraries. Now everything in /opt/picochess is managed by the local pi user.

At the moment the pico system upgrade does not do system upgrade, only library installations and picochess code update. If you ever do update the system yourself pico will lose the rights to work on port 80 for instance. After each system update the install script needs to be run again.
That is actually an open question on how we want it to be...I can change the pico update system so that it would also always update the system... The upside would be that we stay updated all the time, but the downside might be that a system update could break the pico. This downside is the primary reason why I left out system update from the pico update. The other downside reason is updatespeed, sometimes the system update can take quite a while on a Pi4.

How does the updater work? If you ask for an update from Pico menu it will set a flag so that the install script is run at next boot. At next boot it then runs the install script with the "pico" parameter which makes the install script skip the system update but update system and python libraries. Whenever you want to manually update the pico code you can also use "pico" to avoid the long system update:
sudo /opt/picochess/install-picochess.sh pico
Above request is what is performed on system boot after you ask for update in the Pico menu.

Johan

Henri

unread,
Jun 9, 2025, 7:01:54 AMJun 9
to PicoChess
Hi there Johan,

Playing with version 4.1.3, like it a lot! But I hate the voice-configuration. The voices are slower in normal mode, the pauses between parts of messages are way too long (f.i. in move announcement like e2-e4) and pitching the voices leads to mickey mouse style output. Please, please, with sugar on top, restore the voice configuration version 3.3., or at least tell me how to do it.

It's a matter of taste and no bug, so I'm saying it here.

Henri

Op maandag 26 mei 2025 om 19:40:24 UTC+2 schreef messi...@gmail.com:

Johan Sjöblom

unread,
Jun 9, 2025, 12:43:18 PMJun 9
to PicoChess
Hi.

Its really good to get honest direct feedback. Thats the only way we can improve :-)

I agree that the new voice configuration needs work. Its a classical problem that I only had time to do the bear essentials of the new full Python pygame library solution, which means that I replaced a full voice solution with a half-way one. Not good. In this current situation it means that the new pygame library solution is still missing necessary features like pitch correction and volume normalisation. I have not even written them in the issue list yet, but yes I consider these missing features to be a bug and I was about to add them myself to the issue list! Our opinions agree here :-)

Until I have time to complete those needed features (=fix pitch and normalisation bugs)  I will go back to playing sound using the sox system library. I will not go all the way back to exactly the same as 3.3, only on how it plays the sound files after it has loaded them from disc. That should fix the pitch and normalisation to how it was in 3.3 I hope that I can put it back without blocking. Lets see how it works. I will try to take a step back. I will post here when I have done it.

I also hope that the 3.3 sox ”playing sound” solution still works with the newest image. I have not removed Sox from the requirements.txt list so sox should be available in all images.

Johan

Randy Reade

unread,
Jun 9, 2025, 1:08:27 PMJun 9
to pico...@googlegroups.com
I believe it will work. I tested going back to your picotalker.py commit before the pygame change and the sound was OK, but obviously there were issues using that version with the current updated files. So some work will be needed as you expected.

I also agree that sox is the way to go until pitch and volume normalization are better handled by pygame/pydub/ffmpeg. Or maybe just stay with sox?

Randy

Johan Sjöblom

unread,
Jun 10, 2025, 1:54:13 PMJun 10
to PicoChess
Ok brave testers, at least patient ones :-) 
I have now updated the sound playing part back to using a sox library. I tested with speed 8 and it worked for me.
This is not exactly the same code as Pico V3, but the command to actually play the sound is now changed back to exactly the same as V3

If you do a system update now, next time you start picochess it should use it.

Johan

Henri

unread,
Jun 10, 2025, 2:42:21 PMJun 10
to PicoChess
That was quick! The updating process worked fine, although a message before rebooting like 'Johan messed succesfully with your picochess from afar, it has been updated en will now reboot' would be nice :) 
I played a couple of games and it sure is an huge improvement, it's almost like 3.3 again! I say almost, because it seems sometimes a sound is cut off slightly at the start. Have to test further to find out more. Let's say you're on 90% of perfection at the mo.

Thanks a lot!

Henri 

Op dinsdag 10 juni 2025 om 19:54:13 UTC+2 schreef messi...@gmail.com:

RandyR

unread,
Jun 10, 2025, 4:45:57 PMJun 10
to PicoChess
Yes, a notification on the desktop when an update is in progress would be nice, even a console window showing the update progress (tail -f /var/log/picochess-update.log).

If you aren't using my latest v4 image (from 7 or 8 June), you can switch to PulseAudio in raspi-config and then edit the /etc/pulse/default.pa file to prevent PulseAudio from suspending audio devices which can cause cut-off audio:

sudo nano /etc/pulse/default.pa

Add a hash mark ('#') to the start of line 110 so it looks like this:

#load-module module-suspend-on-idle

If you are already using that image then it must be something else.

Randy

Johan Sjöblom

unread,
Jun 11, 2025, 12:34:39 AMJun 11
to PicoChess
As its now back to using a system call ”play” it is now more sensitive to correct audio setup yes. The current solution keeps playing the picotalker sounds from a queue of all requested sounds. I guess there could be a theoretical possibility that playing 2 sounds close to each other ”eats a small portion” of the previous one… One possibel solution if this is the case could be to add a small pause of 100-300msec between sounds?
Reply all
Reply to author
Forward
0 new messages