Open JoernUhl opened 3 years ago
@ChisSoc can you help here?
I had a similar issue in another context. And indeed, ALSA resources are exclusive to a single process using them. With mpc, it takes hold of the Alsa ressource when playing music or when pausing. When you do a proper stop with mpc stop
, the Alsa ressource is released and another process can use them. Check with mpc status
which state mpc is in.
For me that was good enough. I did no investigate further how to configure Alsa to mix together multiple streams. It should be possible with the dmix plug. Hit your favorite search enginge with alsa mixer two streams
or similar. Good luck!
Hi @ChisSoc,
Thank you very much for your reply.
Once I play some music using RPi-Jukebox-RFID and run this command mpc status
, I receive this output:
Some Artist - Some Song
[playing] #1/1 0:00/0:00 (0%)
volume: 15% repeat: off random: off single: off consume: off
When I run mpc stop
followed by mpc status
I receive this output:
volume: 15% repeat: off random: off single: off consume: off
However, at all times I am receiving this error running systemctl status shairport-sync
:
warning: alsa: error -16 ("Device or resource busy") opening alsa device "hw:0".
I also tried to add the following to my .asoundrc
file to allow for multiple streams:
pcm.!default {
type plug
slave.pcm "dmixer"
}
pcm.dmixer {
type dmix
ipc_key 1024
slave {
pcm "hw:1,0"
period_time 0
period_size 1024
buffer_size 4096
rate 44100
}
bindings {
0 0
1 1
}
}
ctl.dmixer {
type hw
card 0
}
Unfortunately with the same error messages as stated above.
Do you have any other idea what I could try? I appreciate all your help! Thank you very much :-)
Looking at your /etc/shairport-sync.conf, I'd it is likely this is the culprit. You are trying to use the hardware card directly instead of any of your Alsa devices. You will need to setup both, shariport and mpd, to use the dmixer as device.
First try playing sound with aplay -D dmixer /usr/share/sounds/alsa/Front_Center.wav
to ensure your asound is correctly set up. Then try playing multiple files at once from different consoles.
Then check your mpd.conf. You might find the issue helpful #1198 for the mpd.conf options.
Hi,
I hope it is correct that I am posting my question here as I am pretty sure it is actually not an issue with RPi-Jukebox-RFID but rather my own inability to make this work. Please let me know if this question should be asked elsewhere :-)
I installed shairport-sync along with RPi-Jukebox-RFID. I installed both on a Raspberry Pi 3, with an Adafruit Speaker Bonnet. If I use the functionality provided by RPi-Jukebox-RFID, I get sound and music plays as it should. However, if I try to use airplay from any of my iDevices, no sound is heard.
After running the command
systemctl status shairport-sync
I get the following output a couple of times:as well as:
Running
aplay --list-devices
, I get:In
/etc/shairport-sync.conf
I added within thealsa
section:and
I guess the RPi-Jukebox-RFID installation occupies the Adafruit Speaker Bonnet and is not letting shairport-sync play any music? I would appreciate any tipps or pointers into the right direction :-)
And again, sorry if I am posting this question in the wrong forum.
Thanks a lot for your help,
jrn