How to completely uninstall I2S Bonnet

Moderators: adafruit_support_bill, adafruit

Forum rules
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/
Locked
User avatar
k9gardner
 
Posts: 5
Joined: Tue Jun 01, 2021 10:32 pm

How to completely uninstall I2S Bonnet

Post by k9gardner »

I appreciate the fact that you provide a script for the installation of the I2S Audio Bonnet (the "fast install," as well as the "detailed install." However, if you're going to provide installation instructions like this, I wish you would also provide uninstall instructions! I inadvertently ran the install script on my previously perfectly-functioning Raspberry Pi 4, thinking that I was running it on my Pi Zero W. I had both devices connected via SSH and I didn't realize that the connection to the Zero had dropped and I was actually typing in the Pi 4 window, when I executed the script. Since there is no I2S HAT on this device, it obviously made unwanted changes, and now I can no longer get audio out of the 3.5mm analog audio port, which I need and use.

I have gone through all the configuration files in the "detailed install" and backed out all the changes listed there. I confirmed that they are the same in the Pimoroni installation guidelines. However, I am still unable to get audio from the headphone jack. It no longer shows up as an option in the Volume Control (PulseAudio), and it's not listed in Device Profiles there.

I can't help but think that the "fast install" script is doing something more than described. There must be something else that I need to re-enter or re-enable in order to remove all vestiges of this erroneous installation and go back to what I had before. I really need help getting back to that.

By the way, when I go into alsamixer and hit F6 to select sound card, it does show up here! Device 0 bcm2835 Headphones. But again, I don't really know how pulseaudio works or what it does, or what it is, that alsamixer is not. So maybe the fact that it appears here is immaterial. The point is, I can't get any output from the 3.5mm audio port, and it's frustrating the hell out of me after trying to get it back for over two hours.

Anyone who helps me with this gets a free cup of coffee. :) I'm that serious. Please. Thank you.

User avatar
k9gardner
 
Posts: 5
Joined: Tue Jun 01, 2021 10:32 pm

Re: How to completely uninstall I2S Bonnet

Post by k9gardner »

Anybody? Please? I'm really stuck. Thanks.

User avatar
josefqk
 
Posts: 1
Joined: Sun Jun 06, 2021 3:29 pm

Re: How to completely uninstall I2S Bonnet

Post by josefqk »

I see by the date on this that you may well still be stuck.

I just installed the I2S Audio Bonnet on manjaro-arm xfce, so had to do everything by hand. Since it works, I am assuming doing the opposite of everything should also work to return it to defaults. So here is a quick rundown of what the script does and how to undo it, according to what I know today but will have forgotten by tomorrow:

What the script does to update modprobe.d:
It opens

Code: Select all

/etc/modprobe.d/raspi-blacklist.conf
and comments out ('#') these lines if they appear:

Code: Select all

blacklist i2c-bcm2708
blacklist snd-soc-pcm512x
blacklist snd-soc-wm8804
To revert:

Code: Select all

$ sudo nano /etc/modprobe.d/raspi-blacklist.conf
and remove the '#' at the beginning of any/all of the three above lines if they appear.

Currently, this file does not exist on Manjaro-arm XFCE. It does exist on Raspian OS but is empty, so there may be nothing to do.

What the script does to disable rpi headphone jack:
It opens

Code: Select all

/etc/modules
and comments out, if there:

Code: Select all

snd_bcm2835
To revert:

Code: Select all

$ sudo nano /etc/modules
and remove the '#' at the beginning of that line, if there.

Currently, this file does not exist on manjaro-arm xfce. It does exist on raspian but only lists one module, which should be left as-is:

Code: Select all

i2c-dev
So there may be nothing to do here, either.

What the script does to reconfigure ALSA: it creates (or changes)

Code: Select all

/etc/asound.conf
If it already exists, the script renames the existing file to 'asound.conf.old'

To revert, remove or rename asound.conf (rename if you might later want to reinstall the bonnet, for instance) and restore the original, if there was one:

EITHER remove:

Code: Select all

$ sudo rm -i /etc/asound.conf
answer 'yes' when it asks if you really want to delete the file.

Then restore the original file, if it is there:

Code: Select all

$ sudo mv /etc/asound.conf.old /etc/asound.conf
OR rename:
IMPORTANT: if there is already an 'asound.conf.old', then you don't want to overwrite it, so rename this one a little differently:

Code: Select all

$ sudo mv /etc/asound.conf /etc/asound.conf.1.old
Then restore the other .old file, if it is there:

Code: Select all

$ sudo mv /etc/asound.conf.old /etc/asound.conf
What the script does to update device tree:

It opens

Code: Select all

/boot/config.txt
and comments out, if there:

Code: Select all

dtparam=audio=on
and adds

Code: Select all

dtoverlay=hifiberry-dac
dtoverlay=i2s-mmap

To revert:

Code: Select all

$ sudo nano /boot/config.txt
and remove '#' from beginning of line

Code: Select all

dtparam=audio=on
then either add '#' at the beginning of each of these lines, or remove them entirely:

Code: Select all

dtoverlay=hifiberry-dac
dtoverlay=i2s-mmap
The detailed instructions at adafruit do leave this part out: the script also creates a new asound service to play a very low-volume sound constantly--this elimanates pops when the I2S interface is opened or closed.

The file is created as

Code: Select all

/etc/systemd/system/aplay.service
and you don't really need to remove it--unless you just cannot stand wasting 4 kilobytes--but the script may have enabled it, depending on how you answered its questions, so:

Code: Select all

$ sudo systemctl disable aplay
That should be everything. Reboot the pi and see how things go. Reboot it twice if the first time gives you no satisfaction.

Hope this helps! If not, it should be possible to restore the original config files from a new Raspian image. If you had already modified any of them, you'll have to reconstruct your modifications unless you copied/backed them up somewhere.

Locked
Forum rules
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/

Return to “Adafruit Raspberry Pi® accessories”