{"id":131,"date":"2016-07-03T23:40:03","date_gmt":"2016-07-03T23:40:03","guid":{"rendered":"http:\/\/credelius.com\/credelius\/?p=131"},"modified":"2017-05-14T21:01:03","modified_gmt":"2017-05-14T21:01:03","slug":"mpd-client-for-tizen-gear-s2","status":"publish","type":"post","link":"https:\/\/credelius.com\/credelius\/?p=131","title":{"rendered":"MPD Client for Tizen, Gear S2"},"content":{"rendered":"<p>This native Tizen application implements a traditional MPD client functionality that was built for Tizen Gear S2 devices. We tried to use the same code for Gear S, but unfortunately Native API is not available for this model yet. You can install the MPD Client to your Gear S2 device using <a href=\"https:\/\/play.google.com\/store\/apps\/details?id=com.samsung.android.app.watchmanager&amp;hl=en\">Gear App<\/a> running on your smartphone.<\/p>\n<p><strong>Few Quick Notes about MPD Server<\/strong><\/p>\n<p>We&#8217;ve tested it with MPD server&#8217;s versions 0.16.7 and higer and it worked well. Playlists must be created on your MPD servers, because that&#8217;s the only objects that the client can select and play.<\/p>\n<p>I&#8217;ve found playlists very useful for selecting and playing my favorite Internet radio stations along with MP3 stored on a hard drive of my MPD server.<\/p>\n<p>Here is how a typical radio station playlist looks like:<\/p>\n<blockquote><p># more \/var\/lib\/mpd\/playlists\/RadioKievLounge.m3u<br \/>\nhttp:\/\/cast.loungefm.com.ua\/loungefm<\/p><\/blockquote>\n<p>As you can see from the example above, all you need to create a radio station playlist is a URL of the station&#8217;s stream. In the case of a more traditional playlist with songs stored on a hard drive you would need something like this:<\/p>\n<blockquote><p># more \/var\/lib\/mpd\/playlists\/Queen.m3u<br \/>\nmp3\/Queens\/Queen &#8211; Body Language.mp3<br \/>\nmp3\/Queens\/Queen &#8211; Bohemian Rapsody.mp3<br \/>\nmp3\/Queens\/Queen &#8211; Bohemian Rhapsody.mp3<br \/>\nmp3\/Queens\/Queen &#8211; Crazy Little Thing Called Love .mp3<br \/>\nmp3\/Queens\/Queen &#8211; I Want To Break Free.mp3<br \/>\nmp3\/Queens\/Queen &#8211; I Want to Ride My Bicycle.mp3<\/p><\/blockquote>\n<p>The path to an MP3 file is relative to a root MP3 folder, which needs to be provided in your MPD config file, e.g. here is mine for a server running in Linux environment on Raspberry PI:<\/p>\n<blockquote><p>music_directory\u00a0\u00a0\u00a0\u00a0 &#8220;\/var\/lib\/mpd\/music&#8221;<br \/>\nplaylist_directory\u00a0\u00a0\u00a0\u00a0\u00a0 &#8220;\/var\/lib\/mpd\/playlists&#8221;<br \/>\n# User under which MPD daemonn runs<br \/>\nuser\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &#8220;mpd&#8221;<br \/>\n# For network<br \/>\nbind_to_address\u00a0\u00a0\u00a0\u00a0 &#8220;0.0.0.0&#8221;<br \/>\n# An example of an ALSA output for Linux:<br \/>\naudio_output {<br \/>\ntype\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &#8220;alsa&#8221;<br \/>\nname\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &#8220;My ALSA Device&#8221;<br \/>\ndevice\u00a0\u00a0\u00a0\u00a0\u00a0 &#8220;hw:0,0&#8221;\u00a0\u00a0\u00a0 # optional<br \/>\n#\u00a0\u00a0 format\u00a0\u00a0\u00a0\u00a0\u00a0 &#8220;44100:16:2&#8221;\u00a0\u00a0\u00a0 # optional<br \/>\nmixer_type\u00a0\u00a0\u00a0\u00a0\u00a0 &#8220;hardware&#8221;\u00a0\u00a0\u00a0\u00a0\u00a0 # optional<br \/>\nmixer_device\u00a0\u00a0\u00a0 &#8220;default&#8221;\u00a0\u00a0 # optional<br \/>\nmixer_control\u00a0\u00a0 &#8220;PCM&#8221;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 # optional<br \/>\nmixer_index &#8220;0&#8221;\u00a0\u00a0\u00a0\u00a0 # optional<br \/>\n}<\/p>\n<p># An example of output for Windows<br \/>\n#audio_output {<br \/>\n#\u00a0 type &#8220;winmm&#8221;<br \/>\n#\u00a0 name &#8220;Speakers&#8221;<br \/>\n#\u00a0 device &#8220;Speakers (Realtek High Definition Audio)&#8221;<br \/>\n#}<br \/>\n# You can also try &#8220;libao&#8221; instead of &#8220;winmm&#8221; on Windows<\/p>\n<p># An example of output for Mac<br \/>\n#audio_output {<br \/>\n#\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 type\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &#8220;osx&#8221;<br \/>\n#\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 type\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &#8220;ao&#8221;<br \/>\n#\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 name\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &#8220;My Mac Device&#8221;<br \/>\n#\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 mixer_type\u00a0\u00a0\u00a0\u00a0\u00a0 &#8220;software&#8221;<br \/>\n#}<\/p><\/blockquote>\n<p>The config file can be provided as a parameter when you run your MPD server, e.g.<\/p>\n<blockquote><p>#mpd ~\/.mpd\/conf<\/p><\/blockquote>\n<p>On Linux environment there is a default location for the config file &#8211; \/etc\/mpd.conf<\/p>\n<p><strong>Using MPD Client<\/strong><\/p>\n<p>After you&#8217;ve configured your MPD server and installed MPD Client to your Gear S2 device running the client is simple. The first thing that you need to do is to connect Gear S2 through WiFi to the same\u00a0 network where your MPD server runs. After that you&#8217;ll need to provide the IP address and port of your MPD server:<\/p>\n<p><a href=\"https:\/\/credelius.com\/credelius\/wp-content\/uploads\/2016\/07\/mpd-settings.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-medium wp-image-137\" src=\"https:\/\/credelius.com\/credelius\/wp-content\/uploads\/2016\/07\/mpd-settings-278x300.png\" alt=\"mpd-settings\" width=\"278\" height=\"300\" srcset=\"https:\/\/credelius.com\/credelius\/wp-content\/uploads\/2016\/07\/mpd-settings-278x300.png 278w, https:\/\/credelius.com\/credelius\/wp-content\/uploads\/2016\/07\/mpd-settings.png 820w\" sizes=\"(max-width: 278px) 100vw, 278px\" \/><\/a><\/p>\n<p>The default MPD&#8217;s port is 6600, so you should use this one if didn&#8217;t change it in MPD&#8217;s config. There are some additional and self-explanatory parameters on this screen. If you find difficult toggling the check boxes, just click on the containing rectangle to get a bigger view:<\/p>\n<p><a href=\"https:\/\/credelius.com\/credelius\/wp-content\/uploads\/2016\/07\/settings-zoom.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-medium wp-image-138\" src=\"https:\/\/credelius.com\/credelius\/wp-content\/uploads\/2016\/07\/settings-zoom-300x286.png\" alt=\"settings-zoom\" width=\"300\" height=\"286\" srcset=\"https:\/\/credelius.com\/credelius\/wp-content\/uploads\/2016\/07\/settings-zoom-300x286.png 300w, https:\/\/credelius.com\/credelius\/wp-content\/uploads\/2016\/07\/settings-zoom.png 814w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>After you&#8217;ve entered a correct IP and port, press OK button on the bottom and you&#8217;ll be taken to the next page with all playlists created on your server:<\/p>\n<p><a href=\"https:\/\/credelius.com\/credelius\/wp-content\/uploads\/2016\/07\/mpd-pl.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-medium wp-image-139\" src=\"https:\/\/credelius.com\/credelius\/wp-content\/uploads\/2016\/07\/mpd-pl-287x300.png\" alt=\"mpd-pl\" width=\"287\" height=\"300\" srcset=\"https:\/\/credelius.com\/credelius\/wp-content\/uploads\/2016\/07\/mpd-pl-287x300.png 287w, https:\/\/credelius.com\/credelius\/wp-content\/uploads\/2016\/07\/mpd-pl.png 826w\" sizes=\"(max-width: 287px) 100vw, 287px\" \/><\/a><\/p>\n<p>Now you can select your favorite playlist and start listening to it. If you tap the speaker button the previously selected playlist will be played.<\/p>\n<p><a href=\"https:\/\/credelius.com\/credelius\/wp-content\/uploads\/2016\/07\/mpd-player-pink.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-medium wp-image-141\" src=\"https:\/\/credelius.com\/credelius\/wp-content\/uploads\/2016\/07\/mpd-player-pink-300x284.png\" alt=\"mpd-player-pink\" width=\"300\" height=\"284\" srcset=\"https:\/\/credelius.com\/credelius\/wp-content\/uploads\/2016\/07\/mpd-player-pink-300x284.png 300w, https:\/\/credelius.com\/credelius\/wp-content\/uploads\/2016\/07\/mpd-player-pink.png 810w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>You can navigate to the next\/previous song in the list by tapping the buttons on the screen, or you can navigate between playlists by rotating the bezel.<\/p>\n<p>To zoom the player&#8217;s view simply tap the rectangle with the song info:<\/p>\n<p><a href=\"https:\/\/credelius.com\/credelius\/wp-content\/uploads\/2016\/07\/player-zoom-queen.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-medium wp-image-143\" src=\"https:\/\/credelius.com\/credelius\/wp-content\/uploads\/2016\/07\/player-zoom-queen-300x290.png\" alt=\"player-zoom-queen\" width=\"300\" height=\"290\" srcset=\"https:\/\/credelius.com\/credelius\/wp-content\/uploads\/2016\/07\/player-zoom-queen-300x290.png 300w, https:\/\/credelius.com\/credelius\/wp-content\/uploads\/2016\/07\/player-zoom-queen.png 822w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>You can still navigate between songs in the playlist by swiping the title left or right or you can toggle a current playlist by rotating the bezel.<\/p>\n<p>&#8220;Back&#8221; button functionality is available and can be always used to go to the previous page. Connection icon included to all screens is used to indicate if a connection with MPD server is alive.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This native Tizen application implements a traditional MPD client functionality that was built for Tizen Gear S2 devices. We tried to use the same code for Gear S, but unfortunately Native API is not available for this model yet. You can install the MPD Client to your Gear S2 device using Gear App running on [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/credelius.com\/credelius\/index.php?rest_route=\/wp\/v2\/posts\/131"}],"collection":[{"href":"https:\/\/credelius.com\/credelius\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/credelius.com\/credelius\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/credelius.com\/credelius\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/credelius.com\/credelius\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=131"}],"version-history":[{"count":15,"href":"https:\/\/credelius.com\/credelius\/index.php?rest_route=\/wp\/v2\/posts\/131\/revisions"}],"predecessor-version":[{"id":201,"href":"https:\/\/credelius.com\/credelius\/index.php?rest_route=\/wp\/v2\/posts\/131\/revisions\/201"}],"wp:attachment":[{"href":"https:\/\/credelius.com\/credelius\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=131"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/credelius.com\/credelius\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=131"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/credelius.com\/credelius\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=131"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}