Switch to unified view

a b/doc/sc2mpd.html
1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
2
    "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
4
<head>
5
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
6
<meta name="generator" content="AsciiDoc 8.6.7" />
7
<title>upmpdcli Linn Songcast integration</title>
8
<style type="text/css">
9
/* Shared CSS for AsciiDoc xhtml11 and html5 backends */
10
11
/* Default font. */
12
body {
13
  font-family: Georgia,serif;
14
}
15
16
/* Title font. */
17
h1, h2, h3, h4, h5, h6,
18
div.title, caption.title,
19
thead, p.table.header,
20
#toctitle,
21
#author, #revnumber, #revdate, #revremark,
22
#footer {
23
  font-family: Arial,Helvetica,sans-serif;
24
}
25
26
body {
27
  margin: 1em 5% 1em 5%;
28
}
29
30
a {
31
  color: blue;
32
  text-decoration: underline;
33
}
34
a:visited {
35
  color: fuchsia;
36
}
37
38
em {
39
  font-style: italic;
40
  color: navy;
41
}
42
43
strong {
44
  font-weight: bold;
45
  color: #083194;
46
}
47
48
h1, h2, h3, h4, h5, h6 {
49
  color: #527bbd;
50
  margin-top: 1.2em;
51
  margin-bottom: 0.5em;
52
  line-height: 1.3;
53
}
54
55
h1, h2, h3 {
56
  border-bottom: 2px solid silver;
57
}
58
h2 {
59
  padding-top: 0.5em;
60
}
61
h3 {
62
  float: left;
63
}
64
h3 + * {
65
  clear: left;
66
}
67
h5 {
68
  font-size: 1.0em;
69
}
70
71
div.sectionbody {
72
  margin-left: 0;
73
}
74
75
hr {
76
  border: 1px solid silver;
77
}
78
79
p {
80
  margin-top: 0.5em;
81
  margin-bottom: 0.5em;
82
}
83
84
ul, ol, li > p {
85
  margin-top: 0;
86
}
87
ul > li     { color: #aaa; }
88
ul > li > * { color: black; }
89
90
pre {
91
  padding: 0;
92
  margin: 0;
93
}
94
95
#author {
96
  color: #527bbd;
97
  font-weight: bold;
98
  font-size: 1.1em;
99
}
100
#email {
101
}
102
#revnumber, #revdate, #revremark {
103
}
104
105
#footer {
106
  font-size: small;
107
  border-top: 2px solid silver;
108
  padding-top: 0.5em;
109
  margin-top: 4.0em;
110
}
111
#footer-text {
112
  float: left;
113
  padding-bottom: 0.5em;
114
}
115
#footer-badges {
116
  float: right;
117
  padding-bottom: 0.5em;
118
}
119
120
#preamble {
121
  margin-top: 1.5em;
122
  margin-bottom: 1.5em;
