Webserver display: turn off voice messages?

288 views
Skip to first unread message

DJ Dekker

unread,
May 11, 2025, 2:51:13 AM5/11/25
to PicoChess
Hi Picochess users,

When using the webserver display, all moves are being announced by the computer voice. Is there a way to turn this voice off?

I have commented out the voices in picochess.ini, but this does not seem to affect the webserver.

Greetings,
DJ

Johan Sjöblom

unread,
May 11, 2025, 3:25:03 AM5/11/25
to pico...@googlegroups.com

When developing Pico V4 I found something similar. The pico web javascript also announces moves. For some reason this has never produced sounds on a Raspberry PI, but on a Debian machine it will. Maybe the javascript sound has started working and it then announces all moves?


In pico V4 we are at the moment experimenting with a new portrait web solution, and that might have reintroduced this same issue in the latest V4 also (only in the latest commit).


Check if it could be the web browser producing the sound. Pico server will not if you comment out the voices like you did.


--
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/3018641d-441e-4f6b-952d-8e2949eb5261n%40googlegroups.com.

DJ Dekker

unread,
May 11, 2025, 9:38:31 AM5/11/25
to PicoChess
Hi Johan,

Yes, it's certainly the web browser that is producing the sound – I have no speakers connected to my DGT Pi.

Greetings,
DJ

Op zondag 11 mei 2025 om 09:25:03 UTC+2 schreef messi...@gmail.com:

Johan Sjöblom

unread,
May 11, 2025, 10:18:01 AM5/11/25
to PicoChess
Thanks. I copied Dirks new web solution on top of the existing one, and I had forgot that I actually changed one line (!) in the entire web browser solution from Pico 3.3.. I had removed the javascript sound by commenting out one row as you see below. I have now updated the master. Next update it should now update for you to. I dont know why no-one have noticed this with Pico 3.3, it must be just some web browser setups that enable this speach? Anyway fixed now.

In file /opt/picochess/web/picoweb/static/js/app.js. On roughly line 60 you find the following where I uncommented the last command which sends speak in the browser. Now it looks like this again:

function talk(text) {

    if (speechAvailable) {

    var msg = new SpeechSynthesisUtterance(text);

    msg.lang = "en-US";

    if (myvoice != "") {

    msg.voice = myvoice;

    }

    // window.speechSynthesis.speak(msg);

}




Randy Reade

unread,
May 11, 2025, 10:19:30 AM5/11/25
to pico...@googlegroups.com

Hi DJ,
To turn off the browser speech you can comment out the related lines in /opt/picochess/web/picoweb/static/js/app.js.

Randy


--

Johan Sjöblom

unread,
May 11, 2025, 10:22:19 AM5/11/25
to PicoChess
We wrote this at the same time :-) Same thing I think.
And yes, I checked, this is the only change I have done to the web 3.3, commenting out the speach line in app.js

Randy Reade

unread,
May 11, 2025, 10:26:16 AM5/11/25
to pico...@googlegroups.com

Yes. I should have waited and read your reply. 😊 And, yes, it's only some browsers that allow text-to-speech. I find it annoying so comment out the relevant lines and just use the PicoChess voices.

Randy


Johan Sjöblom

unread,
May 11, 2025, 10:31:13 AM5/11/25
to PicoChess
:-) Just a final note on picochess update. At the moment the system update is really simple, it re-runs the installation script (with the pico parameter to avoid system update). And the installation script is simply doing "git pull" to update the web and python code. If you edit something yourself git might create a merged file and require your manual action to resolve the conflict as the same file has changed both on your local disc and in the repository. So even a one-liner change like this might give you problems to update.

Therefore I recommend that anyone who wants to use the picochess updates dont edit anything themselves, even though its just a one line. It might make the update stop working.

I have to figure out how to improve the system update.. Dont think git checkout master is any better... But if there are some parameters in git to force the checkout to overwrite any local edits then I could update the installation script.

Johan Sjöblom

