Some glitches in streaming audio from Linux mint 19 to Sonos zones.
Hello,
Thank you for this wonderful software. I installed pulseaudio-dlna on linux mint 19.0 bionic to stream audio from my laptop to my Sonos devices. I had to install pulseaudio-dlna with the software manager. The add Repository command says that bionic is not supported by this PPA.
To install the software I followed the installation process below:
- Installed pulseaudio-dlna via the software manager.
- Allowed DLNA traffic to and from my laptop (Allow IN/OUT UDP 1900 .and Allow IN/OUT TCP 2869)
- Issued the command: pulseaudio-dlna --create-device-config
- As root I created the file /lib/systemd/system/pulseaudio-dlna.service with the content below: :
[Unit]
Description=Launch pulseaudio-dlna streaming server.
After=multi-user.target
StartLimitIntervalSec=0
[Service]
Type=idle
Restart=always
RestartSec=1
#ExecStart=/usr/bin/pulseaudio-dlna --codec mp3 --encoder-backend=ffmpeg --bit-rate=320 --cover-mode=application --auto-reconnect
ExecStart=/usr/bin/pulseaudio-dlna --auto-reconnect
[Install]
WantedBy=multi-user.target
- systemctl start pulseaudio-dlna
- systemctl status pulseaudio-dlna.service
- systemctl enable pulseaudio-dlna.service
After this my Sonos zones appear as output devices (sinks) in Sound Settings and I am able to stream audio from my laptop to my Sonos zones, although streaming starts with a delay of 5-8 seconds.
Upon using pulseaudio-dlna I ran in to some glitches. If they are Sonos or pulseaudio-dlna related I don't know yet. A little bit puzzled where to look, I am not really a programmer.
- [ONGOING] As said I can only install pulseaudio-dlna on Linux Mint 19 via the software manager. The command "sudo add-apt-repository ppa:qos/pulseaudio-dlna" gives the error 'This PPA does not support bionic'. The software manager says version 0.5.3+git20170406-1 is installed. However the version installed according to pulseaudio-dlna is:
pulseaudio-dlna -v
0.5.2
I wonder if I do have the latest version? [Edit]: See point 1 in the answer below.
-
[ONGOING] When I start the sonos app on my phone while streaming from laptop to a Sonos zone, I see on the app that a mediaplayer is streaming to that zone. As soon as I tap on the zone in the app, the audio from the stream from my laptop is gone. I have to stop the sonos app and restart the pulseaudio-dlna service with the command "systemctl restart pulseaudio-dlna.service". Probably the sonos app takes over the DLNA connection. I don't know if this inevitable. [Edit]: Sent a mail to Sonos support to see if they are willing to shine a light on this subject.
-
[ONGOING] Volume changes on my laptop take place after a delay of around 3 seconds. The sound stutters when changing the volume. Also mentioned in this and this issue. Can confirm it is still present. [Edit]: See point 3 in the answer below.
-
[ONGOING] In Sound Settings --> Output Devices I have one zone (kitchen) that appears twice in stead of once, representing the Play3 stereo pair. For example my zone Living is represented by the Playbar only and consists in reality of a Playbar, a Sub and two Play3's. Only one of the two kitchen entries will stream the audio, the other failes to do so with a notification "Unknown reason. Your streams are switched back to Built-In Audio Analog Stereo". Can be Sonos related I don't know yet. [Edit]: Sent a mail to Sonos support to see if they are willing to shine a light on this subject.
-
[INEVITABLE] There is a multiple seconds (5-8 seconds) delay in audio streaming. When I watch a movie on my laptop the audio is way out of sync. Also mentioned in this issue. Can confirm it is still present. [Edit]: See point 5 in the answer below.
-
[SOLVED] When I restart my laptop the default audio device is set to one of the Sonos zones (always the last in the list DLNA sinks) in stead of the laptop speakers even though when I set the default to laptop speakers before restarting. Also mentioned is this issue. Can confirm it is still present. [Edit]: Solution is in this post.
I can start pulseaudio-dlna manually with the command "/usr/bin/pulseaudio-dlna --auto-reconnect --debug 2>&1 | tee pulseaudio-dlna.log" and send the output of "pulseaudio-dlna.log" but this will be a very large file. If necessary I can supply a debug file through pastbin, let me know if this is useful for you.
Any hints where to look?
-
I guess 0.5.3+git20170406 is the latest public available version. You are right, that I didn't release a version for bionic yet. But I am working on a new one.
-
I can't really tell what is happening there. Manufacturers like Sonos tend to tune the DLNA standard to implement new features.
-
I am looking into this for the new version.
-
A debug.log could give me some insight.
-
The delay is from my point of view inevitable. It is the device buffer which causes that. And in the DLNA specification there is no command for disabling that. It is possible for Chromecasts though.
-
This is a pulseaudio issue. Some new module which changes the default sink when you add a new sink to the system. Really annoying.
1. I guess 0.5.3+git20170406 is the latest public available version. You are right, that I didn't release a version for bionic yet. But I am working on a new one.
Thank you
2. I can't really tell what is happening there. Manufacturers like Sonos tend to tune the DLNA standard to implement new features.
Will check with Sonos support if they can and if they are willing...
3. Volume changes on my laptop take place after a delay of around 3 seconds. The sound stutters when changing the volume. Also mentioned in [this](https://github.com/masmu/pulseaudio-dlna/issues/260) and [this](https://github.com/masmu/pulseaudio-dlna/issues/198) issue. Can confirm it is still present.
Thank you
4. A debug.log could give me some insight.
Here it is. (Made with the master version 2017-04-06). In sound settings I first clicked on the sink "Kitchen" which gives me the notification "Unknown reason. Your streams are switched back to Built-In Audio Analog Stereo". Then I clicked on the second sink "Kitchen" which allows me to stream audio from my laptop to the Sonos Kitchen stereo pair.
5. The delay is from my point of view inevitable. It is the device buffer which causes that. And in the DLNA specification there is no command for disabling that. It is possible for Chromecasts though.
Ok, fair enough. With only audio this not a big issue. When streaming the audio to sonos when watching a movie on my laptop I have to fiddle with the lipsync feature in my video player.
6. This is a pulseaudio issue. Some new module which changes the default sink when you add a new sink to the system. Really annoying.
Will try to look into it. Will reply for this in this post.
OK, about the Sonos related issues 2 and 4. Got an e-mail back from Sonos. What I was afraid of, it was not made by Sonos so no support and no satisfactory answer. Will see if there are technical Sonos forums. Maybe I can get a satisfying answer there.
@masmu : I use this app for a while now under Linux as a replacement for Sonos's official Windows app and I am quit happy with it. It does everything the Windows app does.
I saw that the author uses a C++ library for accessing SONOS devices. Maybe there you can find some info which will help you to get pulseaudio-dlna compatible with Sonos devices?
Erik
-
Haven't noticed any issue in relation to the Android app. I had a problem where the connection would drop after a few minutes and I would have to restart pulseaudio-dlna (I just run it from the command-line), but this didn't happen during my last use, nor with the Python 3 port. Perhaps it was my WiFi or a Sonos bug.
-
Can't remember if Mkchromecast has the same issue (which uses SoCo), maybe I will check tomorrow. A resolution for this would be pretty nice.
-
Try the
wavcodec. I also use the default encoder backend.
@polyzen I can confirm that I do not have the problem mentioned under issue 2 with my Android phone. I can fiddle around with the Sonos app what I want. If I press pause on the zone to where my laptop is streaming this result in a broken pipe in the pulseaudio-dlna service, which seems obvious to me: I try to pause a stream from my laptop with my Sonos app.
However I have some WiFi issues lately. My iphone is dropping it's WiFi connection regularly. Also my Adroid phone has this problem but much less frequent as my iphone. Maybe I have to look for the problem in my two Cisco 1142N access points. Don't know yet what is causing this problem.
About issue 4, I tried the wav codec but the two play3's are showing up both in stead of the expected once. They are in a stereo pair representing one zone, like my other three zones.
Erik