123
}
124
div.imageblock, div.exampleblock, div.verseblock,
125
div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
126
div.admonitionblock {
127
  margin-top: 1.0em;
128
  margin-bottom: 1.5em;
129
}
130
div.admonitionblock {
131
  margin-top: 2.0em;
132
  margin-bottom: 2.0em;
133
  margin-right: 10%;
134
  color: #606060;
135
}
136
137
div.content { /* Block element content. */
138
  padding: 0;
139
}
140
141
/* Block element titles. */
142
div.title, caption.title {
143
  color: #527bbd;
144
  font-weight: bold;
145
  text-align: left;
146
  margin-top: 1.0em;
147
  margin-bottom: 0.5em;
148
}
149
div.title + * {
150
  margin-top: 0;
151
}
152
153
td div.title:first-child {
154
  margin-top: 0.0em;
155
}
156
div.content div.title:first-child {
157
  margin-top: 0.0em;
158
}
159
div.content + div.title {
160
  margin-top: 0.0em;
161
}
162
163
div.sidebarblock > div.content {
164
  background: #ffffee;
165
  border: 1px solid #dddddd;
166
  border-left: 4px solid #f0f0f0;
167
  padding: 0.5em;
168
}
169
170
div.listingblock > div.content {
171
  border: 1px solid #dddddd;
172
  border-left: 5px solid #f0f0f0;
173
  background: #f8f8f8;
174
  padding: 0.5em;
175
}
176
177
div.quoteblock, div.verseblock {
178
  padding-left: 1.0em;
179
  margin-left: 1.0em;
180
  margin-right: 10%;
181
  border-left: 5px solid #f0f0f0;
182
  color: #888;
183
}
184
185
div.quoteblock > div.attribution {
186
  padding-top: 0.5em;
187
  text-align: right;
188
}
189
190
div.verseblock > pre.content {
191
  font-family: inherit;
192
  font-size: inherit;
193
}
194
div.verseblock > div.attribution {
195
  padding-top: 0.75em;
196
  text-align: left;
197
}
198
/* DEPRECATED: Pre version 8.2.7 verse style literal block. */
199
div.verseblock + div.attribution {
200
  text-align: left;
201
}
202
203
div.admonitionblock .icon {
204
  vertical-align: top;
205
  font-size: 1.1em;
206
  font-weight: bold;
207
  text-decoration: underline;
208
  color: #527bbd;
209
  padding-right: 0.5em;
210
}
211
div.admonitionblock td.content {
212
  padding-left: 0.5em;
213
  border-left: 3px solid #dddddd;
214
}
215
216
div.exampleblock > div.content {
217
  border-left: 3px solid #dddddd;
218
  padding-left: 0.5em;
219
}
220
221
div.imageblock div.content { padding-left: 0; }
222
span.image img { border-style: none; }
223
a.image:visited { color: white; }
224
225
dl {
226
  margin-top: 0.8em;
227
  margin-bottom: 0.8em;
228
}
229
dt {
230
  margin-top: 0.5em;
231
  margin-bottom: 0;
232
  font-style: normal;
233
  color: navy;
234
}
235
dd > *:first-child {
236
  margin-top: 0.1em;
237
}
238
239
ul, ol {
240
    list-style-position: outside;
241
}
242
ol.arabic {
243
  list-style-type: decimal;
244
}
245
ol.loweralpha {
246
  list-style-type: lower-alpha;
247
}
248
ol.upperalpha {
249
  list-style-type: upper-alpha;
250
}
251
ol.lowerroman {
252
  list-style-type: lower-roman;
253
}
254
ol.upperroman {
255
  list-style-type: upper-roman;
256
}
257
258
div.compact ul, div.compact ol,
259
div.compact p, div.compact p,
260
div.compact div, div.compact div {
261
  margin-top: 0.1em;
262
  margin-bottom: 0.1em;
263
}
264
265
tfoot {
266
  font-weight: bold;
267
}
268
td > div.verse {
269
  white-space: pre;
270
}
271
272
div.hdlist {
273
  margin-top: 0.8em;
274
  margin-bottom: 0.8em;
275
}
276
div.hdlist tr {
277
  padding-bottom: 15px;
278
}
279
dt.hdlist1.strong, td.hdlist1.strong {
280
  font-weight: bold;
281
}
282
td.hdlist1 {
283
  vertical-align: top;
284
  font-style: normal;
285
  padding-right: 0.8em;
286
  color: navy;
287
}
288
td.hdlist2 {
289
  vertical-align: top;
290
}
291
div.hdlist.compact tr {
292
  margin: 0;
293
  padding-bottom: 0;
294
}
295
296
.comment {
297
  background: yellow;
298
}
299
300
.footnote, .footnoteref {
301
  font-size: 0.8em;
302
}
303
304
span.footnote, span.footnoteref {
305
  vertical-align: super;
306
}
307
308
#footnotes {
309
  margin: 20px 0 20px 0;
