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: New component: foo_upnp_mediaserver (Read 46049 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

New component: foo_upnp_mediaserver

This component will stream the files in your Media libray and playlists to other UPnP and DLNA clients (aka renderers), mainly dedicated hardware (list). File are presented in a tree structure.

The component can stream any local files foobar can play. MP3, AAC, WMA are streamed as is and decoded by the client, while all other files (FLAC, etc) are streamed as WAV. It will also stream album art.

I did my test using exclusively software clients, mostly XMBC and cidero. I'd be happy if someone could test on hardware clients especially on the PS3 and Xbox 360 to know if it works . The PS3 is known not to be very compliant with the standard. Under Windows Vista, Windows Media Player is supposed to be able to play UPnP content but as I'm on XP I couldn't test either.

For the clients to see the foobar server you need to configure your firewall to allow multicast udp packets on port 1900 (SSDP).

Download plugin (v0.7)
Screenshot of a foobar playlist under XMBC


Code: [Select]

v 0.7 (beta)

- added option to stream non standard format (ie not MP3, WMA, AAC) as LPCM as well as WAV. It's also possible to stream standard formats as LPCM or WAV
- added option to resample audio to a list of authorized sample rates. useful for the PS3 which supports only 44.1Khz and 48Khz
- streamed audio on the PS3 no longer cuts randomly in the middle of a track
- added button in conf to aumattically set best options for the PS3.

v 0.6

- Compatibility mode for the xbox 360 (untested).
- WMP11 UPnP client (Vista & Windows 7 only) should now be able to see and play audio from the server. Tested only under Windows 7.
- Most streams playable by foobar should now be streamable to UPnP clients.
- Added an option to pass HTTP stream URLs to clients so they direclty decode it (instead of the server acting like a proxy)
- Streamed tracks should no longer stop streaming before the end
- Tracks in cue sheets now work (and all formats using the subsong index). Tested with FLAC with embedded cue sheet
- Support for lossless format other that 44.1Khz/16bits. Tested with a 88.2/24 bit flac.
- Option to convert 24/32 bits lossless audio to 16 bits with optional dithering.
- Generated HTTP URLs are now persistent accross server restarts (as long as the files are not moved/deleted). Useful for clients that caches this information.
- Client playing a non-existent or problematic file should no longer crash foobar
- Ability to configure the HTTP port used for streaming (default is port 56923)
- Modifying options in the preference dialog restarts the server if necessary
- Stability fixes

v0.5

- clients are now exposed to the Media Library in a tree structure similar to the default config of the Album List component
- preference panel under Tools/UPnP Server. Can configure server name, start/stop server, expose playlists, expose Media Library, stream album art.
-some modifications which may make it work with more UPnP/DLNA clients.
- some initial support for streaming HTTP streams to clients

v0.1

- initial version


TODO:

- Expose the Media Library pretty much as the Album List (done in 0.5)
- A configuration option panel (done in 0.5)
- Let the ML tree nodes be configurable like the Album List component
- ability to stream non-local items (done in 0.6)
- apply replaygain and eventually DSPs to streamed content


BUGS:

- playing cue sheet tracks play the whole file (fixed in 0.6)

New component: foo_upnp_mediaserver

Reply #1
This component will present the files in your playlists and stream them to other UPnP clients (aka renderers), mainly dedicated hardware (list), including the XBOX360 and the PS3.


Brilliant one! Gonna test it on the PS3 as soon as possible. Thanks.

New component: foo_upnp_mediaserver

Reply #2
Thanks, will try this on Popcorn Hour.

New component: foo_upnp_mediaserver

Reply #3
I was hoping someone would make a DLNA server component  . Unfortunately I'm getting

Quote
Media Server Error:
A DLNA protocol error (-1) has occurred.


with the PS3 . The server does appear and shows the model and the manufacturer correctly, but no tracks are listed.

New component: foo_upnp_mediaserver

Reply #4
It works for me on the Popcorn Hour with XP SP3 on the other end.
I get an additional menu entry FOOBAR2000 MEDIA SERVER (Administrator) which on activating presents me with all my play lists.
The items can then be played, except those which are last.fm items (is on the todo-list yay).

So far, playback is very basic, no metadata is passed on, no album art is displayed - not sure if that is an issue with the PCH.
The PCH gives the duration and the (erroneous) file name:
content%3Fpath=11.WAV

In any case, a very useful component and I look forward to further releases. Thank you!

New component: foo_upnp_mediaserver

Reply #5
with the PS3 . The server does appear and shows the model and the manufacturer correctly, but no tracks are listed.


I use the same UPnP framework than XMBC and apparently they've got guys having the PS3 streaming from XMBC so there is hope .

It works for me on the Popcorn Hour with XP SP3 on the other end.
I get an additional menu entry FOOBAR2000 MEDIA SERVER (Administrator) which on activating presents me with all my play lists.
The items can then be played, except those which are last.fm items (is on the todo-list yay).

So far, playback is very basic, no metadata is passed on, no album art is displayed - not sure if that is an issue with the PCH.
The PCH gives the duration and the (erroneous) file name:
content%3Fpath=11.WAV

In any case, a very useful component and I look forward to further releases. Thank you!


For some reason this hardware displays the streaming URL (!!!). Obviously it shouldn't. Maybe it's a fallback when it can't parse metadata. Could you get the Intel tools for UPnP, launch their AVMedia Server, share a few files with it and tell me if it works fine with your unit ? If that's the case it will help to tell what's wrong.

New component: foo_upnp_mediaserver

Reply #6
[...]launch their AVMedia Server, share a few files with it and tell me if it works fine with your unit ? If that's the case it will help to tell what's wrong.


It works after a fashion. If the files are tagged as ID3v2, I get incorrect information. If they are tagged as ID3v1 the artist and title are shown correctly, but spaces and special characters are replaced with HTML entities (%20 for space).

New component: foo_upnp_mediaserver

Reply #7
So far I don't see an entry for the UPNP server in any of the usual places on my Xbox 360.  I allowed foobar2000 through the built-in Windows firewall but I don't have any other UPNP-capable devices with which to make sure the server is functioning properly.  What should I expect to see on the 360 if everything's working?

New component: foo_upnp_mediaserver

Reply #8
Oh my goodness... this is an intriguing development... I'll give it a test at some point!

New component: foo_upnp_mediaserver

Reply #9
@bubbleguuum:
How does your plugin stream the content? Uncompressed PCM or unaltered source-file? Is it possible to stream a multichannel audio content to a UPnP rendered capable AVreceiver for example? Would it be possible to stream even a video media to a UPnP capable TV or UPnP set-top-box - provided it would be in the media library or playlist?


New component: foo_upnp_mediaserver

Reply #11
@bubbleguuum:
How does your plugin stream the content? Uncompressed PCM or unaltered source-file? Is it possible to stream a multichannel audio content to a UPnP rendered capable AVreceiver for example?
[/ur]


It is explained in the first post: MP3, AAC and WMA are streamed without decompression to the UPnP clients responsible of decoding them. All other formats and streams are streamed as uncompressed PCM (as a WAV). It would be theorically possible to stream multichannel audio that way I think.

Quote
Would it be possible to stream even a video media to a UPnP capable TV or UPnP set-top-box - provided it would be in the media library or playlist?


Foobar2000 handle and decode only audio, so no it is not possible. Well maybe it could if you put some AVI or known UPnP AV known video types in a playlist but that's really not the focus of this plugin.

@InspectorGagdget:

If the server is visible you should see somewhere in XBOX interface an entry reading "Foobar2000 media server (<you windows user name>)". I'm not surprised it does not work though, as both the X360 and the PS3 are known quircky with the UPnP spec. The fact that I have neither of those does not help. If any (serious) developer is interested to make it work with either the PS3 or the X360 I can send the source code.

New component: foo_upnp_mediaserver

Reply #12
New version 0.5 (first post to download)

- clients can now see the Media Library in a tree structure similar to the default config of the Album List component
- preference panel under Tools/UPnP Server. Can configure server name, start/stop server, expose playlists, expose Media Library, stream album art.
- some modifications which may make it work with more UPnP clients.
- some initial support for streaming HTTP streams to clients

I've made some subtle changes in the protocol which may or not make it work better with the PS3. Someone tries and tell me but do not have too much expectations, as it is just guess work comparing what Nero Media Home does

New component: foo_upnp_mediaserver

Reply #13
This does work with the PS3, thank you so much  .

There is however a problem with CD images with embedded cue sheets, the whole image is streamed instead of the chosen song. Foobar also requires a restart for the playlists to update, I'm not sure if this is intended.

Lastly, would it be possible to customize the tree structure in the same way the Album List component lets you, and specify the album art path (as foobar isn't configurable yet).

New component: foo_upnp_mediaserver

Reply #14
This does work with the PS3, thank you so much  .


Very happy to hear this!

Quote
There is however a problem with CD images with embedded cue sheets, the whole image is streamed instead of the chosen song. Foobar also requires a restart for the playlists to update, I'm not sure if this is intended.

Never tested with cue sheets so I'm not too surprised they need some custom handling.
Playlists and Media Library are not updated in the clients until the server is restarted. The UPnP AV protocol allows for server to notify change of content to clients but it's so convoluted and complicated that I'll evaluate if I'll do it or not.

Quote
Lastly, would it be possible to customize the tree structure in the same way the Album List component lets you, and specify the album art path (as foobar isn't configurable yet).


Yup, it's in the todo list.

New component: foo_upnp_mediaserver

Reply #15
I was playing around with this a little more and there are a few problems.

With mp3 files, the codec shows the wrong bitrate, for example "MP3 1600 kbps" for a 200 kbps file, and there is an error about a minute into playing (80710091, there's no info on this code though  ).

For other files, the length is shown correctly in the file info, but it's truncated when playing, an 8 minute file will only play for 4 minutes or so. The codec on these also seems to be a little off, "Linear PCM 74 Bit 2 Ch." for what I assume is a 16 bit file.

New component: foo_upnp_mediaserver

Reply #16
No go for me. The component freezes foobar2000 immediately on startup. When it's removed, foobar2000 works normally.

foobar 0.9.6.2b3

New component: foo_upnp_mediaserver

Reply #17
My Xbox 360 can't see the server no matter what the settings seem to be. It appears in the "Network" panel in Windows 7, but WMP can't access the library presenting the error "Failed to connect to the remote library.". I have tried other uPnP media servers on here with the current setup, and they have worked correctly, but take forever to scan my library each time the server is started. Foobar seems to be the most efficient player for library management and it'd be great tohave this working.

As another request... making this run as a service would be quite handy, yet still have it rely on the Foobar library and decding facilities when required. Not essential, but possibly something to look into if you get bored one afternoon.

New component: foo_upnp_mediaserver

Reply #18
I was playing around with this a little more and there are a few problems.

With mp3 files, the codec shows the wrong bitrate, for example "MP3 1600 kbps" for a 200 kbps file, and there is an error about a minute into playing (80710091, there's no info on this code though  ).

For other files, the length is shown correctly in the file info, but it's truncated when playing, an 8 minute file will only play for 4 minutes or so. The codec on these also seems to be a little off, "Linear PCM 74 Bit 2 Ch." for what I assume is a 16 bit file.


Thanks for your report. Is the bitrate correct with a MP3 CBR file ? Looks like you're not the only one having 80710091 errors. Some day in the far future, Sony will document its error codes .
About the file reported as "Linear PCM 74 Bit 2 Ch." can you tell me the exact properties displayed in foobar property panel?


No go for me. The component freezes foobar2000 immediately on startup. When it's removed, foobar2000 works normally.

foobar 0.9.6.2b3


Damn. When you mean it freezes I assume it does not crash. Does foobar2000 uses 100% CPU then ? Is foobar main window displayed at all ? Did you ever see a popup from the plugin asking you about enabling the server ?
I suppose it could be a network issue as on my PC, I've seen another UPnP controller program taking all CPU and never displaying its window.

My Xbox 360 can't see the server no matter what the settings seem to be. It appears in the "Network" panel in Windows 7, but WMP can't access the library presenting the error "Failed to connect to the remote library.". I have tried other uPnP media servers on here with the current setup, and they have worked correctly, but take forever to scan my library each time the server is started. Foobar seems to be the most efficient player for library management and it'd be great to have this working.

As another request... making this run as a service would be quite handy, yet still have it rely on the Foobar library and decding facilities when required. Not essential, but possibly something to look into if you get bored one afternoon.


Not sure about the X360, will have to investigate. Maybe it does not see the SSDP packets for some reason.
I'll test win WMP11 as soon as I have installed Windows 7 in a virtual machine as it could also be interesting to make the X360 work.

New component: foo_upnp_mediaserver

Reply #19
No go for me. The component freezes foobar2000 immediately on startup. When it's removed, foobar2000 works normally.

foobar 0.9.6.2b3


Damn. When you mean it freezes I assume it does not crash. Does foobar2000 uses 100% CPU then ? Is foobar main window displayed at all ? Did you ever see a popup from the plugin asking you about enabling the server ?


The foobar main window is displayed but I only get the hourglass when I move the mouse cursor above it. No popups.

New component: foo_upnp_mediaserver

Reply #20
Is there anything in particular that needs to be done to get album art to be streamed? All the covers are in the album folder named cover.jpg, everything else seems to be working very well. Thanks!
Streaming to my PS3 by the way.

A couple more things,

1. Would it be possible to submit playing information to last.fm for streamed music?
2. Would it be possible to allow foobar to view other foobar UPnP servers? I have foobar installed on my main PC downstairs and I have a laptop in my room, I'd love to be able to just browse and play music on my laptop without having to add my music folder as a network share. It would also remove the need to rescan the network drive if I re-install foobar on my laptop (I do a lot of messing with my laptop).

Thanks again for this component!

New component: foo_upnp_mediaserver

Reply #21
Hmm, very intesting.

I've tried this in the Sonos music player. It recognises the mediaserver and allows browsing of the tree, but returns an error when trying to add anything to the queue "Unable to add title to the queue". I've tested with mp3 and Flac. Also, there is only the option to add individual tracks, the option is greyed out at the tree node. However, the same problem occurs on the Asset server, so probably an issue with Sonos.

Still, a very interesting development. Thanks for your hard work.

New component: foo_upnp_mediaserver

Reply #22
My Xbox 360 can't see the server no matter what the settings seem to be. It appears in the "Network" panel in Windows 7, but WMP can't access the library presenting the error "Failed to connect to the remote library.". I have tried other uPnP media servers on here with the current setup, and they have worked correctly, but take forever to scan my library each time the server is started. Foobar seems to be the most efficient player for library management and it'd be great to have this working.

As another request... making this run as a service would be quite handy, yet still have it rely on the Foobar library and decding facilities when required. Not essential, but possibly something to look into if you get bored one afternoon.


Not sure about the X360, will have to investigate. Maybe it does not see the SSDP packets for some reason.
I'll test win WMP11 as soon as I have installed Windows 7 in a virtual machine as it could also be interesting to make the X360 work.


Thanks, no rush though, was just intrigued, and noticed no-one else had commented on the 360 compatability...

New component: foo_upnp_mediaserver

Reply #23
Tested version 0.5 with my PS3; seemed to work in general with a few of the quirks already mentioned.

Streaming FLACs as PCM, it did show up as mentioned before "Linear PCM 84 bit 2ch", and it was cutting them off during playback, too. It seemed to consistently cut off about 1/3 of the length. The playback itself is fine; there's a small pop when opening a track, but then it just cuts off after about 2/3 of the song.

I also tried some 24-bit, 96kHz FLACs that I have, and those didn't work at all.

Definitely looking promising!

New component: foo_upnp_mediaserver

Reply #24
Thanks, no rush though, was just intrigued, and noticed no-one else had commented on the 360 compatability...


No wonder it doesn't work on the 360. Basically MS implemented their own customization of the spec and some extra work
must be done to be compatible. I'll look into it as if it works with WMP11 it'll probably work with the 360