Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

asound_set_default_card plays havoc in volumealsa.c #13

Closed
flatmax opened this issue Jun 7, 2017 · 5 comments

Comments

Projects
None yet
2 participants
@flatmax
Copy link

commented Jun 7, 2017

Hi there,

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.
That card is a multichannel card and requires a plugin to allow the user to play between 1 and 8 channels of audio :
pcm.!default {
type plug
slave.pcm "anyChannelCount"
}

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 !

Matt
p.s. this problem doesn't only effect the Audio Injector Octo, there are many other people reporting it too.

@spl237

This comment has been minimized.

Copy link
Contributor

commented Jun 7, 2017

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.

@flatmax

This comment has been minimized.

Copy link
Author

commented Jul 29, 2017

I am linking this issue (which was closed without being fixed) to another problem which may be caused by lxpanel ?
#14

Is it possible to reopen this problem until it is fixed and resolved ?

thanks
Matt

@spl237

This comment has been minimized.

Copy link
Contributor

commented Jul 29, 2017

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.

@flatmax

This comment has been minimized.

Copy link
Author

commented Jul 30, 2017

@spl237

This comment has been minimized.

Copy link
Contributor

commented Jul 30, 2017

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.