Switch to unified view

a/doc/upmpdcli-manual.txt b/doc/upmpdcli-manual.txt
...
...
542
== Support for Streaming Services
542
== Support for Streaming Services
543
543
544
=== Streaming Services and UPnP
544
=== Streaming Services and UPnP
545
545
546
Streaming services like Qobuz or Tidal give access to a huge catalog of
546
Streaming services like Qobuz or Tidal give access to a huge catalog of
547
music through a WEB interface which is also usable by programs other than
547
music through a WEB programming interface which is also usable by programs
548
their own applications.
548
other than their own applications.
549
549
550
The only thing that they have in common with UPnP is that the use of HTTP
550
The only thing that they have in common with UPnP is that the use of HTTP
551
to retrieve the audio stream. However, given the importance of these
551
to retrieve the audio stream. However, given the importance of these
552
services for music consumers, many UPnP Control Points and Renderers have
552
services for music consumers, many UPnP Control Points and Renderers have
553
been extended with specific interfaces to the different services.
553
been extended with specific interfaces to the different services.
...
...
586
586
587
[[UPMPDCLI-MS-STR-MS]]
587
[[UPMPDCLI-MS-STR-MS]]
588
=== Accessing Streaming Services through the upmpdcli Media Server
588
=== Accessing Streaming Services through the upmpdcli Media Server
589
  
589
  
590
The Media Server function in Upmpdcli (1.2.0 and later) gives access to
590
The Media Server function in Upmpdcli (1.2.0 and later) gives access to
591
external streaming services: Qobuz, Tidal, and Google Music at the moment.
591
external streaming services: Qobuz, Tidal, and Google Music at the
592
moment. Spotify has been added in release 1.3.0.
592
593
593
You will need a valid account on any service that you want to use.
594
You will need a valid account on any service that you want to use (for
595
Spotify, this means a premium account, the free ones will not work).
594
596
595
When the function is activated, *upmpdcli* creates a separate auxiliary Media
597
When the function is activated, *upmpdcli* creates a separate auxiliary Media
596
Server, with the sole purpose of presenting the streaming server
598
Server, with the sole purpose of presenting the streaming server
597
catalog. You will see it appear on the network if streaming service
599
catalog. You will see it appear on the network if streaming service
598
parameters are present in the configuration file. The Media Server name is
600
parameters are present in the configuration file. The Media Server name is
599
the +friendlyname+ for the Upmpdcli instance, with _-mediaserver_ appended.
601
the +friendlyname+ for the Upmpdcli instance, with _-mediaserver_ appended.
600
602
601
Streaming is not limited to the local Upmpdcli Renderer, and the Media
603
Streaming is not limited to the local Upmpdcli Renderer, and the Media
602
Server will happily send music to other Renderers.
604
Server will happily send music to other Renderers (within the limitations
605
set by the service).
603
606
604
Two conditions must be true for the Media Server to appear with an entry
607
Two conditions must be true for the Media Server to appear with an entry
605
for a streaming service:
608
for a streaming service:
606
609
607
 - The code for the service plugin must be installed. This comes generally
610
 - The code for the service plugin must be installed. This comes generally
608
   in a separate package (e.g _upmpdcli-qobuz_).
611
   in a separate package (e.g _upmpdcli-qobuz_).
609
 - The user variable for the service must be present in the configuration
612
 - The user variable for the service must be present in the configuration
610
   file (e.g +qobuzuser+).
613
   file (e.g +qobuzuser+).