unread,
May 11, 2025, 2:19:22 PM5/11/25
to PicoChess
Sorry for many messages, but just a note that I will "update the updater". Meaning; next week I will update the install script so that it always makes backup copies of what you had before the update, and always forces the code back to the latest version. Meaning: It will always update and not cause conflicts even if you have made temporary local updates while waiting for the real update.... This is what it would be in this case when someone edited the exact same line in the app.js file and then tried to update. That would currently cause a conflict and update would not be automatic. With a forced solution that would not be a problem any more.

The new installation script will also preserve any extra added files you might have. It should help in cases where you are afraid you could lose something, like engine files... One challenging file will be the engines.ini that keeps a list of engines. The repository only has a few test engines in the list (Stockfish, LC0, pgn_engine)... so after an update you would not lose the mame engines etc. But you would lose your list of engine files, the engine.ini file. This particular file we could perhaps always copy back after the update, but that also has some risks if I automate that. It could try to be smart and copy it back if that engine list is much longer than the repository engine.ini file, indicating that you have added more engines. However, adding "smart things" typically causes problems in itself.

"Updating the updater" is also in itself a little bit strange :-), After I have fixed this you would need to update ones just to get the new updater (in the first update), and the backups would not be performed until the next update after that (the second update)... Therefore I will add this updater as my next improvement... Just to be clear, I have not done it yet, I will do it next week.

Randy Reade

unread,
May 11, 2025, 3:34:06 PM5/11/25
to pico...@googlegroups.com
Johan,

Currently, with the v3.3 engines folder copied over to v4, when doing an update I don't lose the modified engines.ini file, which I believe is what we want. git status shows:

On branch master
Your branch is up to date with 'origin/master'.

