Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: foo_upnp (Read 1622821 times) previous topic - next topic
0 Members and 5 Guests are viewing this topic.

foo_upnp

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.

foo_upnp

Reply #1
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?

foo_upnp

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

Code: [Select]
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"

foo_upnp

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

Code: [Select]
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.

foo_upnp

Reply #4
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.

foo_upnp

Reply #5
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.

foo_upnp

Reply #6
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.

foo_upnp

Reply #7
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.

foo_upnp

Reply #8
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

foo_upnp

Reply #9
I eagerly await the bug-fix release.

foo_upnp

Reply #10
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.

foo_upnp

Reply #11
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 .

Code: [Select]
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;
    }

foo_upnp

Reply #12
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.
Microsoft Windows: We can't script here, this is bat country.

foo_upnp

Reply #13
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.

foo_upnp

Reply #14
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.
Microsoft Windows: We can't script here, this is bat country.

foo_upnp

Reply #15
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) ?

foo_upnp

Reply #16
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.
Microsoft Windows: We can't script here, this is bat country.

 

foo_upnp

Reply #17
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...

foo_upnp

Reply #18
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?

foo_upnp

Reply #19
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 .

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.

foo_upnp

Reply #20
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)

foo_upnp

Reply #21
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.

foo_upnp

Reply #22
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
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


foo_upnp

Reply #23
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.

foo_upnp

Reply #24
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 ?