611
614
612
Some other parameters (e.g. a password) may be needed for the access to
615
Some other parameters (e.g. a password) may be needed for the access to
613
work.
616
work, depending on the specific service.
614
617
615
NOTE: The streaming services passwords are stored in the upmpdcli
618
NOTE: The streaming services passwords are stored in the upmpdcli
616
configuration file ('/etc/upmpdcli.conf'). The installer does not
619
configuration file ('/etc/upmpdcli.conf'). The installer does not
617
make this file r/w by owner only. This will be fixed, but for now, you
620
make this file r/w by owner only. This will be fixed, but for now, you
618
should probably do it after setting the password:
621
should probably do it after setting the password:
619
+chmod 600 /etc/upmpdcli.conf+ Actually, it would quite probably
622
+chmod 600 /etc/upmpdcli.conf+ Actually, it would quite probably
620
be a good idea not to use the same account for your mail and music uses.
623
be a good idea not to use the same account for your mail and music
624
uses. Especially, for Google Music you can and should use an
625
application-specific password.
621
626
622
NOTE: I have no reason to believe that upmpdcli is technically mis-using
627
NOTE: I have no reason to believe that upmpdcli is technically mis-using
623
the streaming services in any way, but it is definitely not approved by any
628
the streaming services in any way, but it is definitely not approved by any
624
of them, and you are using it under your own responsibility.
629
of them, and you are using it under your own responsibility.
625
630
626
==== Notes on the Tidal interface
631
[[UPMPDCLI-MS-STR-CRED]]
632
=== Accessing the streaming services with OpenHome from Kazoo
633
634
This only works for Qobuz and Tidal, and only with upmpdcli versions 1.3.0
635
and later. The corresponding media server module must be installed
636
(upmpdcli-qobuz and/or upmpdcli-tidal), but no other configuration should
637
be necessary on the renderer.
638
639
This should also work with Lumin, but it does not currently, the reason is
640
unknown. When feature is active, it actually prevents Lumin from
641
discovering upmpdcli at all, so there is a configuration variable to
642
disable it: '+lumincompat+'. Set to 1 to use upmpdcli v1.3.0 with Lumin.
643
644
Upmpdcli uses the *openssl* command to perform the cryptography work. This
645
was not made a hard dependancy, so you should check that it is installed.
646
647
The media service icons will appear in the Control Point interface, and the
648
service will be accessible after entering the login and password.
649
650
NOTE: the user name and password will be stored on the renderer in an
651
insecure way, meaning that if someone steals the machine or obtains root
652
access, there is nothing to prevent them from getting the credentials.
653
654
Of course Kazoo or Lumin can also access the services through the media
655
server interface (after configuring upmpdcli, see the
656
xref:UPMPDCLI-MS-STR-MS[previous section]).
657
658
For reference, this method is *not* usable with *Upplay*
659
660
The notes which follow relate to accessing the services through the
661
Upmpdcli Media Server.
662
663
=== Using Tidal through the Upmpdcli Media Server
627
664
628
[NOTE]
665
[NOTE]
629
===================================
666
===================================
630
There seems to be problems when streaming Tidal lossless/FLAC streams,
667
There seems to sometimes be problems when streaming Tidal lossless/FLAC
631
with the default MPD configuration. A preliminary and rather superficial
668
streams, with the default MPD configuration. A preliminary and rather
632
enquiry seems to indicate that this is caused by too much buffering by
669
superficial enquiry seems to indicate that this is caused by too much
633
MPD. Adding the following parameters to the MPD configuration file
670
buffering by MPD. Adding the following parameters to the MPD configuration
634
(/etc/mpd.conf) reduces the pre-fetch period from 20 S to 10 S and seems to
671
file (/etc/mpd.conf) reduces the pre-fetch period and seems to fix the
635
fix the issues for me:
672
issues for me (YMMV...):
636
673
637
    audio_buffer_size "2048"
674
    audio_buffer_size "2048"
638
    buffer_before_play "20%"
675
    buffer_before_play "20%"
