IPB

Welcome Guest ( Log In | Register )

79 Pages V   1 2 3 > »   
Reply to this topicStart new topic
foo_upnp, UPnP/DLNA client and server (previously foo_upnp_mediaserver)
bubbleguuum
post Feb 20 2009, 18:57
Post #1





Group: Developer
Posts: 1112
Joined: 13-November 05
Member No.: 25748



Download latest version of plugin 0.99.48 [BETA] [Changelog]
Documentation (work in progress)

Some use cases:

- Use the server to stream audio to a PS3, XBOX360 (using their interface), iPhone (PlugPlayer)
- Push audio from either your local foobar2000 Media Library or another UPnP Media Server to WMP12, an iPhone (PlugPlayer) or another foobar2000 instance on the network.
- Control foobar2000 playback from an iPhone, WMP12, or any other Control Point.
- Browse and play your Media Library and playlists remotely with an Internet connection
- Control a Linn Ds product including making playlists, switching sources, etc.

UPnP AV Media Server
  • expose the foobar2000 Media Library, playlists and "what is currently playing"
  • stream almost any audio format playable by foobar2000. That includes formats generally not supported by most standalone Media Servers, such as formats with CUE files, game music formats, audio files in archives, cd-audio, DTS, HDCD, ...
  • stream album art
  • powerful per device streaming options, to adapt audio format to the capabilities of the remote playing device. conversion to WAV or LPCM, transcoding to mp3, resampling, replaygain, bitdepth conversion, conversion to stereo, DSP chain,...
  • customizable browse tree
  • accessible from the Internet (only from foobar2000 or an iPhone/iTouch with PlugPlayer).
  • works well when accessed from WMP12 (possibly also with WMP11, untested).

Media Server Browser (UPnP Browser)
  • browse remote Media Servers for local playback or remote playback to an UPnP Renderer on the network
  • browse and play music via the Internet from another foo_upnp Media Server, with optional transcoding to mp3 to save bandwidth
  • retrieve album art

Control Point (UPnP Controller)
  • control playback of UPnP Av Media Renderers (similar to Windows7 "Play to" feature)
  • integration with the Media Server to serve locally managed audio
  • specific support Linn Ds product: handle Playlist sources for on-device playlist management and other analog sources (volume control only)

UPnP AV Renderer
  • allow foobar2000 playback be controllable by UPnP Control Points


How to enable logging to troubleshoot problems

Logging can be enabled in File->Preferences->Tools->UPnP->Server->Basic. Logging is mostly useful so I can troubleshoot issues when I don't have the hardware or can't reproduce the issue. If log to file is enabled, a log file called foo_upnp.log is generated in either your foobar install directory or in <Document and settins>/<login>/Application Data/foobar2000. This file is overwritten on each foobar2000 launch. You can also see logging in the foobar2000 console by enabling the relevant option. Log level can be changed. Usually the INFO level gives sufficient information but sometimes finer spammy levels are required to troubleshoot some issues.

This post has been edited by bubbleguuum: Nov 18 2013, 14:21
Go to the top of the page
+Quote Post
--pv--
post Feb 20 2009, 19:32
Post #2





Group: Members
Posts: 128
Joined: 3-January 04
Member No.: 10920



Hello,
Sorry that this is not directly related to this component. It seems to be very nice feature to be able to use foobar 2000 to get my music collection streamed accross my home network. Now the question is the browser will only work with columns UI or so called hosts. I have looked at foo_dockable_pannels briefly and it still requires a lot of mouse activity to use it. Is there a solution so I can got this thing setup without requiring usage of the mouse?
Go to the top of the page
+Quote Post
Canar
post Feb 20 2009, 19:36
Post #3





Group: Super Moderator
Posts: 3373
Joined: 26-July 02
From: To:
Member No.: 2796



I get the following error trying to stream FLACs from one foobar2000 to another:

CODE
Decoding failure at 0:00.000 (Reported file length changed):
"http://192.168.1.10:56923/content/file:%2f%2fN:%5cNew%20&%20Unsorted%5cMochipet%20-%202009%20-%20Master%20P%20on%20Atari%5c04-Marshall_Bass_Stack.flac.wav?convert=wav&samplerate=44100"


--------------------
You cannot ABX the rustling of jimmies.
No mouse? No problem.
Go to the top of the page
+Quote Post
bubbleguuum
post Feb 20 2009, 19:47
Post #4





Group: Developer
Posts: 1112
Joined: 13-November 05
Member No.: 25748



QUOTE (Canar @ Feb 20 2009, 19:36) *
I get the following error trying to stream FLACs from one foobar2000 to another:

CODE
Decoding failure at 0:00.000 (Reported file length changed):
"http://192.168.1.10:56923/content/file:%2f%2fN:%5cNew%20&%20Unsorted%5cMochipet%20-%202009%20-%20Master%20P%20on%20Atari%5c04-Marshall_Bass_Stack.flac.wav?convert=wav&samplerate=44100"


Yup listed in limitations in the original post, as FLAC is streamed as WAV (FLAC is not a standard UPnP AV audio format). If a dev could explain in which case this error (Reported file length changed) happen I'll be able to correct it.
It probably has something to do with the HTTP Content-length header or the audio size in the WAV header but I'm not sure.
Go to the top of the page
+Quote Post
bubbleguuum
post Feb 20 2009, 19:49
Post #5





Group: Developer
Posts: 1112
Joined: 13-November 05
Member No.: 25748



QUOTE (--pv-- @ Feb 20 2009, 19:32) *
Hello,
Sorry that this is not directly related to this component. It seems to be very nice feature to be able to use foobar 2000 to get my music collection streamed accross my home network. Now the question is the browser will only work with columns UI or so called hosts. I have looked at foo_dockable_pannels briefly and it still requires a lot of mouse activity to use it. Is there a solution so I can got this thing setup without requiring usage of the mouse?


With foo_dockable_panels you just have to create the window panel once, it will be remembered. But it will remain a separate window.
Go to the top of the page
+Quote Post
--pv--
post Feb 20 2009, 20:00
Post #6





Group: Members
Posts: 128
Joined: 3-January 04
Member No.: 10920



I guess you are using somekind of treeview in the pannel. since foo_dockable_panels does not create top level windows I'd still need to click that window using mouse in order to get to interact with the window. or do I missunderstand completelly? For me docking implies something visual and since I am blind I always feel I don't understand it correctly.
Go to the top of the page
+Quote Post
Canar
post Feb 20 2009, 20:14
Post #7





Group: Super Moderator
Posts: 3373
Joined: 26-July 02
From: To:
Member No.: 2796



The size of the file that is reported by your HTTP server is changing. The client receives one value at one time and another value at another time. Specifically, look into the size of the file reported when seeking, as that was explicitly mentioned when I asked Peter directly.

This post has been edited by Canar: Feb 20 2009, 20:14


--------------------
You cannot ABX the rustling of jimmies.
No mouse? No problem.
Go to the top of the page
+Quote Post
Canar
post Feb 20 2009, 20:17
Post #8





Group: Super Moderator
Posts: 3373
Joined: 26-July 02
From: To:
Member No.: 2796



QUOTE (--pv-- @ Feb 20 2009, 11:00) *
I guess you are using somekind of treeview in the pannel. since foo_dockable_panels does not create top level windows I'd still need to click that window using mouse in order to get to interact with the window. or do I missunderstand completelly? For me docking implies something visual and since I am blind I always feel I don't understand it correctly.
That sounds right.

I suspect that the best use case for you is to use Columns UI, though I really don't know how well that supports the accessibility features you depend on.


--------------------
You cannot ABX the rustling of jimmies.
No mouse? No problem.
Go to the top of the page
+Quote Post
bubbleguuum
post Feb 20 2009, 21:53
Post #9





Group: Developer
Posts: 1112
Joined: 13-November 05
Member No.: 25748



QUOTE (Canar @ Feb 20 2009, 20:14) *
The size of the file that is reported by your HTTP server is changing. The client receives one value at one time and another value at another time. Specifically, look into the size of the file reported when seeking, as that was explicitly mentioned when I asked Peter directly.


Thanks, this is helpful and I have found where the problem is in my code smile.gif

This post has been edited by bubbleguuum: Feb 20 2009, 21:53
Go to the top of the page
+Quote Post
Canar
post Feb 20 2009, 22:03
Post #10





Group: Super Moderator
Posts: 3373
Joined: 26-July 02
From: To:
Member No.: 2796



I eagerly await the bug-fix release. smile.gif


--------------------
You cannot ABX the rustling of jimmies.
No mouse? No problem.
Go to the top of the page
+Quote Post
Canar
post Feb 21 2009, 00:28
Post #11





Group: Super Moderator
Posts: 3373
Joined: 26-July 02
From: To:
Member No.: 2796



Another weird bug: Somehow this component interferes with metadata from my Vorbis stream. With the component, I get no artist/title metadata (but oddly a couple other fields like DISCNUMBER). Without it, everything works as expected.


--------------------
You cannot ABX the rustling of jimmies.
No mouse? No problem.
Go to the top of the page
+Quote Post
bubbleguuum
post Feb 21 2009, 01:09
Post #12





Group: Developer
Posts: 1112
Joined: 13-November 05
Member No.: 25748



QUOTE (Canar @ Feb 21 2009, 00:28) *
Another weird bug: Somehow this component interferes with metadata from my Vorbis stream. With the component, I get no artist/title metadata (but oddly a couple other fields like DISCNUMBER). Without it, everything works as expected.

I'm not too surprised, it is a side effect of the implementation of a custom metadb_display_field_provider that is the cause of this. It processes a few standard fields for display.
I suspect you have one also, and the two interfere.

When the item is not managed by my plugin, my custom metadb_display_field_provider class just call titleformat_hook_impl_file_info::process_field() (see code below) .
Instead it should let foobar call other providers but I don't know if it is possible (returning false in process_field() will just leave the fields unprocessed...).

Btw 0.81 released (first post) now able to play all audio formats smile.gif.

CODE
bool process_field(t_uint32 index, metadb_handle * handle, titleformat_text_out * out) {

        string8 field;
        get_field_name(index, field);

        const file_info *finfo = NULL;

        if(handle->get_info_async_locked(finfo)) {
            const char *codec = finfo->info_get("codec");
            if(codec && strcmp(codec, "PCM") == 0) {
                browser_window::get_instance()->get_file_info(handle, finfo);
            }
        } else {
            browser_window::get_instance()->get_file_info(handle, finfo);
        }

        if(finfo) {
            bool flag;
            titleformat_hook_impl_file_info hook(handle->get_location(), finfo);
            hook.process_field(out, field, field.get_length(), flag);
        }
        return true;
    }


This post has been edited by bubbleguuum: Feb 21 2009, 01:10
Go to the top of the page
+Quote Post
Peter
post Feb 21 2009, 02:08
Post #13


foobar2000 developer


Group: Admin
Posts: 3313
Joined: 30-September 01
Member No.: 84



bubbleguuum, your metadb_display_field_provider use is critically flawed and probably breaks all mid-stream metadata processing for streams that your component isn't handling, please remove it or your component will be put on the list of problematic components. You're falling back to static track information cached in the metadb, which doesn't contain realtime playback information. If you try to hackfix this, you start feeding playback information to callers that don't want it, which is just as bad.

Rant: no matter how clearly documented the API is, people will just happily ignore what the documentation says anyway and then waste other people's time with "component A can't coexist with component B" problems.
Go to the top of the page
+Quote Post
bubbleguuum
post Feb 21 2009, 02:23
Post #14





Group: Developer
Posts: 1112
Joined: 13-November 05
Member No.: 25748



QUOTE (Peter @ Feb 21 2009, 02:08) *
bubbleguuum, your metadb_display_field_provider use is critically flawed and probably breaks all mid-stream metadata processing for streams that your component isn't handling, please remove it or your component will be put on the list of problematic components. You're falling back to static track information cached in the metadb, which doesn't contain realtime playback information. If you try to hackfix this, you start feeding playback information to callers that don't want it, which is just as bad.

Rant: no matter how clearly documented the API is, people will just happily ignore what the documentation says anyway and then waste other people's time with "component A can't coexist with component B" problems.


I had the feeling this was broken when I coded it to be honest. I posted a message about it in the development forum a few days ago that went unanswered.
I may be wrong but it looks like file_info cannot be written without being written to disk. In that case how should I proceed if metadb_display_field_provider is innapropriate? Oh yes I could present empty items in the playlist and info will be displayed when played, right ?

Rant: no matter how you ask for help in the development forum on some finer point of the SDK, sometimes you get no anwser. And the documentation does not explain all, far from it.

This post has been edited by bubbleguuum: Feb 21 2009, 02:24
Go to the top of the page
+Quote Post
Peter
post Feb 21 2009, 02:43
Post #15


foobar2000 developer


Group: Admin
Posts: 3313
Joined: 30-September 01
Member No.: 84



