Thank you for your donation!


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


Problem: 9.0.6 MPD does not restart after BT disconnected
#1
Hi

I’m very new to Moode and experiencing an issue with Bluetooth. 

I’ve taken things as far as I can with my limited experience.

I can install and start Moode v 9.0.6 on my RPi4B 8Gb and listen via my USB DAC fine.  No problems appear.

Then I can connect to BT and listen to headphones.

BUT even though I have selected MPD to restart when BT is disconnected, MPD does not restart.

BT continues to work, but if I disconnect the headphones and play something, I get the following Alert on screen when using MPD playback:
 
QUOTE
  Failed to open “ALSA Bluetooth” (alsa):
  Failed to open ALSA device “_audioout”. No such process.
UNQUOTE

When I open the Audio tab the selected USB DAC information is greyed out and SCAN is ineffective.   Restarting MPD under Audio tab has no effect.  Powering Moode off and on again has no effect - Moode starts with the Alert and remains silent until I reconnect BT headphones.

The end result is that if I connect to BT then disconnect (either soft disconnect, or by  switching off BT altogether), I am then unable to use Moode over my DAC.

Logs:

This is /var/log/mpd tail log

Code:
pi@moode:/var/log/mpd $ tail log
[17773] D: bluealsa-pcm.c:636: /org/bluealsa/hci0/dev_A8_99_DC_52_19_C4/a2dpsrc/sink: Initializing SW
[17773] D: bluealsa-pcm.c:677: /org/bluealsa/hci0/dev_A8_99_DC_52_19_C4/a2dpsrc/sink: Prepared        
[17773] D: bluealsa-pcm.c:636: /org/bluealsa/hci0/dev_A8_99_DC_52_19_C4/a2dpsrc/sink: Initializing SW
[17624] D: bluealsa-pcm.c:388: /org/bluealsa/hci0/dev_A8_99_DC_52_19_C4/a2dpsrc/sink: Starting        
[17785] D: bluealsa-pcm.c:231: /org/bluealsa/hci0/dev_A8_99_DC_52_19_C4/a2dpsrc/sink: Starting IO loop
Aug 08 00:22 : output: Failed to play on "ALSA Bluetooth" (alsa): snd_pcm_poll_descriptors_revents() f
device                                                                                                
[17773] D: bluealsa-pcm.c:615: /org/bluealsa/hci0/dev_A8_99_DC_52_19_C4/a2dpsrc/sink: Freeing HW      
[17785] D: bluealsa-pcm.c:167: /org/bluealsa/hci0/dev_A8_99_DC_52_19_C4/a2dpsrc/sink: IO thread cleanu
[17773] D: bluealsa-pcm.c:471: /org/bluealsa/hci0/dev_A8_99_DC_52_19_C4/a2dpsrc/sink: Closing         
Aug 08 00:22 : exception: Failed to open audio out

You can see that at 17773 bluealsa is working, but at 00:22, when I closed the headphones, audio out is not opened.


BUT the Alert re no BT device found, after BT is disconnected, suggests that MPD is still looking for a BT connection.  

Finally resuscitation attempts:

Code:
$ sudo systemctl daemon-reload >

sudo systemctl restart MPD

sudo systemctl status MPD

gives this:

Code:
pi@moode:/var/log/mpd $ sudo systemctl status mpd                                                             
● mpd.service - Music Player Daemon
     Loaded: loaded (;;file://moode/lib/systemd/system/mpd.service/lib/systemd/system/mpd.service;;; disabled;
 preset: enabled)
     Active: active (running) since Thu 2024-08-08 00:32:03 BST; 3min 8s ago
       Docs: ;;man:mpd(1)man:mpd(1);;                                                                         
             ;;man:mpd.conf(5)man:mpd.conf(5);;
             ;;file:///usr/share/doc/mpd/html/user.htmlfile:///usr/share/doc/mpd/html/user.html;;
   Main PID: 21927 (mpd)                                                                                      
      Tasks: 6 (limit: 8750)                                                                                  
        CPU: 560ms                                                                                            
     CGroup: /system.slice/mpd.service                                                                        
             └─21927 /usr/bin/mpd --systemd /etc/mpd.conf
                                                                                                              
Aug 08 00:32:02 moode systemd[1]: Starting mpd.service - Music Player Daemon...                               
Aug 08 00:32:03 moode mpd[21927]: Ignoring the 'pid_file' setting in systemd mode                             
Aug 08 00:32:03 moode systemd[1]: Started mpd.service - Music Player Daemon.                                  
But the DAC is still grayed out in the Audio tab and nothing is playing.

Finally, unplugging and repluggin the USB DAC does nothing to change the above.

Thoughts:

This state of affairs may or may not be related to an Alert when I first loaded and configured Moode:

QUOTE
JSON.parse: unexpected end of data at line 1 column 1 of the JSON data
UNQUOTE

This URL

https://stackoverflow.com/questions/2780...-json-data

suggests using Firefox F12 to debug the reason for an empty string .. I can see lots of interesting information there which I really don’t understand!

Hoping for a fix or some pointer to the configuration which will let me switch back to DAC when BT is not in use.

Tks

R
Reply
#2
I can say with a fair degree of confidence that the JSON parse error isn't anything to do with it. I get that often when reconnecting to a recently rebooted player when using Firefox from a desktop. It is to do with Firefox having an out of date pointer in it's cache to the JSON object that holds the play queue (I think).

I believe that the "resume MPD" setting for Bluetooth applies when connecting a Bluetooth source. You cast audio to moOde from a phone or whatever, and MPD will restart and play what ever it was playing before when the phone disconnects.

In your case, you are playing from moOde to a Bluetooth speaker (or phones), and so you need to manually swap back to a non-BT audio device when you are finished I believe. I don't use moOde in this mode so I don't have direct experience.
----------------
Robert
Reply
#3
Thanks for the insights. 

I can restart MPD in the ways listed in my OP, but the DAC remains unconnected and grayed out in Output devices under Audio.

So how might I reconnect it? 

Tks
R
Reply
#4
I don't use this function, but I have a pair of BT headphones, so I tried them out. It seems one must set the Options in the Bluetooth control screen back to "Local Audio" from "Bluetooth Speaker".
----------------
Robert
Reply
#5
Thumbs Up 
That worked thanks!

I think that I assumed that setting MPD to restart after disconnecting from BT would also reconnect the DAC. 

IHMO it should, but that is a subject for a feature request I think.

I will mark this thread as SOLVED and go from there.

Now to discover what else Moode can do Smile

Best
R
Reply


Forum Jump: