The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.34 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Use alsa dmix as default device
#1
Hello,
it would be great if moode could use alsa's dmix plugin as default output device. This is alsa's software mixer and enables multiple applications to output audio at the same time.

For example, one can have several bluetooth devices connected and play spotify at the same time.

While one can argue whether listening to several audio sources at once makes sense, but I think, there is use for it:
- one can keep bluetooth devices connected at all times. Currently, all bluetooth devices have to disconnect before playing something (e.g. spotify).
- one can use moode as computer speakers for occasional sounds while listening to music.

As a proof of concept (and for my own cenvenience) I set this up manually on my moode box and got bluetooth and spotify to work simultaneously. Now, I don't need to disconnect bluetooth devices before being able to stream spotify. Also, connecting a bluetooth device while something is playing doesn't result in an error to the effect that one needs to re-connect the device before being able to play something.

I did it as follows:


/etc/asound.conf
Code:
pcm.!default {
        type plug
        slave.pcm "dmix"
}
This makes the "plug:dmix" device the default output device for all alsa aware software. This step is probably superfluous if every program is passed the audio device it ought to use anyway.

/etc/bluealsaaplay.conf
Code:
AUDIODEV=plug:dmix
This ensures that bluetooth connections are sent to dmix.

/var/www/inc/playerlib.php
Change the librespot command to use plug:dmix as device. Or don't pass a device at all so the configured default device is used.

Using the dmix device would also allow for the possibility to keep MPD running while other sound sources are active.

The default configuration of the plug:dmix device for alsa uses hw:0,0 as output. If this is meant to be configurable by moode, it would be easy to configure another dmix based device in /etc/asound.conf which sends the final outout to another sound card. For details, see https://www.alsa-project.org/main/index....undrc#dmix
Reply


Messages In This Thread
Use alsa dmix as default device - by kaymes - 03-06-2019, 08:17 AM
RE: Use alsa dmix as default device - by kaymes - 03-06-2019, 10:18 PM
RE: Use alsa dmix as default device - by Edward - 03-08-2019, 01:11 AM

Forum Jump: