Dimitris Papastamos | 23 Jun 17:35 2016

[PATCH] output/sndio: Remove unused attribute

From 82ba79b7351c834c17e816b49799303138397e9d Mon Sep 17 00:00:00 2001
From: Dimitris Papastamos <sin <at> 2f30.org>
Date: Thu, 23 Jun 2016 16:33:29 +0100
Subject: [PATCH] output/sndio: Remove unused attribute

The variable is actually used in this function.
---
 src/output/plugins/SndioOutputPlugin.cxx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/output/plugins/SndioOutputPlugin.cxx b/src/output/plugins/SndioOutputPlugin.cxx
index 6d4090d..b4898dc 100644
--- a/src/output/plugins/SndioOutputPlugin.cxx
+++ b/src/output/plugins/SndioOutputPlugin.cxx
 <at>  <at>  -103,7 +103,7  <at>  <at>  sndio_test_default_device()
 }

 bool
-SndioOutput::Open(AudioFormat &audio_format, gcc_unused Error &error)
+SndioOutput::Open(AudioFormat &audio_format, Error &error)
 {
 	struct sio_par par;
 	unsigned bits, rate, chans;
--

-- 
2.8.4

_______________________________________________
mpd-devel mailing list
mpd-devel <at> musicpd.org
http://mailman.blarg.de/listinfo/mpd-devel
(Continue reading)

Dimitris Papastamos | 23 Jun 17:17 2016

[PATCH] output/sndio: Add 24-bit 4-byte packed audio format support

From 95f3eaba612bce86aadf65b2a2bca608201b9228 Mon Sep 17 00:00:00 2001
From: Dimitris Papastamos <sin <at> 2f30.org>
Date: Thu, 23 Jun 2016 16:16:09 +0100
Subject: [PATCH] output/sndio: Add 24-bit 4-byte packed audio format support

---
 src/output/plugins/SndioOutputPlugin.cxx | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/output/plugins/SndioOutputPlugin.cxx b/src/output/plugins/SndioOutputPlugin.cxx
index d5741ea..6d4090d 100644
--- a/src/output/plugins/SndioOutputPlugin.cxx
+++ b/src/output/plugins/SndioOutputPlugin.cxx
 <at>  <at>  -119,6 +119,9  <at>  <at>  SndioOutput::Open(AudioFormat &audio_format, gcc_unused Error &error)
 	case SampleFormat::S16:
 		bits = 16;
 		break;
+	case SampleFormat::S24_P32:
+		bits = 24;
+		break;
 	case SampleFormat::S32:
 		bits = 32;
 		break;
--

-- 
2.8.4

_______________________________________________
mpd-devel mailing list
mpd-devel <at> musicpd.org
http://mailman.blarg.de/listinfo/mpd-devel
(Continue reading)

Dimitris Papastamos | 23 Jun 14:10 2016

[PATCH] output/sndio: No need to use a loop in Play()

From dc28055962948b3f0993f07d3c014557fa6d9d14 Mon Sep 17 00:00:00 2001
From: Dimitris Papastamos <sin <at> 2f30.org>
Date: Thu, 23 Jun 2016 13:04:53 +0100
Subject: [PATCH] output/sndio: No need to use a loop in Play()

This is a left-over from the previous version of the code
that was retrying on EINTR.
---
 src/output/plugins/SndioOutputPlugin.cxx | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/src/output/plugins/SndioOutputPlugin.cxx b/src/output/plugins/SndioOutputPlugin.cxx
index 69747ae..d5741ea 100644
--- a/src/output/plugins/SndioOutputPlugin.cxx
+++ b/src/output/plugins/SndioOutputPlugin.cxx
 <at>  <at>  -180,16 +180,10  <at>  <at>  SndioOutput::Play(const void *chunk, size_t size, Error &error)
 {
 	size_t n;

-	while (1) {
-		n = sio_write(sio_hdl, chunk, size);
-		if (n == 0) {
-			if (sio_eof(sio_hdl)) {
-				error.Set(sndio_output_domain, -1, "sndio write failed");
-				return 0;
-			}
-		}
-		return n;
-	}
+	n = sio_write(sio_hdl, chunk, size);
(Continue reading)

Dimitris Papastamos | 23 Jun 10:42 2016

[PATCH] output/sndio: Use size_t instead of ssize_t

From 4911a27199d4a90dd5436959116c82a3aa0bb3c1 Mon Sep 17 00:00:00 2001
From: Dimitris Papastamos <sin <at> 2f30.org>
Date: Thu, 23 Jun 2016 09:40:11 +0100
Subject: [PATCH] output/sndio: Use size_t instead of ssize_t

Some minor style fixes as well.
---
 src/output/plugins/SndioOutputPlugin.cxx | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/output/plugins/SndioOutputPlugin.cxx b/src/output/plugins/SndioOutputPlugin.cxx
index b4f807c..69747ae 100644
--- a/src/output/plugins/SndioOutputPlugin.cxx
+++ b/src/output/plugins/SndioOutputPlugin.cxx
 <at>  <at>  -37,6 +37,8  <at>  <at> 

 static constexpr unsigned MPD_SNDIO_BUFFER_TIME_MS = 250;

+static constexpr Domain sndio_output_domain("sndio_output");
+
 class SndioOutput {
 	friend struct AudioOutputWrapper<SndioOutput>;
 	AudioOutput base;
 <at>  <at>  -60,8 +62,6  <at>  <at>  public:
 	void Cancel();
 };

-static constexpr Domain sndio_output_domain("sndio_output");
-
 bool
(Continue reading)

Anna Ivanova | 23 Jun 01:02 2016
Picon

Tagging

Hello,

How do I add my own tags? I know, that I need to edit sources of
libmpdclient (or rather, tag.h and tag.c), but how to implement work
with it in mpd?

--

-- 
kalterfive
_______________________________________________
mpd-devel mailing list
mpd-devel <at> musicpd.org
http://mailman.blarg.de/listinfo/mpd-devel
Dimitris Papastamos | 22 Jun 18:42 2016

[PATCH] doc: Initial sndio documentation

From 8fb1e4514752efb4ba42a1d8595c7651c159f456 Mon Sep 17 00:00:00 2001
From: Dimitris Papastamos <sin <at> 2f30.org>
Date: Wed, 22 Jun 2016 17:41:06 +0100
Subject: [PATCH] doc: Initial sndio documentation

---
 doc/user.xml | 45 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 45 insertions(+)

diff --git a/doc/user.xml b/doc/user.xml
index e126f76..3b59df6 100644
--- a/doc/user.xml
+++ b/doc/user.xml
 <at>  <at>  -2738,6 +2738,51  <at>  <at>  buffer_size: 16384</programlisting>
       </section>

       <section>
+        <title><varname>sndio</varname></title>
+
+        <para>
+          The <varname>sndio</varname> plugin uses the <ulink
+          url="http://www.sndio.org/">sndio</ulink> library.  It should normally be used
+          on OpenBSD.
+        </para>
+
+        <informaltable>
+          <tgroup cols="2">
+            <thead>
+              <row>
+                <entry>Setting</entry>
(Continue reading)

Dimitris Papastamos | 22 Jun 15:52 2016

[PATCH] sndio: Eliminate remaining goto usage to conform to MPD style

From b91a1d0cbf446fedb9507d28ed8273ac04a66119 Mon Sep 17 00:00:00 2001
From: Dimitris Papastamos <sin <at> 2f30.org>
Date: Wed, 22 Jun 2016 14:50:35 +0100
Subject: [PATCH] sndio: Eliminate remaining goto usage to conform to MPD style

---
 src/output/plugins/SndioOutputPlugin.cxx | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/output/plugins/SndioOutputPlugin.cxx b/src/output/plugins/SndioOutputPlugin.cxx
index e0897ca..b4f807c 100644
--- a/src/output/plugins/SndioOutputPlugin.cxx
+++ b/src/output/plugins/SndioOutputPlugin.cxx
 <at>  <at>  -143,7 +143,8  <at>  <at>  SndioOutput::Open(AudioFormat &audio_format, gcc_unused Error &error)
 	    !sio_getpar(sio_hdl, &par)) {
 		error.Format(sndio_output_domain, -1,
 		             "Failed to set/get audio params");
-		goto err;
+		sio_close(sio_hdl);
+		return false;
 	}

 	if (par.bits != bits ||
 <at>  <at>  -154,19 +155,18  <at>  <at>  SndioOutput::Open(AudioFormat &audio_format, gcc_unused Error &error)
 	    par.le != SIO_LE_NATIVE) {
 		error.Format(sndio_output_domain, -1,
 		             "Requested audio params cannot be satisfied");
-		goto err;
+		sio_close(sio_hdl);
+		return false;
(Continue reading)

Dimitris Papastamos | 22 Jun 15:33 2016

[PATCH] sndio: Fix segmentation fault when audio card is removed

From 26e97c601793cc44d6db157c0a063de5fb3d17dc Mon Sep 17 00:00:00 2001
From: Dimitris Papastamos <sin <at> 2f30.org>
Date: Wed, 22 Jun 2016 14:30:00 +0100
Subject: [PATCH] sndio: Fix segmentation fault when audio card is removed

This can happen if you remove an external audio card or if you stop
sndiod(8) while playing a song.

sio_write() will retry internally if it fails with errno == EINTR
so no need to handle that.
---
 src/output/plugins/SndioOutputPlugin.cxx | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/src/output/plugins/SndioOutputPlugin.cxx b/src/output/plugins/SndioOutputPlugin.cxx
index eac302a..e0897ca 100644
--- a/src/output/plugins/SndioOutputPlugin.cxx
+++ b/src/output/plugins/SndioOutputPlugin.cxx
 <at>  <at>  -17,7 +17,6  <at>  <at> 
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */

-#include <errno.h>
 #include <sndio.h>
 #include <string.h>
 #include <unistd.h>
 <at>  <at>  -183,11 +182,11  <at>  <at>  SndioOutput::Play(const void *chunk, size_t size, Error &error)

 	while (1) {
 		n = sio_write(sio_hdl, chunk, size);
(Continue reading)

Dimitris Papastamos | 22 Jun 15:11 2016

[PATCH] Add an example of sndio output to mpdconf.example

From ca60db2aec3b2ccca9373f3a9ad1be68a6e3e837 Mon Sep 17 00:00:00 2001
From: Dimitris Papastamos <sin <at> 2f30.org>
Date: Wed, 22 Jun 2016 14:07:11 +0100
Subject: [PATCH 2/2] Add an example of sndio output to mpdconf.example

---
 doc/mpdconf.example | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/doc/mpdconf.example b/doc/mpdconf.example
index 4c5d679..b6ecefe 100644
--- a/doc/mpdconf.example
+++ b/doc/mpdconf.example
 <at>  <at>  -305,6 +305,14  <at>  <at>  input {
 ##	device		"Digital Audio (S/PDIF) (High Definition Audio Device)" # optional
 #}
 #
+# An example of an sndio output.
+#
+#audio_output {
+#	type		"sndio"
+#	name		"sndio output"
+#	mixer_type	"software"
+#}
+#
 ## Example "pipe" output:
 #
 #audio_output {
--

-- 
2.8.4
(Continue reading)

Dimitris Papastamos | 22 Jun 15:10 2016

[PATCH] sndio: Allow tweaking application buffer size

From 0ad23e752afb3afdf0771a50a8fc9992b6308485 Mon Sep 17 00:00:00 2001
From: Dimitris Papastamos <sin <at> 2f30.org>
Date: Wed, 22 Jun 2016 14:03:27 +0100
Subject: [PATCH 1/2] sndio: Allow tweaking application buffer size

It defaults to 250 ms.
---
 src/output/plugins/SndioOutputPlugin.cxx | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/output/plugins/SndioOutputPlugin.cxx b/src/output/plugins/SndioOutputPlugin.cxx
index ed039e7..eac302a 100644
--- a/src/output/plugins/SndioOutputPlugin.cxx
+++ b/src/output/plugins/SndioOutputPlugin.cxx
 <at>  <at>  -36,10 +36,13  <at>  <at> 
 #define SIO_DEVANY "default"
 #endif

+static constexpr unsigned MPD_SNDIO_BUFFER_TIME_MS = 250;
+
 class SndioOutput {
 	friend struct AudioOutputWrapper<SndioOutput>;
 	AudioOutput base;
 	const char *device;
+	unsigned buffer_time; /* in ms */
 	struct sio_hdl *sio_hdl;

 public:
 <at>  <at>  -66,6 +69,8  <at>  <at>  SndioOutput::Configure(const ConfigBlock &block, Error &error)
 	if (!base.Configure(block, error))
(Continue reading)

Jörg Krause | 22 Jun 13:00 2016

Trying to set a tag to a song with mpd_song_feed

I am using libmpdclient (version 2.10) to write a LuaJIT-based MPD
client. I run into an issue when I am trying to add a comment to a
radio station URI which I add to the queue. The comment is successfully
feed to the song as a tag. However, after issueing the play command,
the tag is gone.

This is the pseudo-code:

id = mpd_run_add_id(conn,uri)
song = mpd_run_get_queue_song_id(conn,id)

pair.name = "Comment"
pair.value = "My comment for the URL"
mpd_song_feed(song,pair)

s = mpd_song_get_tag(song,MPD_TAG_COMMENT,0)
> "My comment for the song"

mpd_run_play(conn)

s = mpd_song_get_tag(song,MPD_TAG_COMMENT,0)
> NULL

I can retrieve other tags like title and name, but the comment is not
available anymore.

My goal is to attach some user information to a radio station when the
URI is added to a playlist and fetch these information when the radio
station is currently played.

(Continue reading)


Gmane