mikebrady / shairport-sync

AirPlay and AirPlay 2 audio player
Other
7.15k stars 568 forks source link

[Problem]: Mixing Shairport audio output with other Audio sources #1881

Open Mikka123T opened 1 month ago

Mikka123T commented 1 month ago

What happened?

Hi Mike, I have my RPi 4 set up in a way that it serves as audio source for USB High Quality Sound Card that is outputting to my amp. I can play my TV connected via Bluetooth to Pi at the same time if there is a Mopidy audio stream playing. However I cannot get Shairport to mix with any of other audio sources nor via Alsa, Pulse, Pipewire. Is there a way? I have seen couple of Q like this in the past but it was not solved at the time.

Relevant log output

No response

System Information.

RPi 4, Line6 UX1

Configuration Information.

tried to compile with all soundservers support (pipewire, pulse, alsa).

PulseAudio or PipeWire installed?

How did you install Shairport Sync?

Built from source

Check previous issues

mikebrady commented 1 month ago

Thanks for the post. It is possible to mix Shairport Sync output with others using PipeWire and PulseAudio. The problem with either one of these is that they only become available after the user has logged in through a GUI -- please see PulseAudioAndPipeWire.md.

When the alsa back end is used, Shairport Sync requires exclusive access to an alsa PCM output device, which is usually a DAC. However this output device can alternatively be a digital mixer virtual device called dmix. I've never used it, but maybe others have had some success with it.

Mikka123T commented 1 month ago

Hi Mike, thank you for your reply.

I was trying to set up mixing via various soundservers (pulse, pipewire) and via dmix through alsa for quite a while (cca 1-2 hours during 2 weeks daily) with help of Claude.ai and Chatgpt as I am not proficient enough in alsa, pulse, pipewire.

However I was not able to get it work. Shairport was "monopolizing" output device when playing first or was waiting to be able to monopolize if any of soundsources (mopidy, bluetooth) were playing. It still may be an issue between Monitor and Chair.

I am happy to help troubleshoot if you would like me to, however I would need instructions.

At the end, today I tried to use UxPlay, and to my surprise, after a short fiddling it works as my use case intends.