snapcast icon indicating copy to clipboard operation
snapcast copied to clipboard

No audio coming from Shairport setup

Open gerroon opened this issue 10 months ago • 7 comments

Hi

I have Snapcast mesh that works from Debian (Server) ->Debian (client) -> Windows 11 (client) -> Android (client). I can connect my Iphone 15 to the Host via BT and play audio to all other clients. However the Shairport stream doesnt produce any audio when I connect it via the Airplay protocol.

(works) stream = pipe:///tmp/snapfifo?name=snapcast

(no audio) stream=airplay:////usr/bin/shairport-sync?name=snapcast&devicename=snapcast&sampleformat=44100:16:2&port=7000

Debian, Snap Server/Client 0.30, IOS 18.3 Music App Airplay

Thanks

gerroon avatar Feb 11 '25 07:02 gerroon

I was just struggling with similar yesterday. Try this, it worked for me:

source = airplay:////usr/bin/shairport-sync?name=snapcast&devicename=snapcast

(I'm actually using source = airplay:///shairport-sync?name=snapcast&devicename=snapcast note 3 /// not ////)

and also after connecting the iphone adjusting the volume up seemed to be necessary sometimes, and waiting 3 or 4 seconds for it to come through (there's quite a lot of latency).

vjdw avatar Feb 11 '25 08:02 vjdw

@vjdw Thanks, that didn't work either. I can see that Snapserver spawns Shairport fine, it shows up on my Iphone as well.

I am on Pipewire and this is my PW config, I wonder if this has something to do with it. Do I need more setup on the PW side?

Edit 1: Another thing I can think of is that, it seems like SP is run as root, since SS is running as root. Root generally cant access the user space PW. I wonder if that is the issue. But that shouldn't be an issue given Snapserver doesnt play any audio, only the client does. Somehow when I play to Shairport from my phone, I don't see the player kicking in the Pulse audio panel (I have Pulse for PW enabled)

Edit 2: I can broadcast to Shairport if I start SP as my user in the terminal with whatever defautls it has, and I can use snapcast sink to play to all clients. It seems like the issue isn't on SP side.


context.modules = [
{   name = libpipewire-module-pipe-tunnel
    args = {
        node.name="snapcast"
        tunnel.mode = sink
        #tunnel.may-pause = true
        # Set the pipe name to tunnel to
        pipe.filename = "/tmp/snapfifo"
        audio.format=S16LE
        audio.rate=48000
        #audio.channels=<number of channels>
        #audio.position=<channel map>
        #target.object=<remote target node>
        stream.props = {
            # extra sink properties
        }
    }
}
]


gerroon avatar Feb 11 '25 16:02 gerroon

I'm not using Pipewire in my Snapcast pipeline so I can't really say if that config is good. I'm surprised Pipewire is involved at all though, at least on the server side, shouldn't it just be something like this?

Mobile               | Server                                                  | Client
                     |                                                         |
iPhone  --AirPlay--> | ShairPort  --/tmp/snapfifo-->  snapserver  --network--> | snapclient  -->  audio out
                     |                                                         |

vjdw avatar Feb 11 '25 18:02 vjdw

My Snapserver and snapclient are on the same PC, so the client has to play via PW. Also I am guessing that PW is needed to capture the system wide sound (as a sink) for the Snapserver broadcasting?

gerroon avatar Feb 11 '25 19:02 gerroon

Just a thought, but when I installed shairport I disabled the standalone service because the snapserver starts up its own instance. So if you haven't disabled the shairport service that could be worth trying. Otherwise you might have two of them running on different ports and your iphone could connect to the one that doesn't belong to snapserver

sudo systemctl disable shairport-sync
sudo systemctl restart snapserver # to force reset of any running shairport instance

vjdw avatar Feb 11 '25 19:02 vjdw

Thanks for the tip but I already disabled SP so that is not an issue, like I mentioned I can play to Snapserver sink if I just manually run SP on the terminal. Somehow Snapserver isn't able to capture the sound maybe when I try to let it control SP.

gerroon avatar Feb 11 '25 19:02 gerroon

Please add logs, as asked for in the issue template, everything else is just guessing. Maybe you're client is just not listening to the shairport stream, but to the idling pipe stream.

badaix avatar Feb 12 '25 09:02 badaix