Since rebooting after a recent update/upgrade it seems my '~/.asoundrc' file is being deleted automatically - Does anyone know what's deleting it or how to prevent that ?
I am going to invest time and effort in updating my apps to use PulseAudio but it hadn't been a priority as they were still working. Now they aren't working because they are dependent on '~/.asoundrc' being present and it's not.
Re: ~/.asoundrc disappeared ?
because the pulseaudio update already came & it's the current default.
-
- Posts: 27225
- Joined: Tue Mar 25, 2014 12:40 pm
Re: ~/.asoundrc disappeared ?
Take what I advise as advice not the utopian holy grail, and it is gratis !!
Re: ~/.asoundrc disappeared ?
I am well aware of that; it was about a week ago. After sorting out the problems that caused my apps were still working, have been ever since that change, '~/.asoundrc' was still persisting across reboots. Now something is deleting '~/.asoundrc' and that's what's broken my apps.
Code: Select all
pi@Pi3B:~ $ echo > .asoundrc
pi@Pi3B:~ $ echo > .asoundrc-xxx
pi@Pi3B:~ $ ls -l .as*
-rw-r--r-- 1 pi pi 1 Dec 15 16:15 .asoundrc
-rw-r--r-- 1 pi pi 1 Dec 15 16:15 .asoundrc-xxx
pi@Pi3B:~ $ sudo reboot
Code: Select all
pi@Pi3B:~ $ ls -l .as*
-rw-r--r-- 1 pi pi 1 Dec 15 16:15 .asoundrc-xxx
Re: ~/.asoundrc disappeared ?
In my opinion no part of the boot or login process should delete files in the user account. That this is happening sounds like severe misjudgement.hippy wrote: ↑Tue Dec 15, 2020 4:09 pmI am well aware of that; it was about a week ago. After sorting out the problems that caused my apps were still working, have been ever since that change, '~/.asoundrc' was still persisting across reboots. Now something is deleting '~/.asoundrc' and that's what's broken my apps.Code: Select all
pi@Pi3B:~ $ echo > .asoundrc pi@Pi3B:~ $ echo > .asoundrc-xxx pi@Pi3B:~ $ ls -l .as* -rw-r--r-- 1 pi pi 1 Dec 15 16:15 .asoundrc -rw-r--r-- 1 pi pi 1 Dec 15 16:15 .asoundrc-xxx pi@Pi3B:~ $ sudo reboot
Code: Select all
pi@Pi3B:~ $ ls -l .as* -rw-r--r-- 1 pi pi 1 Dec 15 16:15 .asoundrc-xxx
To pile layers of workarounds upon bugs you could always modify your user profile to automatically recreate a new .asoundrc file each time upon login. Maybe that same script could automatically send an email each time the file was deleted so someone can keep track of what's going on.
Re: ~/.asoundrc disappeared ?
I had a similar problem with a video config file being overwritten. It was not a pi - Ubuntu and mythtv but the principle is the same.
I would have preferred to understand why but solved it by making the file immutable.
Fixed the problem but I have to remember to reverse the change if I want to re-purpose the disk.
Hth
Phil
I would have preferred to understand why but solved it by making the file immutable.
Fixed the problem but I have to remember to reverse the change if I want to re-purpose the disk.
Hth
Phil
Re: ~/.asoundrc disappeared ?
This is because you are using a standard graphical shell. Which deletes the file. I also tried to do something about it, but the amount of glitches in the standard graphical shell made me switch to another graphical shell. Since then, my Raspberry does not freeze due to the rampage of the built-in buggy file manager and files do not self-delete. Just take a note - LXDE is not the best shell.
Re: ~/.asoundrc disappeared ?
Seems you are right. When I use 'raspi-config' to boot to console rather than boot to desktop my '~/.asoundrc' persists across reboots. As soon as I execute 'startx' it is deleted.
Thanks for that insight.
It then adds another dimension to the issue; whether '~/.asoundrc' should be deleted or not -
If it is not necessary to delete '~/.asoundrc'; why is it being deleted when the desktop is used ?
If it is necessary to delete '~/.asoundrc'; why is it not being deleted when the desktop is not used ?
Re: ~/.asoundrc disappeared ?
As far as I remember, the answer is simple - alsa saves the settings in a file (somewhere in the var directory) and the volume control on the other panel and panel widgets are used to "change" alsa. It is easy to check this if you "switch" from one sound card to another while LXDE is running. The asoundrc file will at least be corrupted. I think now that pulseaudio is working, the number of errors will increase even more.
Kill the volume control and all the soundbar widgets and see what happens.
Kill the volume control and all the soundbar widgets and see what happens.
Re: ~/.asoundrc disappeared ?
In the Good Old Days, before this PulseAudio change happened a week or so ago, the desktop volume applet used to change '~/.asoundrc'. That could be read and written from the command line or program to determine or alter audio routing programmatically.renice123 wrote: ↑Wed Dec 16, 2020 9:52 amAs far as I remember, the answer is simple - alsa saves the settings in a file (somewhere in the var directory) and the volume control on the other panel and panel widgets are used to "change" alsa. It is easy to check this if you "switch" from one sound card to another while LXDE is running. The asoundrc file will at least be corrupted.
Now '~/.asoundrc' is deleted when the desktop launches and it isn't recreated when the PulseAudio volume applet is adjusted. There may be something in /var which is the equivalent of '~/.asoundrc' but I have no idea where or what.
Probably. It seems the focus may have been on making Chromium work with less consideration given to other things. I still have no audio from Firefox-ESR and of course my own issues.
I think I'll pass on that as I have busked round the issue, have my apps working for now, and don't want to mess things up.
It's hard enough running on shifting sands without digging a trench to fall into

