philippe44 / AirConnect

Use AirPlay to stream to UPnP/Sonos & Chromecast devices
Other
3.52k stars 217 forks source link

Sometimes stable, sometimes not #296

Closed vespino closed 3 years ago

vespino commented 3 years ago

I have been using this plugin for a week or so now and it does not always seem stable. Sometimes AirPlay plays for hours, sometimes it’s stops after an hour or 2 or less. I then have to restart the plugin and restart the audio.

AirPlay does seem to be stable when used from my iPhone and my Google speakers play the entire day when playing from the built in services like tune in, so I guess it’s not my wifi.

Any thoughts?

I have posted my logs here.

philippe44 commented 3 years ago

Can you elaborate a bit the sequence of events? You seem to indicate that issue happens when you "cast" to your TV. Are you using AirCast or AirUPnP?

vespino commented 3 years ago

I'm using my iPad to stream to my TV and Synology to stream to my speakers. Does this help answering your question?

philippe44 commented 3 years ago

no, I mean there are 2 separated programs in AirConnect: one to play to UPnP devices and one to Chromecast devices (source is always plays from AirPlay controllers)

vespino commented 3 years ago

I’m using AirConnect to cast to chromecast speakers, at least that is what Google Home shows. So I guess it’s aircast?

philippe44 commented 3 years ago

ok, so then this is what is confusing b/c the log you are showing that refers to "CheckAndLock" is a log for AirUPnP. There is something happening when you stream to the TV as far as UPnP is concerned, the device disconnects (or at least disappear voluntarely from UPnP devices). So, not that it shoudl be related but maybe you can try to not run AirUPnP is you don't need it.

Now, and again, just to make sure I get that straight, your speakers , CC devices, stop streaming when you start streaming to your TV, another CC devices. In other words, you cannot stream to two CC devices at the same time. Is this correct?

eizedev commented 3 years ago

@philippe44 just for your information, the current AirConnect-Synology package that i provide, covers both, airupnp and aircast during the installation. So both services will be started. @vespino For testing, you could stop/kill airupnp as philippe44 mentioned. If there is a general need for it, I can also provide individual packages for airupnp and aircast. You could, of course, also start aircast by yourself. The binaries are located on your system in /volume1/@appstore/AirConnect/.

I am providing the following default settings, so airupnp and aircast will log to the same logfile (/var/log/airconnect.log).

/volume1/@appstore/AirConnect/airupnp -b [synology device local ip]:49154 -l 1000:2000 -x "/volume1/@appstore/AirConnect/config.xml" -z -f "/var/log/airconnect.log" -d all=info  
/volume1/@appstore/AirConnect/aircast -b [synology device local ip] -l 1000:2000 -x "/volume1/@appstore/AirConnect/config-cast.xml" -z -f "/var/log/airconnect.log" -d all=info
philippe44 commented 3 years ago

@eizedev thanks for the clarification. I'm still not 100% sur of the use case of @vespino. I need to understand what are the two sources of streaming and what exactly happens because this

I'm using my iPad to stream to my TV and Synology to stream to my speakers. Does this help answering your question?

does not make sense to me. iPad is the source and Synology runs the AirConnect (aircast in that case) bridge. So who is the controller trying to stream to the TV that causes the speakers to stop. There has to be two sources involved.

vespino commented 3 years ago

During the day I’m using Synology’s Audiostation to cast to my Chromecast speakers using the AirConnect package from @eizedev. I’m streaming to a speaker group created by the Google Home app and which is shown as “all speakers+” in Audiostation. When turning on my TV I’m using iPad to stream to my TV so this doesn’t seem related. The TV however does show up in Audiostation twice, once with and once without the +. Is this the difference in upnp and cast? I’m not sure if the TV is causing the problems, but it does seem very likely since streaming to the speakers stops when the TV is turned on. Maybe the TV showing up stops Audiostation from seeing the speaker group?

Sorry I’m not familiar with the tech behind all of this, I’m just telling what I see hoping I’m doing something wrong and you can tell me or you might see something wrong with the software and are able to fix it.

philippe44 commented 3 years ago

Can you tell the exact model of your TV? I'm not familiar with AudioStation so I don't know what type of devices it recognizes, but if you see it twice, it probably means that it offers multiple protocols and one is recognized by AudioStation. With was you said, I'm leaning toward some kind of identity broadcast conflict

eizedev commented 3 years ago