639
====================================
676
====================================
640
677
...
...
650
It only works with a valid Tidal subscription.
687
It only works with a valid Tidal subscription.
651
688
652
The configuration parameters are described in the
689
The configuration parameters are described in the
653
<<tidaluser,configuration section>>
690
<<tidaluser,configuration section>>
654
691
655
==== Notes on the Qobuz interface
692
[[upmpdcli.qobuznotes]]
693
=== Using Qobuz through the Upmpdcli Media Server
656
694
657
This is based on the service API from the
695
This is based on the service API from the
658
link:https://github.com/tidalf/plugin.audio.qobuz[Kodi add-on], by Joachim
696
link:https://github.com/tidalf/plugin.audio.qobuz[Kodi add-on], by Joachim
659
Basmaison and Cyril Leclerc, with the upper-level code adapted from the
697
Basmaison and Cyril Leclerc, with the upper-level code adapted from the
660
Tidal add-on. The WEB API is not officially supported by Qobuz, and may
698
Tidal add-on. The WEB API is not officially supported by Qobuz, and may
661
just stop to work one day.
699
just stop to work one day. On the other hand, Qobuz is the only service to
700
actually publish the documentation for their API, so it is quite likely to
701
remain available.
662
702
663
NOTE: the Qobuz search does not allow searching a specific field (like the
703
NOTE: the Qobuz search does not allow searching a specific field (like the
664
artist name or song title). All objects matching a query in any field are
704
artist name or song title). All objects matching a query in any field are
665
returned. This means that, e.g., the field choice of upplay search is
705
returned. This means that, e.g., the field choice of upplay search is
666
ignored.
706
ignored.
...
...
669
709
670
The configuration parameters are described in the
710
The configuration parameters are described in the
671
<<qobuzuser,configuration section>>
711
<<qobuzuser,configuration section>>
672
712
673
[[upmpdcli.googlemusicnotes]]
713
[[upmpdcli.googlemusicnotes]]
674
==== Notes on the Google Music interface
714
=== Using Google Music through the Upmpdcli Media Server
675
715
676
This is based on the
716
This is based on the
677
link:https://github.com/simon-weber/gmusicapi[gmusicapi] Python package by
717
link:https://github.com/simon-weber/gmusicapi[gmusicapi] Python package by
678
Simon Weber, with upper-level code from the Tidal Kodi add-on. As for the
718
Simon Weber, with upper-level code from the Tidal Kodi add-on. As for the
679
other services, the API used is not officially supported and may stop to
719
other services, the API used is not officially supported and may stop to
...
...
701
741
702
The configuration parameters are described in the
742
The configuration parameters are described in the
703
<<gmusicuser,configuration section>>
743
<<gmusicuser,configuration section>>
704
744
705
745
706
[[UPMPDCLI-MS-STR-CRED]]
746
[[upmpdcli.spotifynotes]]
707
=== Accessing the streaming services with OpenHome from Kazoo
747
=== Using Spotify through the Upmpdcli Media Server
708
748
709
This only works for Qobuz and Tidal, and only with upmpdcli versions 1.3.0
749
Spotify is the only service which does not use regular (but
710
and later. The corresponding media server module must be installed
750
short-lived) HTTP URLs for accessing the streams, but rather a non standard
711
(upmpdcli-qobuz and/or upmpdcli-tidal), but no other configuration should
751
transfer protocol, implemented in a specific library.
712
be necessary on the renderer.
713
752
714
This should also work with Lumin, but it does not currently, the reason is
753
The authentication method is also more complicated than for the others, and
715
unknown. When feature is active, it actually prevents Lumin from
754
will you have jump through a few hoops in addition to setting the password
716
discovering upmpdcli at all, so there is a configuration variable to
755
in the configuration file.
717
disable it: '+lumincompat+'. Set to 1 to use upmpdcli v1.3.0 with Lumin.
718
756
719
Upmpdcli uses the *openssl* command to perform the cryptography work. This
757
The upmpdcli interface is based on a slightly modified version of the
720
was not made a hard dependancy, so you should check that it is installed.
758
link:https://spotipy.readthedocs.io/en/latest/[Spotipy Python package] and
759
the old libspotify library.
721
760
722
The media service icons will appear in the Control Point interface, and the
761
You will need to set some configuration parameters, which are described in the
723
service will be accessible after entering the login and password.
762
<<spotifyuser,configuration section>> and also obtain an oauth2
763
authorization token, see the <<SPOTIFY-AUTH,Spotify authorization annex>>
764
for the method to follow.
724
765
725
NOTE: the user name and password will be stored on the renderer in an
726
insecure way, meaning that if someone steals the machine or obtains root
727
access, there is nothing to prevent them from getting the credentials.
728
729
Of course Kazoo or Lumin can also access the services through the media
730
server interface (after configuring upmpdcli, see the
731
xref:UPMPDCLI-MS-STR-MS[previous section]).
732
733
For reference, this method is *not* usable with *Upplay*
734
766
735
[[UPRCL]]
767
[[UPRCL]]
736
== Upmpdcli local Media Server: uprcl
768
== Upmpdcli local Media Server: uprcl
737
769
738
The current (2017-04) upmpdcli code base includes a Media Server function
770
The current (2017-04) upmpdcli code base includes a Media Server function
...
...
1012
    cd openhome