310
  padding: 7px 0 0 0;
311
}
312
313
#footnotes div.footnote {
314
  margin: 0 0 5px 0;
315
}
316
317
#footnotes hr {
318
  border: none;
319
  border-top: 1px solid silver;
320
  height: 1px;
321
  text-align: left;
322
  margin-left: 0;
323
  width: 20%;
324
  min-width: 100px;
325
}
326
327
div.colist td {
328
  padding-right: 0.5em;
329
  padding-bottom: 0.3em;
330
  vertical-align: top;
331
}
332
div.colist td img {
333
  margin-top: 0.3em;
334
}
335
336
@media print {
337
  #footer-badges { display: none; }
338
}
339
340
#toc {
341
  margin-bottom: 2.5em;
342
}
343
344
#toctitle {
345
  color: #527bbd;
346
  font-size: 1.1em;
347
  font-weight: bold;
348
  margin-top: 1.0em;
349
  margin-bottom: 0.1em;
350
}
351
352
div.toclevel0, div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
353
  margin-top: 0;
354
  margin-bottom: 0;
355
}
356
div.toclevel2 {
357
  margin-left: 2em;
358
  font-size: 0.9em;
359
}
360
div.toclevel3 {
361
  margin-left: 4em;
362
  font-size: 0.9em;
363
}
364
div.toclevel4 {
365
  margin-left: 6em;
366
  font-size: 0.9em;
367
}
368
369
span.aqua { color: aqua; }
370
span.black { color: black; }
371
span.blue { color: blue; }
372
span.fuchsia { color: fuchsia; }
373
span.gray { color: gray; }
374
span.green { color: green; }
375
span.lime { color: lime; }
376
span.maroon { color: maroon; }
377
span.navy { color: navy; }
378
span.olive { color: olive; }
379
span.purple { color: purple; }
380
span.red { color: red; }
381
span.silver { color: silver; }
382
span.teal { color: teal; }
383
span.white { color: white; }
384
span.yellow { color: yellow; }
385
386
span.aqua-background { background: aqua; }
387
span.black-background { background: black; }
388
span.blue-background { background: blue; }
389
span.fuchsia-background { background: fuchsia; }
390
span.gray-background { background: gray; }
391
span.green-background { background: green; }
392
span.lime-background { background: lime; }
393
span.maroon-background { background: maroon; }
394
span.navy-background { background: navy; }
395
span.olive-background { background: olive; }
396
span.purple-background { background: purple; }
397
span.red-background { background: red; }
398
span.silver-background { background: silver; }
399
span.teal-background { background: teal; }
400
span.white-background { background: white; }
401
span.yellow-background { background: yellow; }
402
403
span.big { font-size: 2em; }
404
span.small { font-size: 0.6em; }
405
406
span.underline { text-decoration: underline; }
407
span.overline { text-decoration: overline; }
408
span.line-through { text-decoration: line-through; }
409
410
div.unbreakable { page-break-inside: avoid; }
411
412
413
/*
414
 * xhtml11 specific
415
 *
416
 * */
417
418
tt {
419
  font-family: "Courier New", Courier, monospace;
420
  font-size: inherit;
421
  color: navy;
422
}
423
424
div.tableblock {
425
  margin-top: 1.0em;
426
  margin-bottom: 1.5em;
427
}
428
div.tableblock > table {
429
  border: 3px solid #527bbd;
430
}
431
thead, p.table.header {
432
  font-weight: bold;
433
  color: #527bbd;
434
}
435
p.table {
436
  margin-top: 0;
437
}
438
/* Because the table frame attribute is overriden by CSS in most browsers. */
439
div.tableblock > table[frame="void"] {
440
  border-style: none;
441
}
442
div.tableblock > table[frame="hsides"] {
443
  border-left-style: none;
444
  border-right-style: none;
445
}
446
div.tableblock > table[frame="vsides"] {
447
  border-top-style: none;
448
  border-bottom-style: none;
449
}
450
451
452
/*
453
 * html5 specific
454
 *
455
 * */
