Help with picking the right components appreciated

:laughing:

But I still don’t grasp why it failed. The file is created by the same user that’s trying to append to it. What am I missing here?

And furthermore, since the file is only created if it does not yet exist, should it not be tee -a?

you can’t echo or printf and redirect the output to a system file (permission). you have to pipe it to the second command (which gets sudo’ed)

this flew under the radar because i’ve tested it in $HOME

tee -a is in the script that is PR’ed later on (to append if the asound.conf already holds some lines), you indicated that you don’t had a asound.conf before

I guess it makes sense. Did not know that yet.

I also have a suggestion. It might be a good idea to create copies of any existing files before modifying them. Especially global files like the ones in /etc.

With tee I get duplicate code in /etc/asound.conf.

This should read: It might be a good idea to create copies of any existing files before modifying them.

echoing in or(sed/printf) works pretty reliable. There’s a diff/patch possibilty (which i will use on patching .bashrc with the new consolidated update scripts), yet this is more involved.

This prevents it: | sudo tee /etc/asound.conf >/dev/null

But you are right. I will consider this, because i want the changes to be reverseable as easy as it gets with the new approach.

I think it’s just good practice to not just modify existing files. Especially with third party files its useful if one can see which settings were installation defaults and which settings were modified afterwards.

this just prevents the print on screen. The command should’nt double the output.

That might well be, but it ends up in my /etc/asound.conf twice :thinking:

So, after running that multiple times, check also /etc/pulse/default.pa /etc/pulse/daemon.conf for weirdness

I manually made copies first and copy the originals back before running the script :smile:

Actually it doesn’t. Not sure what I’m doing here. Apologies for the confusion.

maybe a cat asound.conf with the screen output from printf considered as a part of the file. Yet i wasn’t confused.

have you altered mycroft.conf (the tts portion of the json notation)?

Yes I have.

I also ran into one more issue, on line 13. The replacement part of the sed script contains slashes. So you must either change the pattern separators or escape the slashes:

sudo sed -i "s/^#load-module module-native-protocol-tcp/load-module module-native-protocol-tcp auth-ip-acl=127.0.0.1;192.168.0.0/16;172.16.0.0/12;10.0.0.0/8 auth-anonymous=1/" /etc/pulse/default.pa
into
sudo sed -i 's/^#load-module module-native-protocol-tcp/load-module module-native-protocol-tcp auth-ip-acl=127.0.0.1;192.168.0.0\/16;172.16.0.0\/12;10.0.0.0\/8 auth-anonymous=1/' /etc/pulse/default.pa

1 Like

Thanks, if you want to flash the 48k firmware on the card (instead of the 16k that got flashed during the setup wizard)

cd usb_4_mic_array
sudo /home/pi/mycroft-core/.venv/bin/python dfu.py --download 48k_1_channel_firmware.bin

The modified version of fix.sh I have now, runs without errors. I also flashed the 48k firmware. Thanks for that.

Now let’s restart and see if Mycroft runs without hickups.

And figure out a way to keep that JBL powerd on :slightly_smiling_face: