jasonmc / forked-daapd

A re-write of the firefly media server (mt-daapd). It's released under GPLv2+. Please note that this git repository is a mirror of the official one at git://git.debian.org/~jblache/forked-daapd.git
http://blog.technologeek.org/2009/06/12/217
GNU General Public License v2.0
328 stars 45 forks source link

Assistance with AirPlay on QNAP (using forked-daap) #88

Open cliffai opened 12 years ago

cliffai commented 12 years ago

Hi - I'm an end user trying to use the AirPlay QPKG on a QNAP NAS. I've been directed here to request assistance with my issue by the developer of the QPKG.

I'm trying to use the Apple Remote application in conjunction with my Philips Fidelo AirPlay speakers.

I get no audio unfortunately from the speakers.

This is the log output from the application.

[2012-03-14 10:00:54] laudio: Cannot access file /root/.airplay/opt/share/alsa/alsa.conf[2012-03-14 10:00:54] laudio: Unknown PCM default[2012-03-14 10:00:54] laudio: Could not open playback device: No such file or directory [2012-03-14 10:00:54] player: Could not open local audio [2012-03-14 10:00:54] player: Could not activate local audio output [2012-03-14 10:00:54] dacp: Speakers de/activation failed! [2012-03-14 10:01:13] raop: Failed to retrieve artwork for 'The Immelman Turn' (16002); no artwork will be sent [2012-03-14 10:01:14] dacp: Could not find requested property 'dacp.fullscreenenabled' [2012-03-14 10:01:14] dacp: Could not find requested property 'dacp.fullscreen' [2012-03-14 10:01:14] dacp: Could not find requested property 'dacp.visualizerenabled' [2012-03-14 10:01:14] dacp: Could not find requested property 'dacp.visualizer' [2012-03-14 10:01:17] dacp: Could not find requested property 'dacp.fullscreenenabled' [2012-03-14 10:01:17] dacp: Could not find requested property 'dacp.fullscreen' [2012-03-14 10:01:17] dacp: Could not find requested property 'dacp.visualizerenabled' [2012-03-14 10:01:17] dacp: Could not find requested property 'dacp.visualizer' [2012-03-14 10:05:54] raop: Failed to retrieve artwork for 'Mr. Lear' (15991); no artwork will be sent [2012-03-14 10:08:54] ffmpeg: Header missing [2012-03-14 10:08:54] raop: Failed to retrieve artwork for 'Royal Courtship' (15997); no artwork will be sent [2012-03-14 10:09:29] dacp: Could not find requested property 'dacp.fullscreenenabled' [2012-03-14 10:09:29] dacp: Could not find requested property 'dacp.fullscreen' [2012-03-14 10:09:29] dacp: Could not find requested property 'dacp.visualizerenabled' [2012-03-14 10:09:29] dacp: Could not find requested property 'dacp.visualizer'

Any assistance with resolving this would be much appreciated - I'm not sure where to look.

Regards

Cliff

couteau commented 12 years ago

I had problems playing music to a non-apple airplay device (a Marantz M-CR603). The problem I was having was that the Marantz did not like the encrypted stream and also that forked-daapd was only sending metadata to AppleTV devices. It looks like you may be having other issues as well, but they may not be fatal. I fixed my issues and sent a patch to Julien. I don't know if/when he'll accept it or if it would fix your problems, but I'm happy to share my patch.

cliffai commented 12 years ago

Hi Couteau thanks for reply, I'm not sure I would know what to do with your patch, what I might do is ask the qpkg dev to hop on over here and take a look.

MCR123 commented 11 years ago

couteau, I run into issues using the same device as you (M-CR603), would you mind sharing your patch with me?

How actively developed is forked-daapd by the way, I believe there have not been changes for quite some time now.

l33marshall commented 11 years ago

hello. i think i have the same issue. i am trying to connect to a loewe airspeaker. i get a similar error about a missing ALSA config. is there a patch...and how can i apply?

m.

l33marshall commented 11 years ago

hi. could you share your patch?

couteau commented 11 years ago

Here's the patch, pasted below for the libevent version of forked-daapd. Couldn't figure out how to make an attachment. Let me know if you want the gcd version.