456
457
.monospaced {
458
  font-family: "Courier New", Courier, monospace;
459
  font-size: inherit;
460
  color: navy;
461
}
462
463
table.tableblock {
464
  margin-top: 1.0em;
465
  margin-bottom: 1.5em;
466
}
467
thead, p.tableblock.header {
468
  font-weight: bold;
469
  color: #527bbd;
470
}
471
p.tableblock {
472
  margin-top: 0;
473
}
474
table.tableblock {
475
  border-width: 3px;
476
  border-spacing: 0px;
477
  border-style: solid;
478
  border-color: #527bbd;
479
  border-collapse: collapse;
480
}
481
th.tableblock, td.tableblock {
482
  border-width: 1px;
483
  padding: 4px;
484
  border-style: solid;
485
  border-color: #527bbd;
486
}
487
488
table.tableblock.frame-topbot {
489
  border-left-style: hidden;
490
  border-right-style: hidden;
491
}
492
table.tableblock.frame-sides {
493
  border-top-style: hidden;
494
  border-bottom-style: hidden;
495
}
496
table.tableblock.frame-none {
497
  border-style: hidden;
498
}
499
500
th.tableblock.halign-left, td.tableblock.halign-left {
501
  text-align: left;
502
}
503
th.tableblock.halign-center, td.tableblock.halign-center {
504
  text-align: center;
505
}
506
th.tableblock.halign-right, td.tableblock.halign-right {
507
  text-align: right;
508
}
509
510
th.tableblock.valign-top, td.tableblock.valign-top {
511
  vertical-align: top;
512
}
513
th.tableblock.valign-middle, td.tableblock.valign-middle {
514
  vertical-align: middle;
515
}
516
th.tableblock.valign-bottom, td.tableblock.valign-bottom {
517
  vertical-align: bottom;
518
}
519
520
521
/*
522
 * manpage specific
523
 *
524
 * */
