Author Topic: Streaming gapless, upsampled music and SACD/DSD using Foobar2000 (PC server)  (Read 7520 times)

Offline jer1956

  • Global Moder8or
  • M8er Addict
  • *****
  • Posts: 17 218
  • Helpful Contribution Status: +190/-53
I have previously posted on streaming gapless music to the DMR using WASAPI restreaming.

http://www.mede8erforum.com/index.php/topic,17266.0.html


The frustration for me was those solutions are limited to CD Quality i.e. 16 bit at 44.1 khz. Whilst finding those solutions i found foobar2000 could do it avoiding that limitation. It is also supports SACD/DSD playing. I decided it needs its own Tip.

So we can use that as an All in One solution. There is no need for  jamcast/swyh.

This tip got longer than i expected. Fear not, i have now posted a fully set up zipped portable folder in a later reply. If you don't want to know what was done to create it, go straight to that.

http://www.mede8erforum.com/index.php/topic,17286.msg110343.html#msg110343

So the starting point is download and install foobar.  The guide has helpful captures as attachments because those avoid embedded links vanishing.  So less neat, but they aren't going to  vanish if I use a cloud server and then shut it down.   There are some guides which  have suffered from that.

http://www.foobar2000.org/

If contemplating skinning foobar use the Portable Installation option, and install to a folder of your  choosing. See  Reply 3 Capture 9.  This means everything for an new skin is installed in one place, and if it doesn't work...just delete that  folder and install again. So its a good idea to zip the folder with its sacd/24 bit gapless plugins, before starting to  skin. Then just unzip a new version to  try another skin. 

Foobar2000 with its SACD plug in can play .dff files without having to pre convert to flac.
(in fact foobar is the tool normally used to  do  that  anyway!)

http://sourceforge.net/projects/sacddecoder/

Expand the zip, and select the plugin. foobar will open to install it. This won't happen with a Portable install. In that case use Foobar Preferences and install the module manually. This will be true for all subsequent modules. You don't need the asio proxy as we will be using a Virtual Hi Cable as the Playback Device. To preserve as much of the DSD information as we can,  we set up DSD2PCM to  its highest PCM frequency. At that  rate noise is pushed high up  the frequency range, and so  we can use a high filter. So  take the filter folder and put it where sacd was installed in appdata. See reply 1, Capture 17.  Then set SACD up to convert to PCM using a high fir filter. See Capture 16.

Install the Upnp plugin

http://www.foobar2000.org/components/view/foo_upnp

Gapless playback is achieved by the upnp plugin capturing  foobars own gapless player, making the resulting stream appear to be a file on it's upnp server. No crap mp3 here, 24 bit wav at 88.2khz. That setting gives 24 bit for sacd and studio quality flac, and 88.2  is compromise between normal 44.1 and the much higher sacd rates. It does mean CD rips are upsampled like Meridian CD players, though it dosn't mean this is as good as their 8000 player!

To have explicit control of setting 24 bit output we need the Wasapi Plug in.

http://www.foobar2000.org/components/view/foo_out_wasapi

That means we need foobar to have a sound device which  dosn't create sound on the host server.

http://vb-audio.pagesperso-orange.fr/Cable/

We need the Virtual hi -fi /asio cable at the bootom of that page. Once installed (needs a reboot), set up Windows Audio Playback to run the Hi-Cable at 24 bit, 88.2 khz, see first reply, Capture13. Then setup foobar to use the Virtual Hi-fi cable as the Playback device via Wasapi, see first reply, capture11.

To have explicit control of the up-sampling we need to use an up-sampling DSP. This is the one that  gets the best reviews.

https://hydrogenaud.io/index.php/topic,67373.0.html


We add Mod2 as an active Player DSP, and set it up to only up-sample 44.1 x 2 using Integer Interpolation.See first reply, Capture12.
We add a second Mod2 as an active Player DSP, and set it up to only down-sample the SACD 352800 / 4 using Integer Decimation. See second reply, Capture18.
Then add Mod as a third active DSP, and set it to re-sample everything else to 88200. See first reply, Capture 15.  This is for 48 khz / 96 khz music derived from DVD-Audio.




In upnp setup select New Profile, and create a new profile from the default data it's given. Change it to match Capture10.