1044
    cd openhome
1013
    tar xzf ../../sc2mpd_1.1.1.orig-openhome.tar.gz
1045
    tar xzf ../../sc2mpd_1.1.1.orig-openhome.tar.gz
1014
    cd ..
1046
    cd ..
1015
    debuild
1047
    debuild
1016
1048
1049
1050
[[SPOTIFY-AUTH]]
1051
== Annex: setting up Spotify access authorization
1052
1053
Upmpdcli uses a hybrid approach for accessing Spotify: it uses the newer
1054
WEB API for browsing the catalog, and the old libspotify library for
1055
streaming.
1056
1057
As a consequence, two sets of authorization parameters must be specified:
1058
the library uses a classical user name + password pair, to be set in the
1059
<<spotifyuser,configuration file>>.
1060
1061
The WEB API uses a more modern (and more ennoying) oauth2
1062
authentification/authorization method. This needs to go through a WEB
1063
browser. You will need to execute the following steps to set things up:
1064
1065
- Download the
1066
  link:http://www.lesbonscomptes.com/upmpdcli/files/upmpdcli-spotify-authinit.zip[zip
1067
  file for the helper script]. Right-click the link and use `Save link as`.
1068
- Unzip the file on any Linux machine with a web browser. This will create
1069
  a 'upmpdcli-spotify-authinit' directory. The chosen machine can be the
1070
  host where upmpdcli runs, or not: any Linux machine with a browser will do.
1071
- Check that the python-requests package is available on the chosen host, or
1072
  install it.
1073
- Run the helper script inside the unzipped directory. Replace 'username'
1074
  with your Spotify user id.
1075
  
1076
    ./spotiauthinit.py username
1077
1078
- The script will start a Web browser, and you will be asked to log in to
1079
  Spotify and authorize upmpdcli to access your data.
1080
- At the end of the web interaction, you will be redirected to a
1081
  non-existing page (am error will be displayed in the browser). Copy the
1082
  link address from the address bar, and paste it to the spotiauthinit.py
1083
  input line (you will have been prompted to do this by the script).
1084
- The script will then store the authorization token in a file named
1085
  '/tmp/spotipy-<username>-token', which you will need to copy to the host
1086
  where upmpdcli run, and move it to a file named
1087
  '/var/cache/upmpdcli/spotify/token'
1088
1089
1017
[[SC2MPD-INSTALL]]
1090
[[SC2MPD-INSTALL]]
1018
== Annex: Songcast installation walkthrough
1091
== Annex: Songcast installation walkthrough
1019
1092
1020
If you want to play from a Mac or Windows machine, install the 
1093
If you want to play from a Mac or Windows machine, install the 
1021
link:http://www.linn.co.uk/software#songcast[Songcast application]
1094
link:http://www.linn.co.uk/software#songcast[Songcast application]