Staticky sound on RBP2 after upgrade to 2017.4.1

When I turned on the TV with my RBP2 the screen showed “the upgrade failed, please report this to the OSMC forum”. I hadn’t used this TV for a couple of weeks and I didn’t remember having started an update. When I rebooted I noted that I am getting a staticky audio (at least as loud as the program sound) that comes from the analog channel (my older TV is connected through DVD-I and has a separate sound cable). The static is coming from the RBP2 since it comes through my earbuds too, and I think it’s coming from OSMC because it since it stops when OSMC goes to sleep, and comes back when I push any menu button. It continues if I unplug all of the attachments to the Pi (except power and the audio plug, of course).

I decided to go through the update to 2017.04.1, which went OK, except on the first reboot I got the frowny face; a second reboot seems to be OK.

But the static is still there. Searching the forums came up with two pieces of advice.

  1. I reset the System:Audio preferences back to default, and the static went away. Of course that changes sound back to HDMI, and when I changed the audio input to analog (no other changes) the static came back.

  2. I backed up my .kodi settings directory to .kodi_bak and rebooted. OSMC made a new .kodi directory with fresh settings. The static was gone. But when I went back to System:Audio settings, and changed the audio input from HDMI to analog, the static came back. I restored .kodi_bak to .kodi.

I conclude that it is not a setting I have made (other than analog audio) that causes the static. It did not happen a week ago, and I am not sure if it is the result of the one failed update and the successful update to 2017.4.1 . I think it is not a mechanical thing (e.g. the jack in the RBP2) since as before it stops when OSMC goes to sleep, but I suppose if could be a bad Pi chip that is passed through when OSMC is active. Before I try to rebuild the whole system I’m asking if anyone has suggestions as to where this might be coming from.