I changed the Profile Capture data  to the rate set for the sox plugins, 88.2 khz. Becuase it is mapped to a file, UPNP requires a file size.  As the size is limited, then so  is duration based on the streaming bandwidth. This setup is 4.4 mbps, and so  we  only get 2hr 15 minutes before a reconnection is made, poducing a  drop out. You might want to  reconnect after each album, or run purely for gapless CD  at 16 /44.1. That will give you  6 hours instead. 

You may get dropouts before the allotted upnp time. One solution is set up Advanced options to stop drives from sleeping (Capture 3).


At this point zip the folder as a pre-skinning backup.
 
Because we are using foobar in its Player Capture Server mode, we must be able to control it's player  remotely. The best way is to use Windows Remote Desktop, as described later. If that is not possible there are some foobar plugins for this. I needed one which would work with my Win10 tablet, and found this.


http://foobar2000controller.blogspot.co.uk/2011/01/foobar2000-controller.html

Once installed it adds a Webgui to foobar which can be accessed remotely using a browser (Capture 1).


So the sequence is
1) Start foobar2000 on the server PC
2) Use the X3D Media Library/Upnp, and select  foobar server/stream capture
3) Acess the webgui remotely to decide what music to play, and start playing.

If you miss visualization, add it using miracast

http://www.mede8erforum.com/index.php/topic,17314.0.html

Using foobar as a upnp server

Foobar can  also  be used as a upnp server, but with the addition of decoding to wav. This isn't gapless, but it's an easy way of avoiding codec issues.  The user agent (capture10) has been set up  to only send flac as an untouched file. All other extensions are decoded to  wave.  So if you search  the codec folder offered by the server....it could have an m4a folder with unplayable alac tracks (not from itunes!) in it, because you have specified the m4a folder as part of the library, but they are sent as playable wave. No need to have two version of the source file.

To play  albums in track order you must change the upnp servers naming setup  to  add track number. See capture5.
« Last Edit: February 11, 2016, 08:57:21 am by jer1956 »

Offline jer1956

  • Global Moder8or
  • M8er Addict
  • *****
  • Posts: 17 218
  • Helpful Contribution Status: +190/-53
I said there are many remote access plugin you can use.  Even  the webgui uses templates. The one shown above is the default.  But others have been created. You can install an ios template (on the foobar server, not the phone). Other devices will get trapped out. But if you do install it, this is what IOS devices get:-

http://www.anamon.eu/index.php?cat=c5_foobar-iPhone-remotes.html


