For next generation:
https://forum.kodi.tv/archive/index.php?thread-297706.html
in my case libreelec 10.4 I nedd do only:
4) I exited saving changes. Then I browsed through Kodi settings to install the "Multimedia Tools" Add-on.
5) After installing that addon, I went back to the terminal through SSH and executed alsamixer
6) In Alsamixer, I changed the setting from "2ch" to "6ch" here:
Image
This way, you could test if surround sound works (in my case, it worked).
7) And finally, to save the configuration changes made in Alsamixer, I executed this line of code in Terminal:
Code:
echo "amixer sset 'Channel Mode' '6ch'" >> /storage/.config/autostart.sh