diff --git a/src/player.c b/src/player.c
index 15bd3df..6eee084 100644
--- a/src/player.c
+++ b/src/player.c
@@ -3590,6 +3590,8 @@ raop_device_cb(const char *name, const char *type, const char *domain, const cha
   char *at_name;
   char *password;
   uint64_t id;
+  char encrypt;
+  char wants_metadata;
   char has_password;
   enum raop_devtype devtype;
   int ret;
@@ -3721,6 +3723,46 @@ raop_device_cb(const char *name, const char *type, const char *domain, const cha
     devtype = RAOP_DEV_APPLETV;

  no_am:
+  p = keyval_get(txt, "ek");
+  if (!p)
+    {
+      DPRINTF(E_LOG, L_PLAYER, "AirTunes %s: no ek field in TXT record!\n", name);
+      encrypt = 0;
+
+      goto no_ek;
+    }
+
+  if (*p == '\0')
+    {
+      DPRINTF(E_LOG, L_PLAYER, "AirTunes %s: ek has no value\n", name);
+      encrypt = 0;
+
+      goto no_ek;
+    }
+
+  encrypt = (*p == '1') ? 1: 0;
+  
+ no_ek:  
+  p = keyval_get(txt, "md");
+  if (!p)
+    {
+      DPRINTF(E_LOG, L_PLAYER, "AirTunes %s: no md field in TXT record!\n", name);
+      wants_metadata = 0;
+
+      goto no_md;
+    }
+
+  if (*p == '\0')
+    {
+      DPRINTF(E_LOG, L_PLAYER, "AirTunes %s: md has no value\n", name);
+      wants_metadata = 0;
+
+      goto no_md;
+    }
+    
+    wants_metadata = 1;
+  
+ no_md:
   DPRINTF(E_DBG, L_PLAYER, "AirTunes device %s: password: %s, type %s\n", name, (password) ? "yes" : "no", raop_devtype[devtype]);

   rd->advertised = 1;
@@ -3740,6 +3782,8 @@ raop_device_cb(const char *name, const char *type, const char *domain, const cha

   rd->devtype = devtype;

+  rd->encrypt = encrypt;
+  rd->wants_metadata = wants_metadata;
   rd->has_password = has_password;
   rd->password = password;

diff --git a/src/raop.c b/src/raop.c
index adaff10..28586d6 100644
--- a/src/raop.c
+++ b/src/raop.c
@@ -1823,27 +1823,23 @@ raop_session_make(struct raop_device *rd, int family, raop_status_cb cb)
   rs->status_cb = cb;
   rs->server_fd = -1;

+  rs->encrypt = rd->encrypt;
+  rs->wants_metadata = rd->wants_metadata;
   rs->password = rd->password;

   switch (rd->devtype)
     {
       case RAOP_DEV_APEX_80211G:
-   rs->encrypt = 1;
-   rs->auth_quirk_itunes = 1;
-   rs->wants_metadata = 0;
-   break;
+        rs->auth_quirk_itunes = 1;
+        break;

       case RAOP_DEV_APEX_80211N:
-   rs->encrypt = 1;
-   rs->auth_quirk_itunes = 0;
-   rs->wants_metadata = 0;
-   break;
+        rs->auth_quirk_itunes = 0;
+        break;

       case RAOP_DEV_APPLETV:
-   rs->encrypt = 0;
-   rs->auth_quirk_itunes = 0;
-   rs->wants_metadata = 1;
-   break;
+        rs->auth_quirk_itunes = 0;
+        break;
     }

   rs->ctrl = evrtsp_connection_new(address, port);
diff --git a/src/raop.h b/src/raop.h
index 5c240e1..dd08a65 100644
--- a/src/raop.h
+++ b/src/raop.h
@@ -39,6 +39,8 @@ struct raop_device
   unsigned selected:1;
   unsigned advertised:1;

+  unsigned encrypt:1;
+  unsigned wants_metadata:1;
   unsigned has_password:1;
   const char *password;

l33marshall commented 11 years ago

Thank you.

One question, how do I apply it?

Lee

On Sunday, 6 January 2013, couteau wrote:

Here's the patch, pasted below. Couldn't figure out how to make an attachment. Just cut and past to a file and apply it.

diff --git a/src/player.c b/src/player.c index 15bd3df https://github.com/jasonmc/forked-daapd/commit/15bd3df..6eee084 100644 --- a/src/player.c +++ b/src/player.c @@ -3590,6 +3590,8 @@ raop_device_cb(const char name, const char type, const char domain, const cha char at_name; char *password; uint64_t id;

  • char encrypt;

    char wants_metadata; char has_password; enum raop_devtype devtype; int ret; @@ -3721,6 +3723,46 @@ raop_device_cb(const char name, const char type, const char *domain, const cha devtype = RAOP_DEV_APPLETV;

    no_am:

    p = keyval_get(txt, "ek");

    if (!p)

    {

    DPRINTF(E_LOG, L_PLAYER, "AirTunes %s: no ek field in TXT record!\n", name);

    encrypt = 0;

    +

    goto no_ek;

    }

    +

    if (*p == '\0')

    {

    DPRINTF(E_LOG, L_PLAYER, "AirTunes %s: ek has no value\n", name);

    encrypt = 0;

    +

    goto no_ek;

    }

    +

    encrypt = (*p == '1') ? 1: 0;

    no_ek:

    p = keyval_get(txt, "md");

    if (!p)

    {

    DPRINTF(E_LOG, L_PLAYER, "AirTunes %s: no md field in TXT record!\n", name);

    wants_metadata = 0;

    +

    goto no_md;

    }

    +

    if (*p == '\0')

    {

    DPRINTF(E_LOG, L_PLAYER, "AirTunes %s: md has no value\n", name);

    wants_metadata = 0;

    +

    goto no_md;

    }

    wants_metadata = 1;

    no_md: DPRINTF(E_DBG, L_PLAYER, "AirTunes device %s: password: %s, type %s\n", name, (password) ? "yes" : "no", raop_devtype[devtype]);

    rd->advertised = 1; @@ -3740,6 +3782,8 @@ raop_device_cb(const char name, const char type, const char *domain, const cha

    rd->devtype = devtype;

    rd->encrypt = encrypt;

    rd->wants_metadata = wants_metadata; rd->has_password = has_password; rd->password = password;

diff --git a/src/raop.c b/src/raop.c index adaff10 https://github.com/jasonmc/forked-daapd/commit/adaff10..28586d6 100644 --- a/src/raop.c +++ b/src/raop.c @@ -1823,27 +1823,23 @@ raop_session_make(struct raop_device *rd, int family, raop_status_cb cb) rs->status_cb = cb; rs->server_fd = -1;

  • rs->encrypt = rd->encrypt;

    rs->wants_metadata = rd->wants_metadata; rs->password = rd->password;

    switch (rd->devtype) {

    case RAOP_DEV_APEX_80211G:

    rs->encrypt = 1;

    rs->auth_quirk_itunes = 1;

    rs->wants_metadata = 0;

    break;

    rs->auth_quirk_itunes = 1;

    break;

    case RAOP_DEV_APEX_80211N:

    rs->encrypt = 1;

    rs->auth_quirk_itunes = 0;

    rs->wants_metadata = 0;

    break;

    rs->auth_quirk_itunes = 0;

    break;

    case RAOP_DEV_APPLETV:

    rs->encrypt = 0;

    rs->auth_quirk_itunes = 0;

    rs->wants_metadata = 1;

    break;

    rs->auth_quirk_itunes = 0;

    break;

    }

    rs->ctrl = evrtsp_connection_new(address, port); diff --git a/src/raop.h b/src/raop.h index 5c240e1 https://github.com/jasonmc/forked-daapd/commit/5c240e1..dd08a65 100644 --- a/src/raop.h +++ b/src/raop.h @@ -39,6 +39,8 @@ struct raop_device unsigned selected:1;

    unsigned advertised:1;

    unsigned encrypt:1;

    unsigned wants_metadata:1; unsigned has_password:1; const char *password;

    — Reply to this email directly or view it on GitHubhttps://github.com/jasonmc/forked-daapd/issues/88#issuecomment-11923247.

Lee Marshall +44 (0)7771 835993

513 Ben Jonson House Barbican City of London EC2Y 8NH

couteau commented 11 years ago

You have to be installing from source and you have to be using the Git version. This patch is against the libevent branch in git, so after you pull the code from the git repository, you have to switch to the libevent branch before applying the patch (or you can pull only the libevent branch in the first place). If you are using grand central dispatch instead of libevent, I can give you a patch against the git master branch.

Once you've got the source code, save the patch to a file (e.g., airplay.diff), cd into the source directory and run "git apply ".

l33marshall commented 11 years ago

Thanks but this is above my experience. I will have to wait for QNAP to build a package – I think.

Have a happy new year.

From: couteau [mailto:notifications@github.com] Sent: 07 January 2013 15:36 To: jasonmc/forked-daapd Cc: l33marshall Subject: Re: [forked-daapd] Assistance with AirPlay on QNAP (using forked-daap) (#88)

You have to be installing from source and you have to be using the Git version. This patch is against the libevent branch in git, so after you pull the code from the git repository, you have to switch to the libevent branch before (or you can pull only the libevent branch in the first place). If you are using grand central dispatch instead of libevent, I can give you a patch against the git master branch.

Once you've got the source code, save the patch to a file (e.g., airplay.diff), cd into the source directory and run "git apply ".

— Reply to this email directly or view it on GitHub https://github.com/jasonmc/forked-daapd/issues/88#issuecomment-11955896 .

https://github.com/notifications/beacon/Jshd8sI44GVrKZBvymxqKJXiwGOv_lcTR1bfFxC0lPL-RLdL5AlR9wzbVVMwBlGO.gif