The foobar guys themselves are not big on eyecandy. so using it as a server remotely is the only way  to  get it. (Though it can be skinned http://tedgo.deviantart.com/art/DarkOne-v4-360862076)

There is also a TouchRemote plugin. Clients  have this:-

http://touchremote.eu/

(The PC software is only their remote software for the server PC). 

This works with the same touchremote plug in.

http://wp8remote.com/




Android has lots of apps. Search  for "foo_httpcontrol"



Images below are for primary post.
« Last Edit: January 31, 2016, 03:47:35 pm by jer1956 »

Offline jer1956

  • Global Moder8or
  • M8er Addict
  • *****
  • Posts: 17 218
  • Helpful Contribution Status: +190/-53
Modification.  Added use of Virtual Hi Fi cable as foobars Playback device rather than Null.

Images below are for primary post.
« Last Edit: February 02, 2016, 03:20:05 pm by jer1956 »

Offline jer1956

  • Global Moder8or
  • M8er Addict
  • *****
  • Posts: 17 218
  • Helpful Contribution Status: +190/-53
Listening Tests
I have a few (old) albums in both vinyl and cd, the latter ripped to lossless flac.

In the past the x3d playing the rips was nothing like the vinyl. The bass was sadly lacking on the x3d. The bass is back  using foobar, be it cd rate, or upsampled. Foobar sounds more like the vinyl than the x3d doing the decoding. 


I know there are lots of opinion on oversampling. I'm a big Meridian fan, but can no longer afford their kit. So their explanations are those i respect most. For them its an engineering issue.  Converting to analogue creates mush, which must be filtered off with an analogue filter. That mush will be at the top frequency sent to the dac, and so the filter needed has to alter audible frequencies if the top rate is 44.1khz. Now double the range and the mush is up at 88.2 khz, and a slow innocuous filter can take it off starting at 60 khz, well away from the 44.1. So this isn't about adding something which isn't there, as doubters keep claiming, its about preventing the necessary engineering solutions damaging what is there.

So foobar expands flac, upsamples, and sends it out as wave. The x3d has no need of a bass filtered codec to convert to pcm. The amp gets the pcm, converts to analogue, and applies its own analogue filter for 88.2 khz pcm conversion.

Since changing to the foobar SOX dsp i hear clear improvements. The treble tinkles without the usual digital edginess. The bass improvement is still there. Its now more like vinyl than without SOX.

....and its gapless. I forgot that was my own reason for looking at foobar in the first place!
« Last Edit: January 30, 2016, 08:24:41 pm by jer1956 »

Offline jer1956

  • Global Moder8or
  • M8er Addict
  • *****
  • Posts: 17 218
  • Helpful Contribution Status: +190/-53
Added additional plugins to  give explicit control of forcing 24bit / 88.2 khz from foobars player. Otherwise the upnp plugin does it using undeclared code.  Users can  experiment with upsampling DSP's.   

The Virtual wi-fi cable is no longer locked on 24 bit /88.2. It can  be changed using exclusive mode.  So i proved the sox re-sampler was working by experimenting with specific rates, and used the Virtual hi-fi monitoring tool to see that it was changing to match, see Capture14.  Once satisified it was working, I left Sox on 44.1 x 2.
« Last Edit: February 02, 2016, 03:33:36 pm by jer1956 »

Offline jer1956

  • Global Moder8or
  • M8er Addict
  • *****
  • Posts: 17 218
  • Helpful Contribution Status: +190/-53
Modification
Changed SACD to preserve as much DSD data as possible.  It is then  down sampled by the second SOX DSP.
« Last Edit: February 02, 2016, 03:55:09 pm by jer1956 »

Offline jer1956

  • Global Moder8or
  • M8er Addict
  • *****
  • Posts: 17 218
  • Helpful Contribution Status: +190/-53
Skinning to use Coverflow album selection, and control via Remote Desktop.

As described in the updated first post, you  should now have a virgin install of foobar in a single folder. Download the skin from deviantart.  You can try others, they can be complex and require lots of plugins. They also often  don't work....

http://chronic-win7-mods.deviantart.com/art/CoverAttack-Columns-UI-Config-176368486

Un rar the download file. Then open both its folder and foobars. See reply 3 capture 10.

Cut/past the first two  folders to the foobar folder. Open the font folder, and cut past the font into  windows/fonts i.e. the actual operating system folder.

Now create a desktop shortcut for foobar, and run it. You will be asked if you want Columns, Default. Chose Columns, as in reply 3 Capture 11.

You will get a typical bland foobar  display, but with columns.  Now open preferences, and go to  the Columns setup  section. Select Import fcl, and open the foobar folder with the fcl in. See Replay 3 Capture 12. When  you Apply, you will get the new skin, with black  covers. The reason is the Portable Install tells the operating system nothing, and asks for nothing from it. That includes Library folders. So open Library/Setup  and add you music store. See reply 4 Capture 13.  Then  exit and restart.  It should then look more like capture 8 below, but only if you have cover images called folder.jpg, which  you  will have if you have set up  for Music Jukebox.

All this is very nice....but we are using foobar on a server.   So to see it, and use it, we exploit Remote Desktop Access.  Search  for Remote Access, and set the control panel that opens to match Reply 5,capture 15.

When we access remotely we will  end with a lot of wasted space caused by two sets of bottom toolbars, one from the server desktop, and the other on the client.  So autohide both of them. Remote Desktop will also re-arrange the Desktop Icons. So pin foobar to the Taskbar, and disable View/ desktop icons before leaving the PC.   

Now on the client tablet/pc install this from store:-

https://www.microsoft.com/en-US/store/apps/Remote-Desktop/9WZDNCRFJ3PS

Even ipads can do it:-

https://itunes.apple.com/gb/app/microsoft-remote-desktop/id714464092?mt=8

And android:-

https://play.google.com/store/apps/details?id=com.microsoft.rdc.android



Set it up to play audio on the remote pc as we need it to go the wasapi device, not to the client. 


So the sequence is
1) Start foobar2000 on the server PC using Remote Desktop
2) Use the X3D Media Library/Upnp, and select  foobar server/stream capture
3) Use Remote Desktop to decide what music to play, and start playing.