The exact thing you asked for is inherently incompatible with the 0.9.x metadb design. If there was a simple answer to your question, you'd probably have gotten one.
Can't you simply accept the fact that the foobar2000 architecture was not designed with your exact scenario in mind and stop trying to hack around the limitations?

I can think of one reasonable solution to this situation - it might seem ugly but it avoids all the landmines:
- Don't pass http:// URLs to foobar2000 - obscure them somehow to generate URLs that existing inputs won't attempt to play - eg. upnpstream://<base64-encoded-original-url-string>
- Implement your own input class that plays your streams and invokes other inputs to do the decoding; you have full power over returned metadata so you can return whatever you want and it stays in the metadb. If your metadata changes in mid-stream, use get_dynamic_info() / get_dynamic_info_track() to signal such changes; components displaying real-time playback information will render that information.
- Since the real HTTP URL is obscured, you might want to return it in tech infos or something like that for people who care.
Go to the top of the page
+Quote Post
bubbleguuum
post Feb 21 2009, 02:56
Post #16





Group: Developer
Posts: 1112
Joined: 13-November 05
Member No.: 25748



QUOTE (Peter @ Feb 21 2009, 02:43) *
The exact thing you asked for is inherently incompatible with the 0.9.x metadb design. If there was a simple answer to your question, you'd probably have gotten one.
Can't you simply accept the fact that the foobar2000 architecture was not designed with your exact scenario in mind and stop trying to hack around the limitations?

I can think of one reasonable solution to this situation - it might seem ugly but it avoids all the landmines:
- Don't pass http:// URLs to foobar2000 - obscure them somehow to generate URLs that existing inputs won't attempt to play - eg. upnpstream://<base64-encoded-original-url-string>
- Implement your own input class that plays your streams and invokes other inputs to do the decoding; you have full power over returned metadata so you can return whatever you want and it stays in the metadb. If your metadata changes in mid-stream, use get_dynamic_info() / get_dynamic_info_track() to signal such changes; components displaying real-time playback information will render that information.
- Since the real HTTP URL is obscured, you might want to return it in tech infos or something like that for people who care.


Thanks for the info, I'll look into it. One last question: using a custom input class will I have control over the metadata (ie file_info) before the user plays anything (ie starts decoding) ?
Go to the top of the page
+Quote Post
Peter
post Feb 21 2009, 03:06
Post #17


foobar2000 developer


Group: Admin
Posts: 3313
Joined: 30-September 01
Member No.: 84



Yes, you can implement your own equivalent of tag reading and return any info you want, it will be kept by the metadb and shown in playlist even before the user plays your streams.
Note that you should add items to a playlist using playlist_incoming_item_filter_v2::process_locations_async() or alike, they will fetch metadata from your input class if necessary. Creating metadb_handles yourself and adding them directly may bypass that, so the metadata won't be seen until the stream is played for the first time.

This post has been edited by Peter: Feb 21 2009, 03:10
Reason for edit: Clarified how to properly add items to playlist.
Go to the top of the page
+Quote Post
TomBarlow
post Feb 21 2009, 11:14
Post #18





Group: Members
Posts: 585
Joined: 30-July 07
Member No.: 45750



Hmm this is probably related to the stuff discussed above that I don't understand, but this component seems to break square brackets across foobar- in playlists, the window title etc, e.g. [%tracknumber%] returns '?' instead of nothing as it should... huh.gif
Go to the top of the page
+Quote Post
--pv--
post Feb 21 2009, 21:20
Post #19





Group: Members
Posts: 128
Joined: 3-January 04
Member No.: 10920



I feel nausea is also doing this in his foo_lastfm_radio. At least he has also been asking how to add his own metadata into the files before playing.

Might there be a chance for native default user interface compatible version in the future?
Go to the top of the page
+Quote Post
bubbleguuum
post Feb 21 2009, 21:38
Post #20





Group: Developer
Posts: 1112
Joined: 13-November 05
Member No.: 25748



QUOTE (--pv-- @ Feb 21 2009, 21:20) *
I feel nausea is also doing this in his foo_lastfm_radio. At least he has also been asking how to add his own metadata into the files before playing.


I'm applying the method described by Peter and it works well, a rerelease of this plugin is not too far smile.gif.

QUOTE
Might there be a chance for native default user interface compatible version in the future?


When the UI Elements SDK will be available this will be possible.
Go to the top of the page
+Quote Post
bubbleguuum
post Feb 23 2009, 22:40
Post #21





Group: Developer
Posts: 1112
Joined: 13-November 05
Member No.: 25748



v 0.9 (beta) (first post to download)

- fix:removed ugly metadb_display_field_provider hook causing all sorts of problems. Now remote items use the upnp:// protocol and persists across foobar sessions. Metadata retrieved at browse time is augmented with real decoder info at decode time. The same File Operations than the http filesystem are supported: you can copy remote items, however there's a small issue with it (see notes below)
these items will be playable as long as the remote server is running and the urls valid.
- fix: now able to browse and play music from any UPnP media server. Tested with WMP, Nero Media Home.
- fix: don't crash if no resource in a music item
- add: tree browser now configurable for right and left click action on node. Actions are: send to current playlist, add to current playlist, send to new playlist, send to UPnP browser playlist, show context menu. Use right click somewhere not on the tree to configure this behaviour.

Notes:

- WMP takes a long time to show up in the server list, ususally it appears within a few mins
- Nero media home does not appear in list if started after the plugin
- File operation->copy files works (with servers that supports http seeking), but copied files have no extension (had a solution for this but conflicts with something else)

This post has been edited by bubbleguuum: Feb 23 2009, 22:41
Go to the top of the page
+Quote Post
Canar
post Feb 24 2009, 00:25
Post #22





Group: Super Moderator
Posts: 3373
Joined: 26-July 02
From: To:
Member No.: 2796



Thanks for the new version! It works better than the last version. There are still a few bugs to work out though.

  • Playlists do not appear to update without restarting.
  • I can't seem to be able to use it to stream modules at all. I'm using foo_dumb with cyberride by jester to test.
  • When I manually stop the server, it restarts when foobar2000 is restarted. There are a couple places where I want to use foo_upnp strictly as a client and not as a server.
  • Not a bug, but I'd prefer a proper Preferences dialog page to configure the context menu rather than the current "right-click-on-whitespace" method.


--------------------
You cannot ABX the rustling of jimmies.
No mouse? No problem.
Go to the top of the page
+Quote Post
bubbleguuum
post Feb 24 2009, 00:56
Post #23





Group: Developer
Posts: 1112
Joined: 13-November 05
Member No.: 25748



QUOTE (Canar @ Feb 24 2009, 00:25) *
Thanks for the new version! It works better than the last version. There are still a few bugs to work out though.

  • Playlists do not appear to update without restarting.
  • I can't seem to be able to use it to stream modules at all. I'm using foo_dumb with cyberride by jester to test.
  • When I manually stop the server, it restarts when foobar2000 is restarted. There are a couple places where I want to use foo_upnp strictly as a client and not as a server.
  • Not a bug, but I'd prefer a proper Preferences dialog page to configure the context menu rather than the current "right-click-on-whitespace" method.


1. Remote library changes notifications to the client are not implemented. The UPnP spec says something about that but it's quite complicated to implement and I'm
not sure that many servers implement it. I'll probably have a go at it just for completeness and the challenge smile.gif
In the current version, once a node is loaded it won't change its content.

2. This format do not define the technical info "samplerate" which the transcode to PCM needs. I can work around that but look for direct streaming of the original file format (FLAC, MOD , whatever) in the next version instead.

3. Works here, not suer what happened (can you reproduce it ?)

4. This will probably gets a conf page as there are more things to configure

Go to the top of the page
+Quote Post
Canar
post Feb 24 2009, 01:02
Post #24





Group: Super Moderator
Posts: 3373
Joined: 26-July 02
From: To:
Member No.: 2796



Yep. Easily reproduced. I click the "Stop Server" button, it says the server is stopped. I close foobar2000. I re-open foobar2000. The server is running again.

This post has been edited by Canar: Feb 24 2009, 01:02


--------------------
You cannot ABX the rustling of jimmies.
No mouse? No problem.
Go to the top of the page
+Quote Post
bubbleguuum
post Feb 24 2009, 01:14
Post #25





Group: Developer
Posts: 1112
Joined: 13-November 05
Member No.: 25748



QUOTE (Canar @ Feb 24 2009, 01:02) *
Yep. Easily reproduced. I click the "Stop Server" button, it says the server is stopped. I close foobar2000. I re-open foobar2000. The server is running again.


No problem here. Did you remove foo_upnp_mediaserver.dll ?
Go to the top of the page
+Quote Post

79 Pages V   1 2 3 > » 
Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 19th December 2014 - 12:02