Changes not staged for commit:
  (use "git add/rm <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
deleted:    engines/aarch64/LD2.pb.gz
modified:   engines/aarch64/NNUE/StockfishNN
deleted:    engines/aarch64/NNUE/nn-1111cefa1111.nnue
deleted:    engines/aarch64/NNUE/nn-37f18f62d772.nnue
modified:   engines/aarch64/engines.ini
modified:   engines/aarch64/extra/pgn_engine.py
modified:   engines/aarch64/favorites.ini
modified:   engines/aarch64/lc0v0311
deleted:    engines/descriptions.txt
deleted:    engines/pgn_engine/pgn_games/AlphaZeroStcokfisch_Castling_opposite.pgn
deleted:    engines/x86_64/.gitignore
deleted:    engines/x86_64/LD2.pb.gz
deleted:    engines/x86_64/a-stockf
deleted:    engines/x86_64/a-stockf.uci
deleted:    engines/x86_64/b-lc0
deleted:    engines/x86_64/b-lc0.uci
deleted:    engines/x86_64/engines.ini
deleted:    engines/x86_64/extra/pgn_engine
deleted:    engines/x86_64/extra/pgn_engine.py
deleted:    engines/x86_64/extra/pgn_engine.uci
deleted:    engines/x86_64/favorites.ini

Untracked files:
  (use "git add <file>..." to include in what will be committed)
chess_link_config.json
engines.v4/
engines/aarch64/McBrain
engines/aarch64/McBrain.uci
engines/aarch64/NNUE/ArasanNN
engines/aarch64/NNUE/ArasanNN.uci
engines/aarch64/NNUE/BlackDiamondNN
engines/aarch64/NNUE/BlackDiamondNN.uci
engines/aarch64/NNUE/BluefishNN
engines/aarch64/NNUE/BluefishNN.uci
engines/aarch64/NNUE/CrystalNN
engines/aarch64/NNUE/CrystalNN.uci
engines/aarch64/NNUE/HarmonNN
engines/aarch64/NNUE/HarmonNN.uci
engines/aarch64/NNUE/HoneyNN
engines/aarch64/NNUE/HoneyNN.uci
engines/aarch64/NNUE/IgelNN
engines/aarch64/NNUE/IgelNN.uci
engines/aarch64/NNUE/NightNurse03.bin
engines/aarch64/NNUE/Oki-MaguroNN
engines/aarch64/NNUE/Oki-MaguroNN.uci
engines/aarch64/NNUE/RubiChessNN
engines/aarch64/NNUE/RubiChessNN.uci
engines/aarch64/NNUE/WaspNN
engines/aarch64/NNUE/WaspNN.uci
engines/aarch64/NNUE/arasan-d9-SFv4-20231228.nnue
engines/aarch64/NNUE/arasan.rc
engines/aarch64/NNUE/cksum_net.txt
engines/aarch64/NNUE/default.nnue
engines/aarch64/NNUE/eval.bin
engines/aarch64/NNUE/getnet.sh
engines/aarch64/NNUE/harm.bin
engines/aarch64/NNUE/nn-5af11540bbfe.nnue
engines/aarch64/NNUE/nn-b1a57edbea57.nnue
engines/aarch64/NNUE/nn-b1c332ae1d-20220613.nnue
engines/aarch64/NNUE/nn-baff1ede1f90.nnue
engines/aarch64/NNUE/nn-bd92a1a93fbf.nnue
engines/aarch64/NNUE/nn-c257b2ebf1-20230812.nnue
engines/aarch64/NNUE/wotnet.sh
engines/aarch64/arasan.rc
engines/aarch64/arb_comments_de.txt
engines/aarch64/arb_comments_en.txt
engines/aarch64/arbv2_comments_de.txt
engines/aarch64/arbv2_comments_en.txt
engines/aarch64/b-texel
engines/aarch64/b-texel.uci
engines/aarch64/boris_comments_de.txt
engines/aarch64/boris_comments_en.txt
engines/aarch64/c-arasan
engines/aarch64/c-arasan.uci
engines/aarch64/centaur_stfdd_comments_de.txt
engines/aarch64/centaur_stfdd_comments_en.txt
engines/aarch64/comments/
engines/aarch64/ct800
engines/aarch64/ct800.uci
engines/aarch64/d-rodent4
engines/aarch64/d-rodent4.uci
engines/aarch64/dragontooth
engines/aarch64/dragontooth.uci
engines/aarch64/e-zurich
engines/aarch64/e-zurich.uci
engines/aarch64/engines_ini/
engines/aarch64/ethereal
engines/aarch64/ethereal.uci
engines/aarch64/extra/centaur_stfdd
engines/aarch64/extra/centaur_stfdd.uci
engines/aarch64/extra/fics
engines/aarch64/extra/fics.uci
engines/aarch64/f-wyld
engines/aarch64/f-wyld.uci
engines/aarch64/g-galjoe
engines/aarch64/g-galjoe.uci
engines/aarch64/general_game_comments_de.txt
engines/aarch64/general_game_comments_en.txt
engines/aarch64/ggm_boris25_comments_de.txt
engines/aarch64/ggm_boris25_comments_en.txt
engines/aarch64/h-sayuri
engines/aarch64/h-sayuri.uci
engines/aarch64/i-floyd
engines/aarch64/igel
engines/aarch64/igel.uci
engines/aarch64/l-laser
engines/aarch64/l-laser.uci
engines/aarch64/linux64/
engines/aarch64/maia_weights/
engines/aarch64/maiav0311
engines/aarch64/maiav0311.uci
engines/aarch64/mame/
engines/aarch64/patricia
engines/aarch64/patricia.uci
engines/aarch64/r-roboci
engines/aarch64/r3_club
engines/aarch64/r3_club.uci
engines/aarch64/r3_fun
engines/aarch64/r3_fun.uci
engines/aarch64/r3_gm
engines/aarch64/r3_gm.uci
engines/aarch64/r3_kids
engines/aarch64/r3_kids.uci
engines/aarch64/r3_league
engines/aarch64/r3_league.uci
engines/aarch64/r3_masters
engines/aarch64/r3_masters.uci
engines/aarch64/r3_school
engines/aarch64/r3_school.uci
engines/aarch64/remote_uci/
engines/aarch64/retro.ini
engines/aarch64/rodent3
engines/aarch64/rodent3.uci
engines/aarch64/sargon_comments_de.txt
engines/aarch64/sargon_comments_en.txt
engines/aarch64/saruman
engines/aarch64/stash
engines/aarch64/stash.uci
engines/aarch64/v-vajole
engines/aarch64/v-vajole.uci
engines/aarch64/windows64/
engines/rodent3/
engines/rodent4/
sarlog.txt

no changes added to commit (use "git add" and/or "git commit -a")


Note: engines.v4 is the backup of the repo engines folder.

Once the repo is cloned into a new RPiOS I don't think we should touch the engines folder or other 'data' files. Just updating the core files (python, scripts, services, etc.) should be all that is needed, so backing up isn't really necessary, unless I'm missing something.

Randy

Johan Sjöblom

unread,
May 12, 2025, 2:09:42 AM5/12/25
to PicoChess
Hi.

Yes the installer should not touch any ini files like engines.ini (or favorites.ini). Unfortunately they were part of the repository so I have now removed them from the repo. That might cause a temporary problem for you testers, that you actually lose these two files in this one-time change. Now that these files are removed from the repository this will not happen again and the user made engines.ini or favorites.ini will always stay (just like the picochess.ini file). This is a one-time problem for you now.

Next update you do should be done twice. The first one will still run the old install script, and then it will update "itself". The next update will then be using the new installer. Be aware this one-time update to make a backup of your engines.ini and favorites.ini file. After you have done these two updates the files will never be overwritten again. Anyone who installs a new installation will not see this problem. It will only hit the early testers. Thanks for your effort and patience :-)

