Home of the Squeezebox™ & Transporter® network music players.
Results 1 to 10 of 20

Hybrid View

  1. #1
    Junior Member
    Join Date
    Sep 2012
    Posts
    11

    Announce: Airplay on squeezebox (for Windows)

    Hi,

    I was looking for a way to stream airplay to my Squeezebox without any manipulation on the squeezebox.
    I have modified shairport4W in very simple and flexible way: it runs a script on play and another script on airplay disconnection.
    Furthermore I made these 2 scripts to be compatible with the WaveInput plugin or VLC. It works great with a delay of about 8 seconds.
    The implementation of this functionality is not hard (easiest than squairplay)


    A little demo here :




    Requirements:




    configuration:
    • Extract the archive, then before running Shairport4w for the first time, go to the "tools" folder, there is 2 scripts : "play.bat" and "stop.bat".
      Edit it with notepad and configure these 3 values :

      • MyStreamer you can choose between VLC or WaveInput. I recommend WaveInput, it is harder to configure but it is more stable and the sound quality is great.
      • VLC_Path specify if only if MyStreamer = VLC.
        Generally for Windows 32 bits "C:\Program Files (x86)\VideoLAN\VLC\vlc.exe", for Windows 64 bits : "C:\Program Files (x86)\VideoLAN\VLC\vlc.exe"
      • MySqueezeBoxMac if you have several squeezebox and you want to use airplay on only one specify the mac adress. (if you don't specify any value it will affect the current selected squeezebox).
        Mac adress of your squeezebox can be found directly on the Squeezebox in menu -> settings -> advanced -> information about Squeezebox -> Squeezebox information -> MAC.

    • if you use VLC, by default the Squeezebox server recognize the VLC stream (which has no header) like an ASF format, but it is MP3, so you have to modify the file types.conf :
      C:\Program Files\Squeezebox\server\types.conf
      The VLC stream is identified like "application/octet-stream" so remove it from the ASF line and put it in MP3 line :
      Before modification :
      Code:
      mp3 mp2,mp3 audio/mpeg,audio/mp3,audio/mp3s,audio/x-mpeg,audio/mpeg3,audio/mpg audio wma wma audio/x-ms-wma,application/vnd.ms.wms-hdr.asfv1,application/octet-stream,application/x-mms-framed,audio/asf audio
      After modification :
      Code:
      mp3 mp2,mp3 audio/mpeg,audio/mp3,audio/mp3s,audio/x-mpeg,audio/mpeg3,audio/mpg,application/octet-stream audio wma wma audio/x-ms-wma,application/vnd.ms.wms-hdr.asfv1,application/x-mms-framed,audio/asf audio
    • If you use the WaveInput plugin, by default it encodes the output in flac, this is very long so you have to change it in your navigator: squeezebox server settings -> "advanced" tab -> select "file types" in the dropbox -> Wave Input FLAC -> desactivated
      By default I have an enorme delay of 27 seconds, without flac reencoding I reduce it to 6 seconds (with a tiny intel atom processor).




    How does it works ?
    • Shairport4W supports airplay, it allow to play your iphone/ipad/itunes sounds on your Windows PC.
    • When an airplay connexion arrive on this modified version of Shairport4W it runs the script "play.bat".
    • This script do 2 different things :
      - if you have chosen VLC as "MyStreamer" : it starts VLC in Http Diffusion streaming for direct show (you will hear the current selected recorder in Windows sound Configuration). Then it uses NC.exe (a tool called netcat) to run a telnet command line which launch playback with good parameters to the squeezebox. (Thanks to Nico and gharris999 for the idea).
      - If you have chosen WaveInput plugin it uses NC.exe only to launch playback with good parameters to the squeezebox.
    • When the airplay connexion is ending Shairport4W runs "stop.bat" which stops VLC and switch off the squeezebox.




    How can it be improved ?
    I have chosen to run scripts because it is fully customizable. You can add your own command line and change the default behavior.
    • For example you can edit the VLC command line to change the format of the streaming diffusion. I have tested successfully 3 different formats (don't forget to modify "types.conf" each time) :
      - mp3 CPU utilization (25%) / Good sound quality / 2 to 6 seconds of delay
      - ogg CPU utilization (50%) / very good sound quality / 8 to 10 seconds of delay
      - flac CPU utilization very low (2%) / Good sound quality / more than 10 seconds of delay
    • if you are a great developer you can make really better : you can mix wavin2cmd, squairplay, dsbridge and shairport, there is so much to do! :
      - add an option to shairport4W to create directly a HTTP audio stream. By the way this is a requested feature of Shairport4W and the code to do that already exists in dsbridge.
      - add metadata in the stream to displays current playing title and cover on Squeezebox
      - and many more ...






    I hope you will like it.
    Bye !

    Schmurtz.
    Last edited by schmurtz; 2013-10-18 at 16:25. Reason: video demo added

  2. #2
    Junior Member
    Join Date
    Sep 2012
    Posts
    11
    Hi,

    I've updated my shairport4w modification with the last version of shairport4w source code :

    Shairport4w.exe Version 1.0.7.3
    - fixed Issue #21 (reloaded)
    - wasn't hundred percent developed with the previous version

    Shairport4w.exe Version 1.0.7.2
    - fixed Issue #21 (App crashes when connected device which have non-latin name)
    - Airport Name now works with Unicode characters
    Download it here.

  3. #3
    Junior Member
    Join Date
    Oct 2011
    Posts
    12

    No sound, Windows 8, LMS 7.8.0

    Hi
    thanks for your great modification of Shairport.
    1. Everything went just fine on my PC at work (LMS 7.3, Windows 8.1, Squeezeplay).

    2. now I'm trying to impelemet your solution on my home LMServer. What I've managed to do is:
    - install your version of Shairport
    - install WaveInput
    - start playing music from iPad to shairport (music obviously plays through shairport, not waveinput)
    - I can see waveinput in now playing on web browser. But no sound appears! What am I missing?

    Find below my shairport settings
    Attached Images Attached Images   

  4. #4
    Junior Member
    Join Date
    Jan 2014
    Posts
    2
    I just tried to set this up on my Windows Home Server yesterday and ran into I think the same problem. The issue for me was that there is no sound card in my server (it's an HP MediaSmart). There were two things I needed to do to fix it. One was to not log in with remote desktop, since that sets it to use a special RDP virtual soundcard. Instead I installed TightVNC and logged in with that. Then, I installed VB-Audio Virtual Cable, which is a free audio redirector. In the Windows sound properties I set the playback and record devices to VB-Audio Point. Basically that just makes it so any sounds that are played are redirected to the recording device, which is what WaveInput samples. After that it started working.

    Unfortunately, I'm getting a pretty frequent lockup. It looks like an assert, is your released version of shairport4Win compiled in debug Schurtz? Here's the message:

    Debug Assertion Failed!
    Program: C:\Program Files\shairport4W\Shairport4w.exe
    File: C:\users\admin\desktop\shairport4w-code-73\shairport4w-code-73\hairtunes.cpp
    Line: 784

    Expression: 0

    I didn't try to download the stock Shairport code to see if that's a stock assert or if it's in your changes. Any ideas?

  5. #5
    Junior Member
    Join Date
    Sep 2012
    Posts
    11
    Hi,

    sp1976, in a first part try to make "WaveInput plugin" works properly. To do that forget shairport4W for the moment, don't open remote desktop (logon locally on your server), check your sound card configuration and launch Windows Media Player with a song in repaet mode and launch your squeezebox on the URL : wavin:0 (you can type this like an radio URL).

    If the time count of the player displays "0:00" there is is a problem...
    You can check what is the error message directly on the squeezebox and if your squeezebox is not next your computer you can try with softsqueeze.

    Read carefully this section of the wavin plugin help

    Once you can hear the sound of your PC on your squeezebox then you can try again with the modified version of shairport.

    Normaly when you launch the WaveInput plugin a new process is created : you can check in the task manager that the process "wavin2cmd " has been created.


    Spastic, use VNC is a good idea, RDP can create some problems with the sound redirection (there is some tests to do in the options of RDP client, in the "local resources" tab ). Thanks for the tips with VB-Audio Virtual Cable, it can be usefull if you don't have the "stereo mix" option in the "Recording Control".
    Thanks for your remark about the compilation, I have recompiled it in release mode and updated the download link.
    Hope this help...
    You can try the official realease of shairport to see if you have the problem too.

  6. #6
    Junior Member
    Join Date
    Oct 2011
    Posts
    12
    Many thanks for your support!
    Of course the problem was with WaveInput config. I've maneged to create StereoMix the way it should work and now I'm happy with working Airplay solution on my Squeezeboxes.

    Greetings from Poland

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •