RPi3/OSMC, bluetooth and mpd configuration help please

I have music playing to KEF_MUO when connected by bluetooth (BT) to a RPi/OSMC using a phone wifi connection and BubbleUPnP as the control point.
The problem with this is that a break in the wifi connection interrupts the music so I want to adopt the openhome/Linn approach and have the playlist working from the RPi so that once playing the phone may be away and not connected.
To achieve this I am using upmpdcli and mpd on the RPi and control using BubbleDS on phone.

My problem is that with BT device on and connected I can see it on kodi under Settings>System>Audio>Audio output device as ALSA:KEF_MUO but I cannot see it when I use aplay -l.

To have music playing from mpd I must configure mpd.conf to include the audio output section for the ALSA:KEF_MUO thus, from the mpd.conf file:-

# An example of an ALSA output:
#
audio_output {
        type            "alsa"
        name            "My ALSA Device"
#       device          "hw:0,0"        # optional
#       mixer_type      "hardware"      # optional
#       mixer_device    "default"       # optional
#       mixer_control   "PCM"           # optional
#       mixer_index     "0"             # optional
}
#

How do I find the identity of the device here?

Use the name you have assigned to it in the .asoundrc file.

aplay -l won’t list it, aplay -L should list it.

Hi Graham,
I had done that. Here is what I have:

osmc@osmc-Barnaby:~$ aplay -L
null
    Discard all samples (playback) or generate zero samples (capture)
kefmuo
    MUO
default:CARD=ALSA
    bcm2835 ALSA, bcm2835 ALSA
    Default Audio Device
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
dmix:CARD=ALSA,DEV=2
    bcm2835 ALSA, bcm2835 IEC958/HDMI1
    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
dsnoop:CARD=ALSA,DEV=2
    bcm2835 ALSA, bcm2835 IEC958/HDMI1
    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
hw:CARD=ALSA,DEV=2
    bcm2835 ALSA, bcm2835 IEC958/HDMI1
    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
plughw:CARD=ALSA,DEV=2
    bcm2835 ALSA, bcm2835 IEC958/HDMI1
    Hardware device with all software conversions
osmc@osmc-Barnaby:~$ 

Something not right as there are no colons.

Here is my .asoundrc:-

osmc@osmc-Barnaby:~$ cat .asoundrc
# This file describes the bluetooth sinks available for Kodi to play to
# add lines like the following for each BT device (speaker or headphones)

pcm.kefmuo {
type plug
slave.pcm {
        type bluealsa
        device "40:EF:4C:CC:DE:9E"
        profile "a2dp"
}
        hint { show on description "MUO"}
}

# using the MAC of the device (see bluetoothctl) instead of 12:34:56:78:9A:BC
# Use any letters or numbers for the description which will show up in Settings-System-Audio
osmc@osmc-Barnaby:~$ 

Here is what I have in Audio Output section of my /etc/mpd.conf:-

# An example of an ALSA output:
#
audio_output {
        type            "alsa"
        name            "MUO"
        device          "hw:0,2"        # optional
#       mixer_type      "hardware"      # optional
#       mixer_device    "default"       # optional
#       mixer_control   "PCM"           # optional
#       mixer_index     "0"             # optional
}
#

Clearly this isn’t correct and I am groping in the dark. There are very many options in this file so shall need your help here but none of my more obvious attempts worked and I don’t think mpd is playing but some other sound source which then always goes to HDMI.

  1. if you post code with # in it, you can use the </> button in the toolbar here to display it properly.
  2. your mpd.conf should probably say name "kefmuo" and you must comment out the line with device in it, like this:
audio_output {
        type            "alsa"
        name            "kefmuo"
#       device          "hw:0,2"        # optional
#       mixer_type      "hardware"      # optional
#       mixer_device    "default"       # optional
#       mixer_control   "PCM"           # optional
#       mixer_index     "0"             # optional
}
  1. I’m mystified why you would want to be using mpd when OSMC comes with a perfectly good media player called Kodi
1 Like

… Instead of simply installing raspios which likely has a more straightforward bluetooth implementation than OSMC which MUST accommodate Kodi (which you obviously have no use for)

To be honest, our support personnel have little motivation to assist with this issue since it’s a use case outside of the software’s designed purpose. Imagine asking Ryobi to provide support for the drill they manufactured, but you want to drive a nail…

2 Likes

Hi Graham,
Many thanks. I am sorry to have wandered off piste here. I lent my SD card usb adaptor and can’t get it back until after holiday. The OSMC RPi was the only one I had and at least with your help I have the bluetooth working as headless device as intended and for which many thanks again.

The issue I raised regarding the ability to un-couple the wifi phone by using the openhome concepts realised by uppdcli and mpd is an RPi question not particularly an OSMC question which I have run into. I am trying to learn and understand, just a slow learner. Thanks for your help. Will visit again when I have burnt a new SD card. Meanwhile Happy Christmas and Covid free New Year.
Budgie

Hi Graham,
Have obtained the SD card adaptor and been able to start over with Rapsberry Pi OS Lite. I see from the notes that bluealsa is no longer included;-

  • PulseAudio now included and running by default
    • Bluealsa Bluetooth interface removed - Bluetooth audio is now handled by PulseAudio

Of course I shall now install bluez-alsa and go through the setup you explained but I wonder why bluealsa should have been omitted from latest release of this OS.

Have a good Christmas and safe and covid free new year.
Budgie

You should ask them, but I suspect pulseaudio makes more sense in a desktop environment.

Raspberry PiOS has chosen to use PulseAudio so that multiple applications can send audio simultaneously, which is the expected behaviour of a traditional deskop.

Conversely, we’re moving from PulseAudio to bluez-alsa because we want to reduce the number of dependencies that we have. We don’t have a significant use case for dual audio output: and that use case would be streaming to two outputs simultaneously, rather than allowing two applications to use a single output simultaneously.

Hi Sam,
Many thanks for your answer. Makes sense to me and suits my purposes perfectly for an headless device. All I have to do now is make sure PulseAudio doesn’t get in the way of my efforts to get upmpdcli and mpd working.
Many thanks,
Budgie.