Re: ~/.asoundrc disappeared ?
Oh dear...
I guess you should file a bug report and/or just uninstall the downstream RPiOS lxplug-volumepulse package. This is definitely not something a desktop plugin should be doing.
so long,
Hias
Code: Select all
root@raspberrypi:~# strings /usr/lib/arm-linux-gnueabihf/lxpanel/plugins/volumepulse.so | grep asoundrc
rm -f ~/.asoundrc
root@raspberrypi:~# apt-get source lxplug-volumepulse
...
root@raspberrypi:~# grep -r -1 asoundrc lxplug-volumepulse-0.2
lxplug-volumepulse-0.2/plugins/volumepulse/volumepulse.c- /* Delete any old ALSA config */
lxplug-volumepulse-0.2/plugins/volumepulse/volumepulse.c: vsystem ("rm -f ~/.asoundrc");
lxplug-volumepulse-0.2/plugins/volumepulse/volumepulse.c-
I guess you should file a bug report and/or just uninstall the downstream RPiOS lxplug-volumepulse package. This is definitely not something a desktop plugin should be doing.
so long,
Hias
Re: ~/.asoundrc disappeared ?
Many thanks for tracking that down.
Seems I installed the version with the deletion in it a few days ago but it didn't break things at the time.
I often reboot to make sure update/upgrade haven't broken my apps so I guess what happened was '~/.asoundrc' persisted through that reboot so my apps continued working, the desktop started and then the applet deleted '~/.asoundrc'. Only after this more recent reboot was it missing and my apps failed.
Re: ~/.asoundrc disappeared ?
Good detective work!HiassofT wrote: ↑Wed Dec 16, 2020 1:54 pmOh dear...
Code: Select all
root@raspberrypi:~# strings /usr/lib/arm-linux-gnueabihf/lxpanel/plugins/volumepulse.so | grep asoundrc rm -f ~/.asoundrc root@raspberrypi:~# apt-get source lxplug-volumepulse ... root@raspberrypi:~# grep -r -1 asoundrc lxplug-volumepulse-0.2 lxplug-volumepulse-0.2/plugins/volumepulse/volumepulse.c- /* Delete any old ALSA config */ lxplug-volumepulse-0.2/plugins/volumepulse/volumepulse.c: vsystem ("rm -f ~/.asoundrc"); lxplug-volumepulse-0.2/plugins/volumepulse/volumepulse.c-
I guess you should file a bug report and/or just uninstall the downstream RPiOS lxplug-volumepulse package. This is definitely not something a desktop plugin should be doing.
so long,
Hias
There seems to be an astonishing lack of code review going on in those lx toolbars. Perhaps that's why so many of them also have memory leaks. Is there any window manager and desktop that is not infested with trolls pushing bad code?
Is there any public measure of the code quality of these open source projects?
Re: ~/.asoundrc disappeared ?
Of all the shells, only a few meet your needs. As a rule, these are so-called tiled graphic shells. I am using Awesome and disable all extensions. No memory leaks, no freezes, and extremely fast performance. All other shells are built on the principle of "one shell on top of another, into which the third shell programs are embedded in order to run the fourth shell programs through third-party libraries." But high-speed and "non-buggy" shells require a special style of work. Difficult to switch from the standard one to https://awesomewm.org/ Another philosophy, but it is convenient for those who are used to the command line, but also want to use browsers, other graphic programs
Re: ~/.asoundrc disappeared ?
I knew a student a couple years ago who used Awesome. Sometimes I think I should have watched how it was actually used. Personally, I'm used to a stacking window manager where I canrenice123 wrote: ↑Wed Dec 16, 2020 5:28 pmOf all the shells, only a few meet your needs. As a rule, these are so-called tiled graphic shells. I am using Awesome and disable all extensions. No memory leaks, no freezes, and extremely fast performance. All other shells are built on the principle of "one shell on top of another, into which the third shell programs are embedded in order to run the fourth shell programs through third-party libraries." But high-speed and "non-buggy" shells require a special style of work. Difficult to switch from the standard one to https://awesomewm.org/ Another philosophy, but it is convenient for those who are used to the command line, but also want to use browsers, other graphic programs
- Type in the window not on top.
- Move and resize the windows while not changing their stacking order.
At the same time, someday I might retire my current configuration and switch. Hopefully I can find something without memory leaks that doesn't intentionally erase my files. Since lx is out, maybe it's time to make an awesome choice.
-
- Posts: 2
- Joined: Sat Dec 12, 2020 12:08 pm
Re: ~/.asoundrc disappeared ?
Code: Select all
cd ../../etc
sudo touch .asoundrc
sudo nano .asoundrc
EDIT: My suggestion was not ideal. I ended up ditching .asoundrc and using pulseaudio as of new update. PA is still causing problems for me though...
Last edited by silky_milk on Wed Jan 20, 2021 5:22 am, edited 1 time in total.
Re: ~/.asoundrc disappeared ?
anyone find a fix for this issue? I tried putting a copy in /etc is was not removed but is was also not used by the pi user.
Willie Keeling
- HawaiianPi
- Posts: 7216
- Joined: Mon Apr 08, 2013 4:53 am
- Location: Aloha, Oregon USA
Re: ~/.asoundrc disappeared ?
What kind of "apps" are not working? Were they installed from the RPiOS repos or something you wrote yourself?
I upgraded my system to the latest Pulseaudio based system following the instructions in the December Blog post and most things just worked. I seem to recall having to go into the settings for Audacious and manually changing it to Pulseaudio, but everything else was working fine.
Whatever apps you have that are not working probably just need to be set to use Pulseaudio.
I know Pulseaudio used to be a hot mess, and I was skeptical when I read about the change, but it's working great for me.
I upgraded my system to the latest Pulseaudio based system following the instructions in the December Blog post and most things just worked. I seem to recall having to go into the settings for Audacious and manually changing it to Pulseaudio, but everything else was working fine.
Whatever apps you have that are not working probably just need to be set to use Pulseaudio.
I know Pulseaudio used to be a hot mess, and I was skeptical when I read about the change, but it's working great for me.
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups, and where is that annoying music coming from?
lots of pop-ups, and where is that annoying music coming from?