<SOLVED> No sound w/ Mopidy running as a service

I was having issues getting Mopidy running on my hobby RPi 3B. So today I flashed a new Raspian Stretcher image (Linux raspberrypi 4.9.59-v7+ #1047 SMP Sun Oct 29 12:19:23 GMT 2017 armv7l GNU/Linux) and started the Mopidy (2.1.0) install and configuration from scratch. With the current Raspian Stretcher release, bluez-alsa comes as the default rather than PulseAudio. This simplified the install (i.e., Bluetooth audio support) considerably.

My original hobby system install was Raspian Jessie installed a year ago and upgraded. I then built bluez-alsa in order to send audio to a Bluetooth speaker. I had mpd working so I could listen to Internet radio over the Bluetooth speaker. I wanted to play Spotify playlists which is what brought me to Mopidy. This is all actually a project to get Spotify and Bluetooth tested so I can port the setup to my AIY Voice Kit so I can play Spotify via voice commands to the Google Assistant. But I digress.

I am using mpc because I need to get a cli based interface to work in order to retrofit my AIY Voice Kit. I have now partially succeeded in getting mopidy-spotify to play over Bluetooth… If I run Mopidy from a terminal window I can get audio to play by adding a Spotify playlist (mpc add “spotify-uri” && mpc play). However, if I run Mopidy as a service, there is no audio. Inspecting the logs shows no errors. mpc status / mpc current return the expected (successful) results about what’s “playing”. But just no sound.

I have searched through this forum and searched for “no sound” “mopidy as a service” in general and none of the discussions I read were quite the situation I’m experiencing and none of them provided any suggestions which gave any guidance to troubleshooting my issue.

My ~/.config/mopidy/mopidy.conf file is the default file created by “mopidy config” with these edits:

[audio]
output = alsasink

[local]
enabled = false

[spotify]
username = <Spotify Username>
password = <Spotify Password>
#https://www.mopidy.com/authenticate/#spotify
client_id = <string returned by the mopidy authenticate webpage>
client_secret = <string returned by the mopidy authenticate webpage>
bitrate = 320

pi@raspberrypi:~ $ mopidy
INFO     Starting Mopidy 2.1.0
INFO     Loading config from builtin defaults
INFO     Loading config from /home/pi/.config/mopidy/mopidy.conf
INFO     Loading config from command line options
INFO     Enabled extensions: spotify, mpd, http, stream, m3u, softwaremixer, file
INFO     Disabled extensions: local
INFO     Starting Mopidy mixer: SoftwareMixer
INFO     Starting Mopidy audio
INFO     Starting Mopidy backends: StreamBackend, M3UBackend, FileBackend, SpotifyBackend
INFO     Audio output set to "alsasink"
INFO     Starting Mopidy core
INFO     Logged in to Spotify in offline mode
INFO     Logged in to Spotify in online mode
INFO     Starting Mopidy frontends: MpdFrontend, HttpFrontend
INFO     MPD server running at [::ffff:127.0.0.1]:6600
INFO     HTTP server running at [::ffff:127.0.0.1]:6680
INFO     Starting GLib mainloop
INFO     New MPD connection from [::ffff:127.0.0.1]:53542
...

The Mopidy service configuration file (/etc/mopidy/mopidy.conf):

[core]
cache_dir = /var/cache/mopidy
config_dir = /etc/mopidy
data_dir = /var/lib/mopidy

[logging]
config_file = /etc/mopidy/logging.conf
debug_file = /var/log/mopidy/mopidy-debug.log

[local]
enabled = false
media_dir = /var/lib/mopidy/media

[m3u]
playlists_dir = /var/lib/mopidy/playlists

[audio]
output = alsasink

[spotify]
username = <Spotify Username>
password = <Spotify Password>
client_id = <string returned by the mopidy authenticate webpage>
client_secret = <string returned by the mopidy authenticate webpage>
bitrate = 320

pi@raspberrypi:~ $ sudo service mopidy start
pi@raspberrypi:~ $ sudo service mopidy status
● mopidy.service - Mopidy music server
   Loaded: loaded (/lib/systemd/system/mopidy.service; enabled; vendor preset: enabled)
   Active: active (running) since Wed 2017-12-20 01:16:00 EST; 4min 35s ago
  Process: 4827 ExecStartPre=/bin/chown mopidy:audio /var/cache/mopidy (code=exited, status=0/SUCCESS)
  Process: 4824 ExecStartPre=/bin/mkdir -p /var/cache/mopidy (code=exited, status=0/SUCCESS)
 Main PID: 4829 (mopidy)
   CGroup: /system.slice/mopidy.service
           └─4829 /usr/bin/python /usr/bin/mopidy --config /usr/share/mopidy/conf.d:/etc/mopidy/mopidy.conf

2017-12-20 01:16:02,419 INFO [4829:MainThread] mopidy.__main__: Starting Mopidy 2.1.0
2017-12-20 01:16:02,720 INFO [4829:MainThread] mopidy.config: Loading config from builtin defaults
2017-12-20 01:16:02,729 INFO [4829:MainThread] mopidy.config: Loading config from /etc/mopidy/mopidy.conf
2017-12-20 01:16:02,734 INFO [4829:MainThread] mopidy.config: Loading config from command line options
2017-12-20 01:16:02,911 INFO [4829:MainThread] mopidy.__main__: Enabled extensions: spotify, mpd, http, stream, m3u, softwaremixer, file
2017-12-20 01:16:02,914 INFO [4829:MainThread] mopidy.__main__: Disabled extensions: local
2017-12-20 01:16:03,633 INFO [4829:MainThread] mopidy.commands: Starting Mopidy mixer: SoftwareMixer
2017-12-20 01:16:03,641 INFO [4829:MainThread] mopidy.commands: Starting Mopidy audio
2017-12-20 01:16:03,649 INFO [4829:MainThread] mopidy.commands: Starting Mopidy backends: StreamBackend, M3UBackend, FileBackend, SpotifyBackend
2017-12-20 01:16:03,727 INFO [4829:Audio-2] mopidy.audio.actor: Audio output set to "alsasink"
2017-12-20 01:16:04,023 INFO [4829:MainThread] mopidy.commands: Starting Mopidy core
2017-12-20 01:16:04,227 INFO [4829:SpotifyEventLoop] spotify.session: Spotify logged in
2017-12-20 01:16:04,229 INFO [4829:SpotifyEventLoop] mopidy_spotify.backend: Logged in to Spotify in offline mode
2017-12-20 01:16:04,851 INFO [4829:SpotifyEventLoop] mopidy_spotify.backend: Logged in to Spotify in online mode
2017-12-20 01:16:24,453 INFO [4829:MainThread] mopidy.commands: Starting Mopidy frontends: MpdFrontend, HttpFrontend
2017-12-20 01:16:24,457 INFO [4829:MainThread] mopidy.mpd.actor: MPD server running at [::ffff:127.0.0.1]:6600
2017-12-20 01:16:24,466 INFO [4829:HttpFrontend-12] mopidy.http.actor: HTTP server running at [::ffff:127.0.0.1]:6680
2017-12-20 01:16:24,468 INFO [4829:MainThread] mopidy.commands: Starting GLib mainloop
2017-12-20 01:16:57,588 INFO [4829:MpdSession-13] mopidy.mpd.session: New MPD connection from [::ffff:127.0.0.1]:53580
...

Basically, the configurations are exactly the same except that the file folders point to different locations for the interactive version versus the service version.

So, why is there no sound? I have nothing in the Mopidy log and no errors from mpc to give any sort of clue.

Thanks in advance for your insights.

I’m not familiar with alsa-bluez or how it integrates with alsa. Is there sound when using the onboard line-out plug with Mopidy as a service? Does that log include the point where you actually tried to play something?

Yeah, I realized that I left off that basic troubleshooting step when I laid in bed after submitting my post. Arrgh!

Yes, the log includes all relevant information other than the “repeated” lines re: new MPD connections. An “INFO [4829:MpdSession-13] mopidy.mpd.session: New MPD connection from [::ffff:127.0.0.1]:53580” line is generated for each new mpc action (e.g., clear, add, play, stop, volume, current, status, …). In my early Mopidy troubleshooting, if there was a problem, one would see an error message generated in the output log.

bluez-alsa is the Bluetooth driver for ALSA. It now comes “natively” as part of Raspian (So glad! There is no bluez-alsa install package. The manual build was incredibly complex for a relatively inexperienced person like me. Lots of trial and error on how to properly install dependencies!).

Anyway, … I switched the audio out from the Bluetooth out to the Analog out via the Desktop GUI dialog. I’m still using alsasink (rather than the default autoaudiosink). Since Mopidy’s default is to use PulseAudio and PulseAudio is not installed on Raspian Stretch by default, I am using ALSA. Anyway, I get sound from the analog output when Mopidy runs as a service.

It seems that, based on this test, the issue may be in the ALSA configuration for Bluetooth? I will admit that ALSA configuration completely baffles me. I’ve read and read but the combinations of hw, cards, pcm, mixers, virtual, … is extremely confusing. I have not found a good tutorial that explains the hierarchy with a diagram of how this all “connects” and how the ALSA configuration “directs” and controls the audio paths. Baffling!

Do you agree that it might be ALSA configs? If not, other thoughts? If so, any suggestions on ALSA configs… or a good “ALSA for Dummies” resource?

Thanks!

How does the Desktop GUI perform the switch, does it switch it per user or for the whole system? What’s the output of aplay -L ? What’s the contents of /etc/asound.conf ? Is bluez-alsa the same as BlueALSA?

Also, does bluez-alsa/bluealsa write to any log files?

As reference for our dialog:
https://www.raspberrypi.org/blog/raspbian-stretch/
https://github.com/Arkq/bluez-alsa

pi@raspberrypi:~ $ aplay -L
null
    Discard all samples (playback) or generate zero samples (capture)
default
sysdefault:CARD=ALSA
    bcm2835 ALSA, bcm2835 ALSA
    Default Audio Device
dmix:CARD=ALSA,DEV=0
    bcm2835 ALSA, bcm2835 ALSA
    Direct sample mixing device
dmix:CARD=ALSA,DEV=1
    bcm2835 ALSA, bcm2835 IEC958/HDMI
    Direct sample mixing device
dsnoop:CARD=ALSA,DEV=0
    bcm2835 ALSA, bcm2835 ALSA
    Direct sample snooping device
dsnoop:CARD=ALSA,DEV=1
    bcm2835 ALSA, bcm2835 IEC958/HDMI
    Direct sample snooping device
hw:CARD=ALSA,DEV=0
    bcm2835 ALSA, bcm2835 ALSA
    Direct hardware device without any conversions
hw:CARD=ALSA,DEV=1
    bcm2835 ALSA, bcm2835 IEC958/HDMI
    Direct hardware device without any conversions
plughw:CARD=ALSA,DEV=0
    bcm2835 ALSA, bcm2835 ALSA
    Hardware device with all software conversions
plughw:CARD=ALSA,DEV=1
    bcm2835 ALSA, bcm2835 IEC958/HDMI
    Hardware device with all software conversions

There are no asound.conf files present anywhere. The only configuration file (.asoundrc) is in the ‘pi’ home directory. I did not create or edit this file. This had to be generated by my actions via the Bluetooth and Audio controls on the right hand side of the Desktop Menu Bar (i.e., pairing & connecting).

pi@raspberrypi:~ $ cat .asoundrc 
pcm.!default {
	type plug
	slave.pcm {
		type bluealsa
		device "C9:50:76:78:FE:7A"
		profile "a2dp"
	}
}

ctl.!default {
	type bluealsa
}

Other ALSA configuration files:

/usr/share/alsa/alsa.conf

#
#  ALSA library configuration file
#

# pre-load the configuration files

@hooks [
	{
		func load
		files [
			{
				@func concat
				strings [
					{ @func datadir }
					"/alsa.conf.d/"
				]
			}
			"/etc/asound.conf"
			"~/.asoundrc"
		]
		errors false
	}
]

# load card-specific configuration files (on request)

cards.@hooks [
	{
		func load
		files [
			{
				@func concat
				strings [
					{ @func datadir }
					"/cards/aliases.conf"
				]
			}
		]
	}
	{
		func load_for_all_cards
		files [
			{
				@func concat
				strings [
					{ @func datadir }
					"/cards/"
					{ @func private_string }
					".conf"
				]
			}
		]
		errors false
	}
]

#
# defaults
#

# show all name hints also for definitions without hint {} section
defaults.namehint.showall on
# show just basic name hints
defaults.namehint.basic on
# show extended name hints
defaults.namehint.extended on
#
defaults.ctl.card 0
defaults.pcm.card 0
defaults.pcm.device 0
defaults.pcm.subdevice -1
defaults.pcm.nonblock 1
defaults.pcm.compat 0
defaults.pcm.minperiodtime 5000		# in us
defaults.pcm.ipc_key 5678293
defaults.pcm.ipc_gid audio
defaults.pcm.ipc_perm 0660
defaults.pcm.dmix.max_periods 0
defaults.pcm.dmix.rate 48000
defaults.pcm.dmix.format "unchanged"
defaults.pcm.dmix.card defaults.pcm.card
defaults.pcm.dmix.device defaults.pcm.device
defaults.pcm.dsnoop.card defaults.pcm.card
defaults.pcm.dsnoop.device defaults.pcm.device
defaults.pcm.front.card defaults.pcm.card
defaults.pcm.front.device defaults.pcm.device
defaults.pcm.rear.card defaults.pcm.card
defaults.pcm.rear.device defaults.pcm.device
defaults.pcm.center_lfe.card defaults.pcm.card
defaults.pcm.center_lfe.device defaults.pcm.device
defaults.pcm.side.card defaults.pcm.card
defaults.pcm.side.device defaults.pcm.device
defaults.pcm.surround21.card defaults.pcm.card
defaults.pcm.surround21.device defaults.pcm.device
defaults.pcm.surround40.card defaults.pcm.card
defaults.pcm.surround40.device defaults.pcm.device
defaults.pcm.surround41.card defaults.pcm.card
defaults.pcm.surround41.device defaults.pcm.device
defaults.pcm.surround50.card defaults.pcm.card
defaults.pcm.surround50.device defaults.pcm.device
defaults.pcm.surround51.card defaults.pcm.card
defaults.pcm.surround51.device defaults.pcm.device
defaults.pcm.surround71.card defaults.pcm.card
defaults.pcm.surround71.device defaults.pcm.device
defaults.pcm.iec958.card defaults.pcm.card
defaults.pcm.iec958.device defaults.pcm.device
defaults.pcm.modem.card defaults.pcm.card
defaults.pcm.modem.device defaults.pcm.device
# truncate files via file or tee PCM
defaults.pcm.file_format	"raw"
defaults.pcm.file_truncate	true
defaults.rawmidi.card 0
defaults.rawmidi.device 0
defaults.rawmidi.subdevice -1
defaults.hwdep.card 0
defaults.hwdep.device 0
defaults.timer.class 2
defaults.timer.sclass 0
defaults.timer.card 0
defaults.timer.device 0
defaults.timer.subdevice 0

#
#  PCM interface
#

# redirect to load-on-demand extended pcm definitions
pcm.cards cards.pcm

pcm.default cards.pcm.default
pcm.sysdefault cards.pcm.default
pcm.front cards.pcm.front
pcm.rear cards.pcm.rear
pcm.center_lfe cards.pcm.center_lfe
pcm.side cards.pcm.side
pcm.surround21 cards.pcm.surround21
pcm.surround40 cards.pcm.surround40
pcm.surround41 cards.pcm.surround41
pcm.surround50 cards.pcm.surround50
pcm.surround51 cards.pcm.surround51
pcm.surround71 cards.pcm.surround71
pcm.iec958 cards.pcm.iec958
pcm.spdif iec958
pcm.hdmi cards.pcm.hdmi
pcm.dmix cards.pcm.dmix
pcm.dsnoop cards.pcm.dsnoop
pcm.modem cards.pcm.modem
pcm.phoneline cards.pcm.phoneline

pcm.hw {
	@args [ CARD DEV SUBDEV ]
	@args.CARD {
		type string
		default {
			@func getenv
			vars [
				ALSA_PCM_CARD
				ALSA_CARD
			]
			default {
				@func refer
				name defaults.pcm.card
			}
		}
	}
	@args.DEV {
		type integer
		default {
			@func igetenv
			vars [
				ALSA_PCM_DEVICE
			]
			default {
				@func refer
				name defaults.pcm.device
			}
		}
	}
	@args.SUBDEV {
		type integer
		default {
			@func refer
			name defaults.pcm.subdevice
		}
	}		
	type hw
	card $CARD
	device $DEV
	subdevice $SUBDEV
	hint {
		show {
			@func refer
			name defaults.namehint.extended
		}
		description "Direct hardware device without any conversions"
	}
}

pcm.plughw {
	@args [ CARD DEV SUBDEV ]
	@args.CARD {
		type string
		default {
			@func getenv
			vars [
				ALSA_PCM_CARD
				ALSA_CARD
			]
			default {
				@func refer
				name defaults.pcm.card
			}
		}
	}
	@args.DEV {
		type integer
		default {
			@func igetenv
			vars [
				ALSA_PCM_DEVICE
			]
			default {
				@func refer
				name defaults.pcm.device
			}
		}
	}
	@args.SUBDEV {
		type integer
		default {
			@func refer
			name defaults.pcm.subdevice
		}
	}		
	type plug
	slave.pcm {
		type hw
		card $CARD
		device $DEV
		subdevice $SUBDEV
	}
	hint {
		show {
			@func refer
			name defaults.namehint.extended
		}
		description "Hardware device with all software conversions"
	}
}

pcm.plug {
	@args [ SLAVE ]
	@args.SLAVE {
		type string
	}
	type plug
	slave.pcm $SLAVE
}

pcm.shm {
	@args [ SOCKET PCM ]
	@args.SOCKET {
		type string
	}
	@args.PCM {
		type string
	}
	type shm
	server $SOCKET
	pcm $PCM
}

pcm.tee {
	@args [ SLAVE FILE FORMAT ]
	@args.SLAVE {
		type string
	}
	@args.FILE {
		type string
	}
	@args.FORMAT {
		type string
		default {
			@func refer
			name defaults.pcm.file_format
		}
	}
	type file
	slave.pcm $SLAVE
	file $FILE
	format $FORMAT
	truncate {
		@func refer
		name defaults.pcm.file_truncate
	}
}

pcm.file {
	@args [ FILE FORMAT ]
	@args.FILE {
		type string
	}
	@args.FORMAT {
		type string
		default {
			@func refer
			name defaults.pcm.file_format
		}
	}
	type file
	slave.pcm null
	file $FILE
	format $FORMAT
	truncate {
		@func refer
		name defaults.pcm.file_truncate
	}
}

pcm.null {
	type null
	hint {
		show {
			@func refer
			name defaults.namehint.basic
		}
		description "Discard all samples (playback) or generate zero samples (capture)"
	}
}

#
#  Control interface
#
	
ctl.sysdefault {
	type hw
	card {
		@func getenv
		vars [
			ALSA_CTL_CARD
			ALSA_CARD
		]
		default {
			@func refer
			name defaults.ctl.card
		}
	}
	hint.description "Default control device"
}
ctl.default ctl.sysdefault

ctl.hw {
	@args [ CARD ]
	@args.CARD {
		type string
		default {
			@func getenv
			vars [
				ALSA_CTL_CARD
				ALSA_CARD
			]
			default {
				@func refer
				name defaults.ctl.card
			}
		}
	}
	type hw
	card $CARD
	hint.description "Direct control device"
}

ctl.shm {
	@args [ SOCKET CTL ]
	@args.SOCKET {
		type string
	}
	@args.CTL {
		type string
	}
	type shm
	server $SOCKET
	ctl $CTL
}

#
#  RawMidi interface
#

rawmidi.default {
	type hw
	card {
		@func getenv
		vars [
			ALSA_RAWMIDI_CARD
			ALSA_CARD
		]
		default {
			@func refer
			name defaults.rawmidi.card
		}
	}
	device {
		@func igetenv
		vars [
			ALSA_RAWMIDI_DEVICE
		]
		default {
			@func refer
			name defaults.rawmidi.device
		}
	}
	hint.description "Default raw MIDI device"
}

rawmidi.hw {
	@args [ CARD DEV SUBDEV ]
	@args.CARD {
		type string
		default {
			@func getenv
			vars [
				ALSA_RAWMIDI_CARD
				ALSA_CARD
			]
			default {
				@func refer
				name defaults.rawmidi.card
			}
		}
	}
	@args.DEV {
		type integer
		default {
			@func igetenv
			vars [
				ALSA_RAWMIDI_DEVICE
			]
			default {
				@func refer
				name defaults.rawmidi.device
			}
		}
	}
	@args.SUBDEV {
		type integer
		default -1
	}
	type hw
	card $CARD
	device $DEV
	subdevice $SUBDEV
	hint {
		description "Direct rawmidi driver device"
		device $DEV
	}
}

rawmidi.virtual {
	@args [ MERGE ]
	@args.MERGE {
		type string
		default 1
	}
	type virtual
	merge $MERGE
}

#
#  Sequencer interface
#

seq.default {
	type hw
	hint.description "Default sequencer device"
}

seq.hw {
	type hw
}

#
#  HwDep interface
#

hwdep.default {
	type hw
	card {
		@func getenv
		vars [
			ALSA_HWDEP_CARD
			ALSA_CARD
		]
		default {
			@func refer
			name defaults.hwdep.card
		}
	}
	device {
		@func igetenv
		vars [
			ALSA_HWDEP_DEVICE
		]
		default {
			@func refer
			name defaults.hwdep.device
		}
	}
	hint.description "Default hardware dependent device"
}

hwdep.hw {
	@args [ CARD DEV ]
	@args.CARD {
		type string
		default {
			@func getenv
			vars [
				ALSA_HWDEP_CARD
				ALSA_CARD
			]
			default {
				@func refer
				name defaults.hwdep.card
			}
		}
	}
	@args.DEV {
		type integer
		default {
			@func igetenv
			vars [
				ALSA_HWDEP_DEVICE
			]
			default {
				@func refer
				name defaults.hwdep.device
			}
		}
	}
	type hw
	card $CARD
	device $DEV
	hint {
		description "Direct hardware dependent device"
		device $DEV
	}
}

#
#  Timer interface
#

timer_query.default {
	type hw
}

timer_query.hw {
	type hw
}

timer.default {
	type hw
	class {
		@func refer
		name defaults.timer.class
	}
	sclass {
		@func refer
		name defaults.timer.sclass
	}
	card {
		@func refer
		name defaults.timer.card
	}
	device {
		@func refer
		name defaults.timer.device
	}
	subdevice {
		@func refer
		name defaults.timer.subdevice
	}
	hint.description "Default timer device"
}

timer.hw {
	@args [ CLASS SCLASS CARD DEV SUBDEV ]
	@args.CLASS {
		type integer
		default {
			@func refer
			name defaults.timer.class
		}
	}
	@args.SCLASS {
		type integer
		default {
			@func refer
			name defaults.timer.sclass
		}
	}
	@args.CARD {
		type string
		default {
			@func refer
			name defaults.timer.card
		}
	}
	@args.DEV {
		type integer
		default {
			@func refer
			name defaults.timer.device
		}
	}
	@args.SUBDEV {
		type integer
		default {
			@func refer
			name defaults.timer.subdevice
		}
	}
	type hw
	class $CLASS
	sclass $SCLASS
	card $CARD
	device $DEV
	subdevice $SUBDEV
	hint {
		description "Direct timer device"
		device $DEV
	}
}

/usr/share/alsa/alsa.conf.d/20-bluealsa.conf

# BlueALSA integration setup

defaults.bluealsa.interface "hci0"
defaults.bluealsa.profile "a2dp"
defaults.bluealsa.delay 20000

ctl.bluealsa {
	@args [ HCI ]
	@args.HCI {
		type string
		default {
			@func refer
			name defaults.bluealsa.interface
		}
	}
	type bluealsa
	interface $HCI
}

pcm.bluealsa {
	@args [ HCI DEV PROFILE DELAY ]
	@args.HCI {
		type string
		default {
			@func refer
			name defaults.bluealsa.interface
		}
	}
	@args.DEV {
		type string
		default {
			@func refer
			name defaults.bluealsa.device
		}
	}
	@args.PROFILE {
		type string
		default {
			@func refer
			name defaults.bluealsa.profile
		}
	}
	@args.DELAY {
		type integer
		default {
			@func refer
			name defaults.bluealsa.delay
		}
	}
	type plug
	slave.pcm {
		type bluealsa
		interface $HCI
		device $DEV
		profile $PROFILE
		delay $DELAY
	}
	hint {
		show {
			@func refer
			name defaults.namehint.extended
		}
		description "Bluetooth Audio Hub"
	}
}

I searched for log files for alsa, sound, blue and found none.

Regards.

Mike

So this is the problem. That sets up Bluetooth audio for your user (pi). That does not set up Bluetooth audio for any other users of the system. The mopidy user which runs the mopidy service therefore knows nothing about your bluetooth setup. /etc/asound.conf is where system-wide ALSA settings go. ~/.asoundrc is where user-specific ALSA settings go. So maybe it’s a simple case of copying that file over.

Or maybe there is an option in that Raspbian control dialogue to set the changes system-wide? I had a look but it wasn’t obvious to me where the source code for that dialogue thing is.

Makes perfect sense! So simple once the problem is identified :wink:

So, I copied the contents of the .asoundrc into a newly created /etc/asound.conf. I then renamed the ‘pi’ .asoundrc so it would not be “present”. I then rebooted. Once I have the speaker paired and trusted, it would typically re-connect after reboot. With these changes, the speaker did not re-connect. I re-connected it “manually” via the Desktop Menu Bar audio dialog. I then tried playing a Spotify playlist and, voila, sound! I ended up leaving the ‘pi’ .asoundrc in place to cause the speaker to reconnect at reboot. But having the speaker defined in the system wide asound.conf makes the speaker “known” and thus we now have sound with Mopidy running as a service.

A bit of a new issue is that the sound stutters some. I’m not sure if this is current “environmental” (Wi-Fi or Bluetooth) issues vs. how it was working before or it’s some issue internal Mopidy issue with this setup. But that’s a different issue which, if it persists, I’ll investigate and submit a new post if necessary.

Now, on to installing the TuneIn backend extension. After that, figuring out what the mpc syntax for adding a radio station to the Mopidy queue. I didn’t see this documented in the extension readme on github. Any suggestions on finding documentation on cli commands for TuneIn?

In any case, thanks for your help!

Mike

I had a very similar problem and was tearing my hair out trying to find why mopidy isn’t finding my asoundrc settings. Thank you so much!