The new install script (that you use when you update the 2nd time and onwards) makes backups in /home/pi/pico_backups. As you say its really not needed. But it would not hurt to have backups. We can perhaps later add a menu item "go back to previous". I limited the number of backups to 2. It will backup both repository files and untracked files. As the mame folder is so big maybe I should change it to avoid backuping the mame folder...? But lets first see if the backup takes too long... it will do the backup at next boot time when you have requested a system update (or anytime you run the installation script yourself).

In case you have a clean install and this one time you are missing the engines.ini and favorites.ini file, just run the install script again (you can use parameter pico to make it faster, it skips system update then). The installer will only create engine.ini and favorites.ini default files if they have been lost.

BR, Johan

Dirk

unread,
May 12, 2025, 2:37:12 AM5/12/25
to pico...@googlegroups.com, PicoChess
I wouldn’t back up the engine folder or part of the engine folder.

People wanting backups will backup their whole sd card I think. And as you said the mame or pgn-engine folders can be really big. 

Just my 2 cents…
Dirk

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

Hi.
--
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 12, 2025, 9:21:49 AM5/12/25
to PicoChess
Yes. I will do is so that there is only one backup folder in /home/pi, and that backup will not contain engines and mame folders. Those are the two big ones.
With only one backup folder the rsync that I used will be really fast as it will only backup files that have changed, python, javascript etc... So it will be fast.

Later it would then be possible to add "go back to previous version" in the menu... In case some released version has some blocking problem. It would simply take back the backup files...

BR, Johan

Randy Reade

unread,
May 12, 2025, 9:41:55 AM5/12/25
to pico...@googlegroups.com

But doesn't /opt/picochess already have the previous file versions since it is a clone of the repo? A git checkout could be used on a previous commit. I think since this is just beta testing we don't need to worry too much about backups. It's easy enough to just remove the picochess folder and start over. Users who are making changes like adding engines, etc., will have the skills to fix the installation if files get removed by mistake. Why not just .gitignore the engine folder? The repo engines don't really need updating as it's the python code that we are testing.

Randy


Johan Sjöblom

unread,
May 12, 2025, 1:32:35 PM5/12/25
to PicoChess
The engine folder is already git ignored yes. And I have removed the engine.ini and favorites.ini from the repository and also git ignored them.
The update system has switched from a soft "git pull" to a git hard force to master branch. This is so that it would be possible for users to make their own temporary changes to the code or javascript without getting a conflict at next upgrade. The git merge conflicts can be really annoying and force people to double edit a code file. The result of this hard reset felt so "forceful" that I thought that one small backup would be good to have. And you are right. Its probably my engineering brain that wants one rollback folder locally :-)

Lets see, I will update the installation script slightly...

BR, Johan

Aldo Bleeker