525
526
body.manpage h1 {
527
  padding-top: 0.5em;
528
  padding-bottom: 0.5em;
529
  border-top: 2px solid silver;
530
  border-bottom: 2px solid silver;
531
}
532
body.manpage h2 {
533
  border-style: none;
534
}
535
body.manpage div.sectionbody {
536
  margin-left: 3em;
537
}
538
539
@media print {
540
  body.manpage div#toc { display: none; }
541
}
542
</style>
543
<script type="text/javascript">
544
/*<![CDATA[*/
545
var asciidoc = {  // Namespace.
546
547
/////////////////////////////////////////////////////////////////////
548
// Table Of Contents generator
549
/////////////////////////////////////////////////////////////////////
550
551
/* Author: Mihai Bazon, September 2002
552
 * http://students.infoiasi.ro/~mishoo
553
 *
554
 * Table Of Content generator
555
 * Version: 0.4
556
 *
557
 * Feel free to use this script under the terms of the GNU General Public
558
 * License, as long as you do not remove or alter this notice.
559
 */
560
561
 /* modified by Troy D. Hanson, September 2006. License: GPL */
562
 /* modified by Stuart Rackham, 2006, 2009. License: GPL */
563
564
// toclevels = 1..4.
565
toc: function (toclevels) {
566
567
  function getText(el) {
568
    var text = "";
569
    for (var i = el.firstChild; i != null; i = i.nextSibling) {
570
      if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
571
        text += i.data;
572
      else if (i.firstChild != null)
573
        text += getText(i);
574
    }
575
    return text;
576
  }
577
578
  function TocEntry(el, text, toclevel) {
579
    this.element = el;
580
    this.text = text;
581
    this.toclevel = toclevel;
582
  }
583
584
  function tocEntries(el, toclevels) {
585
    var result = new Array;
586
    var re = new RegExp('[hH]([1-'+(toclevels+1)+'])');
587
    // Function that scans the DOM tree for header elements (the DOM2
588
    // nodeIterator API would be a better technique but not supported by all
589
    // browsers).
590
    var iterate = function (el) {
591
      for (var i = el.firstChild; i != null; i = i.nextSibling) {
592
        if (i.nodeType == 1 /* Node.ELEMENT_NODE */) {
593
          var mo = re.exec(i.tagName);
594
          if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") {
595
            result[result.length] = new TocEntry(i, getText(i), mo[1]-1);
596
          }
597
          iterate(i);
598
        }
599
      }
600
    }
601
    iterate(el);
602
    return result;
603
  }
604
605
  var toc = document.getElementById("toc");
606
  if (!toc) {
607
    return;
608
  }
609
610
  // Delete existing TOC entries in case we're reloading the TOC.
611
  var tocEntriesToRemove = [];
612
  var i;
613
  for (i = 0; i < toc.childNodes.length; i++) {
614
    var entry = toc.childNodes[i];
615
    if (entry.nodeName.toLowerCase() == 'div'
616
     && entry.getAttribute("class")
617
     && entry.getAttribute("class").match(/^toclevel/))
618
      tocEntriesToRemove.push(entry);
619
  }
620
  for (i = 0; i < tocEntriesToRemove.length; i++) {
621
    toc.removeChild(tocEntriesToRemove[i]);
622
  }
623
624
  // Rebuild TOC entries.
625
  var entries = tocEntries(document.getElementById("content"), toclevels);
626
  for (var i = 0; i < entries.length; ++i) {
627
    var entry = entries[i];
628
    if (entry.element.id == "")
629
      entry.element.id = "_toc_" + i;
630
    var a = document.createElement("a");
631
    a.href = "#" + entry.element.id;
632
    a.appendChild(document.createTextNode(entry.text));
633
    var div = document.createElement("div");
634
    div.appendChild(a);
635
    div.className = "toclevel" + entry.toclevel;
636
    toc.appendChild(div);
637
  }
638
  if (entries.length == 0)
639
    toc.parentNode.removeChild(toc);
640
},
641
642
643
/////////////////////////////////////////////////////////////////////
644
// Footnotes generator
645
/////////////////////////////////////////////////////////////////////
646
647
/* Based on footnote generation code from:
648
 * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html
649
 */
650
651
footnotes: function () {
652
  // Delete existing footnote entries in case we're reloading the footnodes.
653
  var i;
654
  var noteholder = document.getElementById("footnotes");
655
  if (!noteholder) {
656
    return;
657
  }
658
  var entriesToRemove = [];
659
  for (i = 0; i < noteholder.childNodes.length; i++) {
660
    var entry = noteholder.childNodes[i];
661
    if (entry.nodeName.toLowerCase() == 'div' && entry.getAttribute("class") == "footnote")
662
      entriesToRemove.push(entry);
663
  }
664
  for (i = 0; i < entriesToRemove.length; i++) {
665
    noteholder.removeChild(entriesToRemove[i]);
666
  }
667
668
  // Rebuild footnote entries.
669
  var cont = document.getElementById("content");
670
  var spans = cont.getElementsByTagName("span");
671
  var refs = {};
672
  var n = 0;
673
  for (i=0; i<spans.length; i++) {
674
    if (spans[i].className == "footnote") {
675
      n++;
676
      var note = spans[i].getAttribute("data-note");
677
      if (!note) {
678
        // Use [\s\S] in place of . so multi-line matches work.
679
        // Because JavaScript has no s (dotall) regex flag.
680
        note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1];
681
        spans[i].innerHTML =
682
          "[<a id='_footnoteref_" + n + "' href='#_footnote_" + n +
683
          "' title='View footnote' class='footnote'>" + n + "</a>]";
684
        spans[i].setAttribute("data-note", note);
685
      }
686
      noteholder.innerHTML +=
687
        "<div class='footnote' id='_footnote_" + n + "'>" +
688
        "<a href='#_footnoteref_" + n + "' title='Return to text'>" +
689
        n + "</a>. " + note + "</div>";
690
      var id =spans[i].getAttribute("id");
691
      if (id != null) refs["#"+id] = n;
692
    }
693
  }