@vespino The device without the + symbol is the "real" device, since your TV nativly supports AirPlay and/or Chromecast you do not need AirConnect for streaming to your TV. The device with the + symbol is the device that AirConnect (airupnp and aircast) generates. If you select one of the devices with the + symbol you will play your music "through" AirConnect. Are you using the internal TV speakers or any other speaker that is connected to the tv to hear the TV audio? Is your TV also member of the "all speakers" group? My guess: If you are using "all speakers+" for playing some songs ("all speakers+" comes from Google Home through AirConnect and includes your TV) and you turn on your TV, the source of audio will change on the TV to the internal TV audio stream and the music will then also paused on all other devices that "all speakers+" includes?

@philippe44 Background information: Synology AudioStation supports playing to DLNA/UPnP, Chromecast and AirPlay devices, see my screenshot here: https://user-images.githubusercontent.com/6794362/97862805-41730b80-1d06-11eb-8ae1-48099a7fb20b.png (Coresponding thread) (Schlafzimmer = bedroom, Flur = corridor, Fernsehzimmer = living room, Esszimmer = Dining Room, Bad = bathroom, Büro = Office) This is my home environment in Audio Station if i start airupnp or aircast without a config file to filter for devices. You will see some devices twice, the Nvidia SHIELD even 3x (Chromecast, AirPlay and direct). To get rid of the devices that nativly support airplay/chromecast i use the config file. If i power on my LG TV, the TV will also be twice in the list.

Btw. Audio Station also supports playing DSD or FLAC files, this also works great.


Audio Station:

Plays and streams music through web browsers, mobile devices, DLNA-certified devices, and AirPlay-certified devices, and displays songs in the play queue.

Streaming from AudioStation Web Client:

Streaming to a web browser
Audio formats supported natively: M4A, M4B, MP3, WAV, and FLAC (IE does not support WAV and FLAC)
Audio formats supported for conversion: AIFF, APE, Apple Lossless, Ogg Vorbis, WMA, WMA PRO, WMA VBR, and DSD
Audio formats supported for Bluetooth speakers and AirPlay speakers: AIFF, APE, Apple Lossless, FLAC, M4A, M4B, MP3, Ogg Vorbis, WAV, WMA, WMA PRO, WMA VBR, and DSD (Native DSD is not supported)
Supports DSD over PCM (DoP)
Supported playlist formats: M3U, PLS, and WPL
Supports gapless playback when streaming to a web browser (original files only) and AirPlay speakers
Supports streaming FLAC/APE, ALAC/AAC, OGG, and AIFF formats for DLNA players. Other supported audio formats for DLNA players depend on the player

Streaming from DSAudio (AudioStation) IPhone/Android App:

Audio formats supported for streaming: AAC, AIF, AIFF, APE, Apple Lossless (ALAC), FLAC, M4A, M4B, MP3, WAV, Ogg Vorbis, WMA, WMA PRO, WMA VBR, and DSD
Audio formats supported natively for mobile devices:
Android: AAC, FLAC, non-alac M4A, M4B, MP3, WAV, and Ogg Vorbis
iOS: AAC, AIFF, APE, Apple Lossless (ALAC), M4A, M4B, MP3, and WAV
Streams music to AirPlay-compatible devices (only available on iOS devices) and Chromecast

Screenshots from my iPhone using aircast and airupnp without config file:

IPhone1IPhone2

vespino commented 3 years ago

On further testing I don't think it's my TV, it simply Synology not seeing the speaker group any more:

screenshot

I have tried streaming to individual speakers, but this results in lag which is very annoying.

eizedev commented 3 years ago

Do you need to restart AirConnect on the Synology NAS so that the speakers group "all speakers" will re-appear in AudioStation? Or does the group re-appear if you wait a few minutes?

vespino commented 3 years ago

When I restart AirConnect the speaker group sometimes re-appears, this usually takes a few minutes.

philippe44 commented 3 years ago

It's still a bit confusing. Is the TV part of the group? If it is, then when you play something on it, the group configuration is changed which might trigger the problem. Can you clarify your findings on the problem appearing when you play or do something with the TV?

vespino commented 3 years ago

The TV is not part of the group and I’m beginning to think not part of the problem either. Like I said it appears the group I’m streaming often disappears and later returns.

philippe44 commented 3 years ago

Did you try iOS 14.2?

vespino commented 3 years ago

I'm not streaming from iOS, I'm streaming from Synology.

vespino commented 3 years ago

Bought Sonos speakers which removed the need to use this plugin and AudioStation all together.