unread,
Jan 1, 2026, 6:14:43 PM (9 days ago) Jan 1
to PicoChess
I was trying to find a way to turn off this male voice, the one that says "Welcome to picochess!". That voice doesn't sound right, it's pitched too high, or something. Even worse, it keeps talking over Christina, with the result that you can't understand either of them. You can switch off Christina in picochess, but it seems not this male voice. I believe you should be able to do this with the mute icon in picochess, but I've never seen it, not on the RPi 5, and not on my Debian PC.

I then searched in the group, and found this conversation. Reading the comments, it seems that the only way to shut off the voice is to modify file apps.js and comment out the line window.speechSynthesis.speak(msg);. Is there no other way, using the interface? Because if we modify the code, git pull won't work. Or is there a way to make git ignore this modification?

I had a thought, maybe I can check the code, and see what it does to switch off the voice.

Aldo

Randy Reade

unread,
Jan 1, 2026, 7:13:52 PM (9 days ago) Jan 1
to pico...@googlegroups.com
You can try a different browser. Or, there should be a setting in the browser to not allow speech synthesis. I don't get the speech when using Chrome but I do with Firefox. 

Randy

Johan Sjöblom

unread,
Jan 2, 2026, 9:01:59 AM (8 days ago) Jan 2
to pico...@googlegroups.com
I believe that the sound is coming from the web client code. For a long time I had that line commented out, but some users want the web sound on their mobile (for move announcements) so I uncommented it when we implemented the mute button. But then later the mute button was hidden on localhost. 

If we can locate the start announcements in the web client "welcome to picochess" we could uncommemt that one instead.

On localhost you can probably prevent chromium sounds, but Firefox is more tricky if I remember right

--
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.

Aldo Bleeker

unread,
Jan 2, 2026, 11:56:34 AM (8 days ago) Jan 2
to PicoChess
I'm using picochess locally running in Firefox, and the voice says "Welcome to picochess!" on start up. It can be commented out, but it's also announcing the moves and speaking over Christina who is announcing the same moves as well, meaning neither is understandable. But the move announcements can't be commented out, because other users want to hear them. And there may be other moments where it's speaking. The voice is also quite unnatural and often sounds quite distorted, so I believe the user experience is improved if Christina announces the moves. It would be nice if the voice is available as well as fall-back.

What I believe would work well is to give the user the ability to disable the voice with a setting in picochess.ini, like the other voices. The function talk that speaks the welcome message and the move announcements is called in web/picoweb/static/js/app.js. (Lines 43-108 in apps.js.) I notice the Mute button sets a flag speechMuted, that may be be useful.

Aldo

Aldo Bleeker

unread,
Jan 2, 2026, 8:25:33 PM (8 days ago) Jan 2
to PicoChess
I've been thinking, it would be even better if we could switch on/off the voice in the menu, like the other voices. But that may well be a large modification...

Another way to solve this is by using the Mute button. It's not visible in local mode, because then it's hidden, but if it's not hidden in local mode, it can be used to switch off this voice when needed. I've tried it, and it seems to work well.

The button is hidden in local mode by line 1779 of app.js.

1779         $('#btn-mute').hide();

To unhide the button I've modified this line like so.

1779 //      $('#btn-mute').hide();

Aldo

Johan Sjöblom

unread,
Jan 3, 2026, 3:55:24 AM (8 days ago) Jan 3
to PicoChess
I agree that we could make the mute button visible on localhost. That could disturb some screen resolutions.
An alternative could be that we always mute localhost. If you want sound on localhost you have Christina et al.

What do you think? 

Randy Reade

unread,
Jan 3, 2026, 4:46:52 AM (7 days ago) Jan 3
to pico...@googlegroups.com
As Aldo stated, I think a menu option to enable/disable the speech synthesis would be best, via a picochess.ini setting (e.g., web-speech = true), which would not affect the localhost display, and should be fairly easy to implement.

Randy

Aldo Bleeker

unread,
Jan 3, 2026, 8:36:29 AM (7 days ago) Jan 3
to PicoChess
I agree with Randy, a menu option to enable/disable speech synthesis that's saved to picochess.ini would be ideal. This way localhost doesn't have to be muted, and the button doesn't have be unhidden.