« Last Edit: February 03, 2016, 10:15:46 am by jer1956 »

Offline jer1956

  • Global Moder8or
  • M8er Addict
  • *****
  • Posts: 17 218
  • Helpful Contribution Status: +190/-53
Having changed to Foobar portable..there is no installer.  It is just a folder.  So I have taken  advantage of that  and zipped my fully upgraded foobar folder for  download. So it has the coverflow skin, sacd and 24 bit gapless upnp  streaming.

https://www.dropbox.com/s/ujr8ym54nuf3fc7/foobar.zip?dl=0

I have changed the skin more to the needs of Remote Desktop on a Tablet. See Capture17. I don't have track  jpgs, so  the extra album cover was waste of space. 

(I will add a pre skin download as well, for those who want to chose their  own skin

https://www.dropbox.com/s/a0xi69sq4n9l28r/foobarPreskin.zip?dl=0
)

Before running the main app in the unzipped folder, you still need to install the Virtual Hi-Fi cable.

http://vb-audio.pagesperso-orange.fr/Cable/

(see first reply Capture 13 and capture 11)

....and you must copy the font from the foobar folder.

You have to add your music store, see Reply 4, capture 13.  Coverflow needs folder.jpg's in each folder.


So the sequence is
1) Start foobar2000 on the server PC using Remote Desktop
2) Use the X3D Media Library/Upnp, and select  foobar server/stream capture
3) Use Remote Desktop to decide what music to play, and start playing.

« Last Edit: February 03, 2016, 09:59:22 pm by jer1956 »

Offline jer1956

  • Global Moder8or
  • M8er Addict
  • *****
  • Posts: 17 218
  • Helpful Contribution Status: +190/-53
For those with no media to justify 24/ 88.2 khz, here is a version which dosn't upsample. It's CD Qaulity 16 /44.1 khz, and won't reconnect for 6 hrs 45 mins. So  thats 6 hrs 45 mins of gapless music, bypassing the bass filtering codecs of the player.

https://www.dropbox.com/s/mup5nvo1wxyd4po/foobar16bit.zip?dl=0

SACD is still converted at 352.8 khz, but now downsampled to 16 / 44.1 khz, not 24 / 88.2 khz.
« Last Edit: February 04, 2016, 11:46:09 am by jer1956 »

Offline jer1956

  • Global Moder8or
  • M8er Addict
  • *****
  • Posts: 17 218
  • Helpful Contribution Status: +190/-53
I found the first skin has fiddly little buttons that  are difficult to use via Remote Desktop on a touchscreen.

So I have changed to  this:-

http://con-sin.deviantart.com/art/fooSound-267168044

It's uploaded here


https://www.dropbox.com/s/vyxce9tbh0ywom1/foosound.zip?dl=0

Offline jer1956

  • Global Moder8or
  • M8er Addict
  • *****
  • Posts: 17 218
  • Helpful Contribution Status: +190/-53
Found a new foobar dmr output plugin dated July 2016. This simplifies the process. We can now push 24 bit gapless at the player, not suck it in via upnp. Will post details soon.

Pending details...this is a link to my zipped foobar folder.

https://www.dropbox.com/s/je4vhrcl92gszr7/foobarDMR.zip?dl=0

This is up sampling 44.1 to 88.2, and 48 to 96. SACD is converted to 24/174 PCM. All streaming is done using 24 bit wave. Because the player is gapless there are no dmr reconnects at track boundaries.
« Last Edit: January 11, 2017, 05:58:39 pm by jer1956 »

Offline jer1956

  • Global Moder8or
  • M8er Addict
  • *****
  • Posts: 17 218
  • Helpful Contribution Status: +190/-53
Have reviewed foobar skins whilst focussed on setting up DMR. What about about this brand spanking new skin?

http://www.deviantart.com/art/Pandora-Box-EX-1-04-6Jan17-Foobar2000-config-651037589

Nice, but the skin which works uses elplaylist to make Touch input work. The nice skin needs a mouse.
« Last Edit: January 11, 2017, 01:15:29 pm by jer1956 »