Ok, I thought I'd write a final message on specific points in my config
now all has been working fine for some days now.
The idea is to run the server and a software player on a small machine,
and have that serve and sync with my SB3s.

Hardware: 
- pc engines alix2d2 (Geode LX800)
- hifimediy Sabre USB DAC (ES9023 + Tenor TE7022, 96/24)
- wistron DNMA92 802.11a/b/g/n MIMO miniPCI (2,4GHz/5GHz)
- aaeon PER-C20S 2-port SATA miniPCI (SiI 3512 / SATA I)
- pc engines CompactFlash card (8GB, SLC)
- hitachi Travelstar 5K750 (2.5' / SATA II / 750 GB - 8 MB - SATA
+5V/GND is fed from pins on the board's IDE connector.)
- varia ALIX.Embedded Box for ALIX.2D2/6D2/6E1/6E2 (WLAN+HDD - note:
HDD bracket designed for an IDE HDD, leaves little room for the SATA
miniPCI card)
Power consumption is 11Wh active, 9Wh idle, as seen from a kill-a-watt
on the wall 220V outlet. I'll see if the internal HDD can sleep deeper
to shave 2-3Wh more when idle.

Software:
- debian squeeze 6.0.6, kernel 2.6.33 with rt-preempt patch compiled
for i486 --yes, i486, not GeodeLX or i586. (debian repo at
pengutronix.de)
- the whole lot I usually put on a home server machine, ie netatalk,
avahi, nfs, ssh, ntp, ssmtp, autofs, hddtemp, lm-sensors, FUSE, openvpn,
lighttpd, webmin, phpsysinfo, watchdog, iproute, ifupd, espeak,
grub-legacy. Surely I miss some.
- SBS 7.6.2 (standard .deb package)
- squeezelite v0.9beta11 (i386)
- Both block devices are ext3 formatted, nothing special (the CF is set
with a large swap partition, of which it makes very, very little use.)
The SATA drive only holds music. 

Key changes I made to get clean audio even when playing 24/96 files
synched with an SB3:
- In /boot/grub/menu.lst, added sata_sil.slow_down=1 to the kernel
line. Controller doesn't fit too well with chosen HDD, "vmstat 1" showed
regular stalls when transferring from the drive. Setting readahead to 0
was a less efficient remedy. With slow_down, throughput is poor, but
even and sufficient.
- PCI latency for the SATA miniPCI card dropped from 64 to 0.
- hdparm is run with -B 254 -S 241 (max performance, spindown after 30
mins) against the hitachi drive to improve response time consistency.
- kernel is compiled with options for small machines, optimized for
speed (not size), uses the SLOB memory manager (much smaller), full RT
preemption, 100Hz tick (better throughput compared to 1000Hz or 250Hz),
Noop and Deadline IO schedulers (I found CFQ no good.) 
Target CPU is i486 (choose the Geode target and you'll loose at least
10% throughput!), I activated code optimizations for GeodeLX (didn't
verify how sane this choice was)
- IO schedulers used:
* noop for the system on CF
* deadline for the sata drive
- Priorities on IRQ and S-IRQ threads provided by the RT-Preempt patch
are defined as this:
* timer, hrtimer: 98 (not sure alsa uses it)
* ohci: 97 (Sabre DAC is a USB1 device)
* sata_sil: 96, block: 95 (don't have a rationale for block at 95,
but it's working)
* tasklet: 90 (works for me ™)
* ehci: 1 (that's USB2. I might want to change that when I come to
tweaking usb storage support. I didn't want to remove USB2 capability
altogether.)
* serial: 1 (the serial console gets unresponsive under CPU load but
I rarely use it.)
- Process priorities:
* squeezeboxserver is reniced to -15 (highest value among any running
software)
* squeezelite is reniced to -10 (high priority but lower than SBS.
For me it locks up when its priority is higher than SBS --probably
waiting for it.)
- Squeezebox server settings:
* Priority set to -15 (already mentioned), got rid of Boom,
Transporter, Radio, Controller specific plugins, online services I don't
care about. Installed the lot of plugins you see in my signature,
disabled UPnP, logging set to minimum.
I also experimented without the web interface and using iPeng only.
That's good for memory usage and avoiding CPU load spikes, but I find
the web interface useful and the machine can pull it.
I use humongous cover files (iThing retina displays) and that's not the
greatest idea.
I use the large analog VU meters on the SB3s, the server can manage even
when transcoding.
- Custom-convert.conf (transcoding for the SB3 which is limited to
24/48):
Code:
--------------------
    flc flc transcode *
        # FT:{START=--skip=%t}U:{END=--until=%v}D:{RESAMPLE=-r %d}
        [flac] -dcs $START$ $END$ -- $FILE$ | [sox] --buffer 2048 
--input-buffer 262144 --volume 0.85 -q -t wav - -t flac -C 0 -b 16 - rate -q 
48000
--------------------

Same as high-def album covers, high-def audio files is not the greatest
idea on the platform. However, it can play up to 24/96 at the price of
CPU load reaching over 90%. A lot of tweaking went into defining the
above recipe. The huge input buffer tries to cope with slow and low
priority IOs. The small output buffer tries to relinquish control to the
squeezebox server process as soon as possible. Sox downsamples using the
"rate" filter, in fastest, low quality setting (-q). Any other setting 
or use of the resample filter just overwhelm the CPU. Since the
downsampling algorithm is crude, the 0.85 volume setting is there to
avoid clipping. I finally kept the flac part, it costs around 15% of
CPU, but removing it disables the ability to FF or REW within the song.
With this setup, I can sync squeezelite and SB3s, there is no
re-buffering (using ethernet) on the SB3 and squeezelite/alsa/usb work
ok. Be warned that playing 24/96, buffer fullness on the SB3 will hover
around 1% for a full minute or so…
When not transcoding, CPU load is under 5% when playing and an SB3
starts with a full buffer or so.
- SqueezeLite settings: 
* -b 4096:8192 seem to work well with both SBS and alsa. If the SB3
rebuffers, I wanted SqueezeLite to stop too. That's not exactly what
always happens, but a small buffer works better than a large one in this
respect.
* -a 10:4 gives IMO good synched audio for 2 sources in the same
room, separated by a few meters. With 2 SB3s, synch feels comparable.
The real difference is that a pair of SB3s will extremely rarely get out
of sync due to rebuffering. I went down to 8:4 which further improves
sync a bit, but then alsa will lose frames if sox is transcoding. 10:4
reliably works on all material I have (up to 24/96.) Default is 20:4,
AFAIK, and I played Squeezelite alone at 40:4 just fine. 
* -o plughw:CARD=DAC,DEV=0 this DAC does not handle the 88.2kHz
sampling rate, using plughw: instead of iec958: tells alsa to resample
on the fly. Loads the CPU quite a bit. I'd prefer using sox for this,
but my custom-convert Fu is lacking… 

I think that's about it. This recipe is totally dependent on the
application and the hardware platform, of course. 
I wanted to add a player to this small platform. I ended up finding how
to run the server "inside the player"… Don't do it if you can avoid it,
Squeezelite works like a champ on the same machine without any tweaks,
if it gets audio from a server on the network.


------------------------------------------------------------------------
epoch1970's Profile: http://forums.slimdevices.com/member.php?userid=16711
View this thread: http://forums.slimdevices.com/showthread.php?t=97515

_______________________________________________
unix mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/unix

Reply via email to