streaming music to Sun Rays

With only a few days left until christmas, it is time to spread annoying messages of love in the office through repeating the same old songs. And also a great chance to showcase your Sun Ray setup as a music streaming solution. The goal here is this: stream (and repeat) Wham’s “Last Christmas” to the internal speakers of all Sun Rays in the office until people find out it was me and start shouting threats. (I estimate this will only take 20 seconds).

You will need:

  • a Sun Ray Server
  • a few Sun Ray DTUs (
  • an annoying piece of christmas music

First, you’ll need to convert your music file to the Au file format. This is a special format invented by SUN and you could use ffmpeg to convert any other format to au.

ffmpeg -i last_christmas.m4a
ffmpeg version 0.4.9-pre1, Copyright (c) 2000-2004 Fabrice Bellard
  built on Oct 27 2005 17:26:03, gcc: 3.4.4
Input #0, mov,mp4,m4a,3gp, from 'last_christmas.m4a':
  Duration: 00:04:28.1, bitrate: 281 kb/s
  Stream #0.0: Audio: mpeg4aac, 44100 Hz, stereo
Output #0, au, to '':
  Stream #0.0: Audio: pcm_s16be, 44100 Hz, stereo, 1411 kb/s
Stream mapping:
  Stream #0.0 -> #0.0
Press [q] to stop encoding
size=   46196kB time=268.2 bitrate=1411.2kbits/s    
video:0kB audio:46196kB global headers:0kB muxing overhead 0.000051%

If you don’t have access to ffmpeg you can also use an online service to convert your file.

Next we need to make sure that the audio output on all devices is not muted, set to the maximum volume and sent to both the external speaker and headphone if headphones are inserted. Unfortunately, we cannot set this from the root account directly because the only way to modify these values from the CLI is through the utset command exected from a Sun Ray session. But that is exactly why Sun invented the utaction command. We can set this up in our kiosk script to execute utset every time a sesion starts or reconnects when hot-desking. Simply copy this line into your kiosk script:

/opt/SUNWut/bin/utaction -c '/opt/SUNWut/bin/utset -o v=31,m=off,s=hs' -i &

Now wait for your users to reconnect their sessions (or if you are a true BOFH you could simply terminate all running sessions).

To actually play the music on all connected DTUs, simply issue the utwall command like this

/opt/SUNWut/sbin/utwall -a /var/tmp/ ALL 2>/dev/null

Sit back, enjoy, wait for people to call and yell at you. Repeat. Merry christmas.

Leave a Reply

Your email address will not be published. Required fields are marked *