694
  if (n == 0)
695
    noteholder.parentNode.removeChild(noteholder);
696
  else {
697
    // Process footnoterefs.
698
    for (i=0; i<spans.length; i++) {
699
      if (spans[i].className == "footnoteref") {
700
        var href = spans[i].getElementsByTagName("a")[0].getAttribute("href");
701
        href = href.match(/#.*/)[0];  // Because IE return full URL.
702
        n = refs[href];
703
        spans[i].innerHTML =
704
          "[<a href='#_footnote_" + n +
705
          "' title='View footnote' class='footnote'>" + n + "</a>]";
706
      }
707
    }
708
  }
709
},
710
711
install: function(toclevels) {
712
  var timerId;
713
714
  function reinstall() {
715
    asciidoc.footnotes();
716
    if (toclevels) {
717
      asciidoc.toc(toclevels);
718
    }
719
  }
720
721
  function reinstallAndRemoveTimer() {
722
    clearInterval(timerId);
723
    reinstall();
724
  }
725
726
  timerId = setInterval(reinstall, 500);
727
  if (document.addEventListener)
728
    document.addEventListener("DOMContentLoaded", reinstallAndRemoveTimer, false);
729
  else
730
    window.onload = reinstallAndRemoveTimer;
731
}
732
733
}
734
asciidoc.install();
735
/*]]>*/
736
</script>
737
</head>
738
<body class="article">
739
<div id="header">
740
<h1>upmpdcli Linn Songcast integration</h1>
741
</div>
742
<div id="content">
743
<div id="preamble">
744
<div class="sectionbody">
745
<div class="paragraph"><p>The <strong>sc2mpd</strong> auxiliary process implements part of Linn <strong>Songcast</strong> support
746
for the <strong>upmdcli</strong> UPnP MPD front-end. Specifically, it implements a
747
<strong>Songcast</strong> <em>Receiver</em> service, managed by <strong>upmpdcli</strong>.</p></div>
748
<div class="paragraph"><p><strong><em>This has mostly been tested with 16 bits sound but a recent change seems
749
to have fixed 24 bits sound, so this should be now usable for MACs.  This
750
needs mpd 0.19 on the renderer. Still be a bit careful as this is quite new
751
and there is a risk of strange noises !</em></strong></p></div>
752
<div class="paragraph"><p><strong><em>Do not try 24 bits sound with MPD 0.18 !</em></strong> (or turn the volume very
753
low&#8230;). Using Songcast from a Mac (24 bits audio) needs <strong>mpd 0.19</strong>,
754
configured with <tt>--disable-audiofile</tt>.</p></div>
755
<div class="paragraph"><p>As Debian and Ubuntu tend to lag quite bit on MPD progresses, I have setup
756
<a href="downloads.html#mpd">backport repositories</a> for recent mpd versions
757
(currently 0.19.9), for Ubuntu, Debian i386/amd64 and Raspbian.</p></div>
758
</div>
759
</div>
760
<div class="sect1">
761
<h2 id="_what_is_songcast">What is Songcast</h2>
762
<div class="sectionbody">
763
<div class="paragraph"><p>Songcast is a protocol for transporting audio streams across the
764
network. This is independant from the UPnP framework which mostly deals
765
with URLs and audio files (usually, but not necessarily, compressed).</p></div>
766
<div class="paragraph"><p>The streams transported by Songcast are actual real-time audio data, which
767
can go straight to an audio card for playing.</p></div>
768
<div class="paragraph"><p>Controlling the streams on the renderer (connecting, starting, stopping) is
769
done through an UPnP service named OpenHome <em>Receiver</em>.</p></div>
770
<div class="paragraph"><p>The typical use of Songcast is to have an audio driver on a Windows or OS X
771
desktop capture and forward the audio stream to a remote Songcast device.</p></div>
772
<div class="paragraph"><p>Any application on the desktop will (be compelled to) transparently play to
773
the remote device, without need to know anything about Songcast.</p></div>
774
</div>
775
</div>
776
<div class="sect1">
777
<h2 id="_implementation_of_songcast_support_in_upmpdcli">Implementation of Songcast support in upmpdcli</h2>
778
<div class="sectionbody">
779
<div class="paragraph"><p><strong>upmpdcli</strong> implements the <em>Receiver</em> service, and uses an auxiliary process
780
(<strong>sc2mpd</strong>) for transporting the audio data. <strong>sc2mpd</strong> is a slight
781
modification of the sample program which comes with the Linn Songcast
782
open-source implementation, with the addition of an HTTP interface (based
783
on <em>libmicrohttpd</em>) to forward the data to <strong>mpd</strong>.</p></div>
784
<div class="paragraph"><p>Setting up a connection happens as follows:</p></div>
785
<div class="ulist"><ul>
786
<li>
787
<p>
788
If it finds an executable <strong>sc2mpd</strong> command in the PATH when starting up,
789
  <strong>upmpdcli</strong> advertises a <em>Receiver</em> service.
790
</p>
791
</li>
792
<li>
793
<p>
794
The Songcast implementation from the desktop finds out about the
795
  <em>Receiver</em> through the normal UPnP mechanisms and can be instructed to
796
  use it. It then tells the <em>Receiver</em> in <strong>upmpdcli</strong> to start playing.
797
</p>
798
</li>
799
<li>
800
<p>
801
<strong>upmdpcli</strong> starts the <strong>sc2mpd</strong> process, which gets ready to receive data
802
  through Songcast, and make it available through HTTP.
803
</p>
804
</li>
805
<li>
806
<p>
807
<strong>upmpdcli</strong> instructs <strong>mpd</strong> to play the URL for the <strong>sc2mpd</strong> output.
808
</p>
809
</li>
810
</ul></div>
811
<div class="paragraph"><p>There is currently a 10-12 S delay between the connection request and the
812
moment the audio starts playing. This is not normal, but I could not find
813
the reason for it, so it&#8217;s an unavoidable inconvenience at the moment.</p></div>
814
</div>
815
</div>
816
<div class="sect1">
817
<h2 id="_configuration">Configuration</h2>
818
<div class="sectionbody">
819
<div class="paragraph"><p>No configuration is necessary by default: if <strong>sc2mpd</strong> is present,
820
<strong>upmpdcli</strong> will advertise the Songcast capability, and any host with a
821
Songcast sender installed should be able to use it.</p></div>
822
<div class="paragraph"><p>However, you can set a number of values in the upmpdcli configuration file
823
(you <strong>must</strong> set the <strong>upmpdcli</strong> <tt>-c</tt> option for <strong>sc2mpd</strong> to see them, the
824
environment variable will not work):</p></div>
825
<div class="dlist"><dl>
826
<dt class="hdlist1">
827
sclogfilename
828
</dt>
829
<dd>
830
<p>
831
Name of the file which will receive <strong>sc2mpd</strong> log messages. <tt>stderr</tt> by
832
default. This <em>can&#8217;t be</em> the same file used by <strong>upmpdcli</strong>.
833
</p>
834
</dd>
835
<dt class="hdlist1">
836
scloglevel
837
</dt>
838
<dd>
839
<p>
840
Log verbosity.
841
</p>
842
</dd>
843
<dt class="hdlist1">
844
schttpport
845
</dt>
846
<dd>
847
<p>
848
HTTP port used by <strong>mpd</strong> to connect to <strong>sc2mpd</strong>. 8888 by default. This must
849
be an available port on <tt>localhost</tt>, and it will only accept connections from
850
<tt>localhost</tt>.
851
</p>
852
</dd>
853
<dt class="hdlist1">
854
sc2mpd
855
</dt>
856
<dd>
857
<p>
858
Path for the <strong>sc2mpd</strong> executable file (e.g. <tt>/usr/local/bin/sc2mpd</tt>). Only
859
useful if <strong>sc2mpd</strong> was not installed to a location in the executable $PATH
860
set for the init scripts. Typically only <tt>/bin</tt> and <tt>/usr/bin</tt> are in
861
there.
862
</p>
863
</dd>
864
</dl></div>
865
</div>
866
</div>
867
<div class="sect1">
868
<h2 id="_building_sc2mpd">Building sc2mpd</h2>
869
<div class="sectionbody">
870
<div class="paragraph"><p>There are two parts in building <strong>sc2mpd</strong>:</p></div>
871
<div class="ulist"><ul>
872
<li>
873
<p>
874
Building the Openhome libraries
875
</p>
876
</li>
877
<li>
878
<p>
879
Building <strong>sc2mpd</strong> proper
880
</p>
881
</li>
882
</ul></div>
883
<div class="paragraph"><p>First clone the <strong>sc2mpd</strong> Github repository:
884
<a href="http://www.github.com/medoc92/sc2mpd">http://www.github.com/medoc92/sc2mpd</a>.</p></div>
885
<div class="paragraph"><p><strong>sc2mpd</strong> depends on the microhttpd library. Install the development and
886
runtime packages which are currently named <em>libmicrohttpd-dev</em> and
887
<em>libmicrohttpd10</em> on Debian-derived systems (use <em>libmicrohttpd</em> and
888
<em>libmicrohttpd-devel</em> for Fedora).</p></div>
889
<div class="paragraph"><p>Building the Openhome libraries is a bit of a black art, and the <strong>sc2mpd</strong>
890
source comes with an <em>ohbuild.sh</em> script which will try to clone the
891
Openhome Git repositories and build the libs:</p></div>
892
<div class="literalblock">
893
<div class="content">
894
<pre><tt>cd sc2mpd
895
mkdir /my/place/for/openhome
896
sh ohbuild.sh /my/place/for/openhome</tt></pre>
897
</div></div>
898
<div class="paragraph"><p>Miscellaneous error messages will be displayed during the build. Hope for
899
the best&#8230;</p></div>
900
<div class="paragraph"><p>When this is done, build <strong>sc2mpd</strong>, using the following commands inside the
901
<em>sc2mpd</em> directory:</p></div>
902
<div class="literalblock">
903
<div class="content">
904
<pre><tt>sh autogen.sh
905
./configure --prefix=/usr --with-openhome=/my/place/for/openhome
906
make
907
sudo make install</tt></pre>
908
</div></div>
909
<div class="paragraph"><p>The build uses static Openhome libraries, so you can move the executable to
910
another machine without needing the Openhome directory (don&#8217;t forget to
911
install the <em>libmicrohttpd</em> runtime though).</p></div>
912
<div class="paragraph"><p>After restarting <strong>upmpdcli</strong>, it should advertise the <em>Receiver</em> service and
913
appear in the Songcast Sender menus.</p></div>
914
</div>
915
</div>
916
<div class="sect1">
917
<h2 id="_miscellaneous_remarks">Miscellaneous remarks</h2>
918
<div class="sectionbody">
919
<div class="paragraph"><p>Songcast is probably best transported over a wired connection. If you are
920
doing this over WIFI and experiencing glitches, the wireless is the first
921
suspect.</p></div>
922
</div>
923
</div>
924
</div>
925
<div id="footnotes"><hr /></div>
926
<div id="footer">
927
<div id="footer-text">
928
Last updated 2015-04-07 11:24:19 CEST
929
</div>
930
</div>
931
</body>
932
</html>