geeks-r-us / volumio-plugins

9 stars 5 forks source link

Spotify output not playing #11

Open DapperDapp opened 6 years ago

DapperDapp commented 6 years ago

Hi I noticed that when I play internet radio, its fine, but with Spotify, there is not output.

I was looking at the index.js and I noticed that you have bluetooth output for the MPD, but not as a default output for volumio. If I uncomment that commented section will it work?

BluetoothController.prototype.writeAsoundFile = function(mac) {
    var self = this;
    var defer = libQ.defer();
    self.logger.info('Change softmixer device for audio device to:' + mac);
    var asoundcontent = '';
    if (mac !== undefined)
    {
        asoundcontent += 'defaults.bluealsa { \n';
        asoundcontent += 'interface "hci0"            # host Bluetooth adapter \n';
        asoundcontent += '   device "' + mac + '"  # Bluetooth headset MAC address \n';
        asoundcontent += '   profile "a2dp" \n';
        asoundcontent += '}\n';
    }
    fs.writeFile('/home/volumio/.asoundrc', asoundcontent, 'utf8', function(err) {
        if (err) {
            self.logger.info('Cannot write /var/lib/mpd/.asoundrc: ' + err);
        } else {
            self.logger.info('asoundrc file written');
            var mv = execSync('/usr/bin/sudo /bin/mv /home/volumio/.asoundrc /var/lib/mpd/.asoundrc', { uid:1000, gid: 1000, encoding: 'utf8' });
            var apply = execSync('/usr/sbin/alsactl -L -R nrestore', { uid:1000, gid: 1000, encoding: 'utf8' });
            var apply3 = execSync('/usr/sbin/alsactl -L -R nrestore', { uid:1000, gid: 1000, encoding: 'utf8' });
        }
    });
};