BTW, I've had a look at the code, and I've found code that writes to picochess.ini, but I can't find code that reads from picochess,ini. I think the menu options are defined in dgt/menu.py, and when modified are then saved in picochess.ini. So adding an option to the menu will write it to picochess.ini as well. Is that correct? But how does it know where to put modified options? Does it look for the option in picochess.ini and write it to it's current position? And if doesn't exist, write it at the end?

Aldo

Johan Sjöblom

unread,
Jan 3, 2026, 8:59:32 AM (7 days ago) Jan 3
to PicoChess
I have now made a branch and PR with the possibility to set both the localhost and a remote web client mute settings:
This way you can have speech off on your localhost, and speech on on remote clients, or whichever way you chose.

Example of default configuration:
## Enable speech synthesis in the web client when accessed from localhost
web-speech-local = False
## Enable speech synthesis in the web client when accessed remotely
web-speech-remote = True

Please note that there is not yet any menu option to update these values. This first fix is just using the picochess.ini settings that you have to write yourself. I made the speech default to False on localhost as we do have other voices there, and default to True on remote web clients. So you can test this typical setting without adding anything to your picochess.ini

-- Johan

Johan Sjöblom

unread,
Jan 3, 2026, 9:27:01 AM (7 days ago) Jan 3
to PicoChess
Aldo, some code answers:
- The main config read happens in configuration.py: it uses configargparse.ArgParser with picochess.ini], so all options declared with add_argument are loaded from the ini at startup.
- The parsed values are used in picochess.py as args.<option> throughout startup
- In utilities.py the function write_picochess_ini loads picochess.ini with ConfigObj, sets config[key] = value, then calls config.write()

so how does it store/write into picochess.ini, Well it does not look for the original position and edit “in place.” It loads the file as a ConfigObj in utilities.py (see above) and writes it back out. If a key doesn’t exist, ConfigObj will add it (typically at the end of the file). If it exists, it updates the value in the config object and writes the whole file.
therefore, if the key did not exist from before, its typically added to the end of the file

-- Johan

Aldo Bleeker

unread,
Jan 3, 2026, 12:06:37 PM (7 days ago) Jan 3
to PicoChess
Johan, thanks for the explanation!

Aldo

Johan Sjöblom

unread,
Jan 3, 2026, 1:52:02 PM (7 days ago) Jan 3
to PicoChess
Your welcome, and if you want to test the new speech settings mentioned above you need to checkout this branch: 215-web-client-speech-setting
As I am travelling with only a laptop and limited network I will test it myself in the weekend....

Aldo Bleeker

unread,
Jan 3, 2026, 6:46:39 PM (7 days ago) Jan 3
to PicoChess
I've checked out branch 215 and added the new options to picochess.ini. It's working nicely. Great job once again!

Aldo

federico rebechi

unread,
Jan 3, 2026, 7:15:15 PM (7 days ago) Jan 3
to PicoChess

Hi everyone, I need the latest version of Picochess for my Raspberry Pi4 but I don't know how to download it. Can you help me?

Johan Sjöblom

unread,
Jan 6, 2026, 12:46:15 PM (4 days ago) Jan 6
to PicoChess
To install Picochess V3 see this post: https://groups.google.com/g/picochess/c/f0lfmQZCHhk/m/WJOi_0oZCQAJ
To install Picochess V4 you can read the instructions here: https://github.com/JohanSjoblom/picochess

Johan Sjöblom

unread,
Jan 6, 2026, 12:47:57 PM (4 days ago) Jan 6
to PicoChess
Aldo and others with web speech challenges. The new picochess.ini settings are now available in the master branch. If you dont have these settings these are the defaults that it will use:
## Enable speech synthesis in the web client when accessed from localhost
web-speech-local = False
## Enable speech synthesis in the web client when accessed remotely
web-speech-remote = True

Aldo Bleeker

unread,
Jan 7, 2026, 6:28:35 AM (3 days ago) Jan 7
to PicoChess
I'm running the master branch right now, and it's lovely! I notice the Wayland branch has been merged as well. These are great improvements!

Aldo
Reply all
Reply to author
Forward
0 new messages