forslund / mopidy_skill

A Mycroft skill for controlling the mopidy media player
GNU General Public License v3.0
15 stars 14 forks source link

Mycroft seems to lose audio capabilities after playing music. #2

Open ghost opened 7 years ago

ghost commented 7 years ago

Mycroft seems to stop being able to speak, yet can hear me talk to it.

ALSA lib pcm_dmix.c:1052:(snd_pcm_dmix_open) unable to open slave aplay: main:788: audio open error: Device or resource busy

forslund commented 7 years ago

Thanks for reporting! May I ask which os/platform this is? and maybe which sound system you're using (alsa/pulse audio/etc)

ghost commented 7 years ago

Arch linux alsa and pulse both installed. It is only when I have something that uses alsa open, like when it plays something from mopidy, or if I open pavucontrol. If I kill pulse it still has issues, it seems that mycroft is not using dmix?

forslund commented 7 years ago

Could it be similar to this: https://github.com/mopidy/mopidy/issues/954

ghost commented 7 years ago

I start mopidy from cli as my own user, I use mopidy everyday and have yet to encounter this issue with anything other than mycroft, and still, mycroft is the only thing affected.

Does mycroft run as its own user if I run it from my home directory? I will have to check this next time I am on my linux box

forslund commented 7 years ago

No mycroft should run as the current user unless it's not installed using a package manager.

You might try to use paplay instead of aplay for mycroft by editing your ~/.mycroft/mycroft.conf and setting

"play_wav_cmdline": "paplay %1"

(of you add it in the middle of a bunch of stuff remember to add a , at the end of the line)

If the file doesn't exist be ware that it's in json format so creating a new file with this parameter should look like this

{
  "play_wav_cmdline": "paplay %1"
}

Using my debian and Ubuntu systems I have had no similar issues, I should somehow get an Arch machine to test on...

ghost commented 7 years ago

It is not installed from pacman/pacaur, as the aur version is outdated and gave me weird issues. I will try this now and let you know! Thanks for all your help!

Edit: Yea no that broke all sound as soon as mycroft started.

Voice log: https://pastebin.com/z675aE3e

forslund commented 7 years ago

Ok, apparently a bad idea =) Does paplay work from the command line?

The weird thing in the log is that it mentions jack. During my lunch break I'll have to check my log to see if I have the same message.

john-ee commented 6 years ago

Hello ! I am also encountering this problem with Mycroft and Mopidy using Spotify. When i play something Mycroft does not speak anymore I installed it on Xubuntu. In my configuration I already have paplay. Has there any been advance on this issue ?

EDIT : I followed the link mentioned and I got it working

forslund commented 6 years ago

@john-ee the link to the mopidy issue? Care to add a section in the readme to document the procedure?

john-ee commented 6 years ago

@forslund the link you gave here https://github.com/mopidy/mopidy/issues/954 More exactly I did followed the first two steps here : https://wiki.archlinux.org/index.php/Music_Player_Daemon/Tips_and_tricks#Local_.28with_separate_mpd_user.29 Then I added this to the mopidy configuration :

[audio]
output = pulsesink server=127.0.0.1

As for the radme, I never contributed to another git, should pull the repo, modify the readme then have a pull request ?

john-ee commented 6 years ago

hum it turns out Mycroft loses its audio as soon as Mopidy is used and if the music is lowered. Then it does not go back up.

Edit : Seems like the error happens when Mopidy start before Mycroft