Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
asound_set_default_card plays havoc in volumealsa.c #13
The function asound_set_default_card plays havoc regularly when people change their .asoundrc files by hand.
One example is for the Audio Injector Octo card which defines operation in /etc/asound.conf.
The function asound_set_default_card sees no .asoundrc file and creates a default which changes the default setup. After this people can't play less then or more then 2 channels of audio with this awesome GPIO multichannel sound card.
Another solution we tried was to put these settings in ~/.asoundrc however as the card isn't recognised by pulse, the default setting in ~/.asoundrc gets clobbered !
Perhaps an interim solution is to check for a default setting in the /etc/asound.conf file and if it doesn't exist, then create ~/.asoundrc as is currently done ... if it does exist, then do nothing !
The resetting of .asoundrc only happens if a sound device which cannot be controlled by the volume plugin is used. The volume plugin looks for an ALSA simple control which maps to the volume on the device; if it cannot find one, that device cannot be controlled with the plugin, and a default .asoundrc is generated to restore functionality of the volume control.
If you wish to use an external device which is not supported by the volume plugin, remove the plugin from the panel, and create your own .asoundrc - the contents of the file will then remain unchanged.
This is not "fixable" in the way you want. The volumealsa plugin has to have an associated controllable default device, which is a device which offers at least one ALSA simple volume output control; if a device does not have any ALSA simple output controls, the plugin restores the default on-board audio device as the default.
As above - the "fix", if you wish to use devices without simple controls, is to remove the plugin and control the volume by some other manner of your choosing. Alternatively, modify your device so it offers an ALSA simple control for output volume.
As an aside - in the forthcoming Stretch release of Raspbian, all the modified functionality of the volumealsa plugin, such as control of the Pi onboard output and Bluetooth support, including overwriting the .asoundrc file, has been moved to a new plugin called volumealsabt. The original volumealsa plugin as provided as part of vanilla lxpanel will be shipped as originally written; this will not modify .asoundrc. (It also won't control the volume of your device.) You may find it advisable to suggest people use this version of the plugin instead of the custom Pi version - but as above, if they try to change the volume with it, it won't work - the real "fix" for this is to add ALSA simple control support for your device.
There is a different situation here as well. For the Octo sound card - which has 8 channels of output and 6 channels of input, the .asoundrc is clobbered. We specifically set it up to us a plug default to allow anything between 1 and 8 channels of output, as required. In this case, the .asoundrc is also clobbered ... why can't the volume plugin leave .asoundrc alone rather then clobbering it ? In fact, we have noticed that in the case of the Octo soundcard the lxpanel plugin doesn't report the card's presence nor play nice with it. It seems to me that these plugins need rework so that they play nice with ALSA. Matt…
On 30/07/17 01:57, Simon Long wrote: This is not "fixable" in the way you want. The volumealsa plugin has to have an associated controllable default device, which is a device which offers at least one ALSA simple volume output control; if a device does not have any ALSA simple output controls, the plugin restores the default on-board audio device as the default. As above - the "fix", if you wish to use devices without simple controls, is to remove the plugin and control the volume by some other manner of your choosing. Alternatively, modify your device so it offers an ALSA simple control for output volume. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <#13 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AAq6B0kU5YZvlrnGmywOopTp3cv4gtYUks5sS1Z8gaJpZM4NyEjq>.
If your device is not detected by the plugin, then it is not compatible with the plugin. I cannot debug that without access to the hardware. The plugin works as desired with various USB audio devices we have tested with, but we cannot test with everything.
ALSA itself is, frankly, a mess. The plugin is deliberately designed to drop back to default on-board audio if it finds a compatibility issue with any alternative hardware. This behaviour is intended and will not be changed.
You have a workaround available - just uninstall the plugin. As it is incompatible with your device, this loses you no functionality.