What do I got to do to stop user switching on Linux from stopping sound?
If I play some audio under user user1, I don't want it to stop when I switch to an unused virtual console or to user2 (via Menu->Log Out->Switch User).

The reason why the sound turns off is that Pulseaudio is started on each login with this user's privileges and the system does not allow users to listen to other users audio.
Solution :

1)
Add all users that should be able play back to the pulse-access group
adduser <user-name> pulse-access
2)
Create /etc/systemd/system/pulseaudio.service with the following content:
[Service]
Type=simple
PIDFile=/var/run/pulse/pid
ExecStart=/usr/bin/pulseaudio --daemonize=yes --system=yes --disallow-module-loading=yes --disallow-exit=yes
[Install]
WantedBy=multi-user.target
3)
Enable this new systemd service so that it is started on boot:
systemctl enable pulseaudio
4)
Be aware that this configuration is
-     less secure (e.g. other users can listen to your microphone)
-     sound output will not automatically switch to and from headphones anymore
-     might prevent Bluetooth from working.

https://unix.stackexchange.com/questions/382601/how-to-prevent-sound-mute-when-switching-user