mopidy_skill icon indicating copy to clipboard operation
mopidy_skill copied to clipboard

Mycroft seems to lose audio capabilities after playing music.

Open ghost opened this issue 7 years ago • 11 comments

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

ghost avatar May 11 '17 02:05 ghost

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

forslund avatar May 11 '17 05:05 forslund

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?

ghost avatar May 11 '17 06:05 ghost

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

forslund avatar May 11 '17 06:05 forslund

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

ghost avatar May 11 '17 06:05 ghost

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...

forslund avatar May 11 '17 06:05 forslund

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

ghost avatar May 12 '17 01:05 ghost

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.

forslund avatar May 12 '17 06:05 forslund

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

john-ee avatar Jan 31 '18 11:01 john-ee

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

forslund avatar Jan 31 '18 14:01 forslund

@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 avatar Jan 31 '18 14:01 john-ee

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

john-ee avatar Feb 01 '18 16:02 john-ee