-
Notifications
You must be signed in to change notification settings - Fork 2
/
notes.txt
126 lines (102 loc) · 3.91 KB
/
notes.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
TODO
- fix memory leak
- reboot on schedule (daily?)
- alternative: fix memory leak
x- make webclt start on boot
x- make alsaloop start on boot
x- fix airpogo sound quality
- improve webctl
- add volume control for SqueezeLite
xx - refresh button for main page?
x - bug in volume control ?when webpage is initialized with TV or AirPogo
x selected?
xx - mute during source switch
x - fix volume (TV not working?, airpogo not tested)
x - add mute (master)
x - add current samplerate
x - add source switch
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
commands
# deploy webctl to pogo
rsync -av --exclude=.* --exclude=temp . pogo:/opt/webctl
ssh pogo "/etc/init.d/webctl restart"
# alsaloop audio switching commands:
alsaloop -C line_in -P line --sync=0 --tlatency=50000
alsaloop -C squeeze_loop -P line_out --sync=0 --tlatency=50000
alsaloop -C airpogo_loop -P line_out --sync=0 --tlatency=50000
# prevent crackling sound when running without dmix/resampling
squeezelite -a 500:4 -n Pogo -o squeeze &
# this seems better: lower latency, tested on both 48KHz and 44.1KHz
squeezelite -n Pogo -o squeeze -a 100
# alsaloop (TV Line in, 48KHz)
alsaloop -C line_in -P line --sync=0 --tlatency=100000
# lower latency, higher CPU, works when not using dmix
alsaloop -C line_in -P line --sync=0 --tlatency=20000
# check current sample rates
cat /proc/asound/card0/pcm0p/sub0/hw_params
cat /proc/asound/card0/pcm0c/sub0/hw_params
# or
cat /proc/asound/card0/pcm0*/sub0/hw_params
# top CPU users
ps -eo pcpu,pid,args | sort -k 1 -r | head -5
# free memory (%)
free -t | grep "buffers/cache" | awk '{print $4/($3+$4) * 100}'
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
problems and solutions
- PogoPlug does not boot with "machid" uBoot variable set
- solution: unset "machid" in uBoot environment
fw_setenv machid
- resampling not working (very high CPU, unresponsive processes, no sound)
- solution: switch to speexrate_best
- seems to work better than samplerate_* (libsamplerate0)
- same sample rate for all streams
- 48KHz - best sound quality
- 44.1KH - poor sound quality
- in TV/Line in?
- ?? in SqueezeLite, possibly due to buffer size
- solution: eliminate dmix from alsa config
- caveat: cannot listen to multiple streams at once (no problem)
- alsaloop will not start if squeezelite is powered on (a good thing?)
- crackling, very poor sound quality from SqueezeLite, even at native stream sample rate
- solution: increase buffer time
- "-a 100" (100ms) seems to work well (default is 20ms)
- cannot reset alsa config
- solution: execute the following commands
/etc/init.d/alsa-utils stop
chmod -x /etc/init.d/alsa-utils
rm /var/lib/alsa/asound.state
reboot
chmod +x /etc/init.d/alsa-utils
/etc/init.d/alsa-utils start
- crackling, very poor sound quality from ShairPlay
- solution: set "period_time=100000" in /etc/libao.conf
- check period_size and buffer_size:
cat /proc/asound/card1/pcm0p/sub2/hw_params
- seems to work best when hw_params buffer_size and period_size are equal
(4410)
- webctl does not start on boot
- solution: update-rc.d webctl defaults
- run this command with the name of each script in init.d that should start
on boot
- memory leak (kernel?)
- troubleshooting steps
- leak seems to be in size-512 slabs as seen in slabtop (kernel leak)
SUnreclaim in /proc/meminfo increases constantly after boot
- guess: wifi driver is leaking
- first attempt: disable power save mode (create file and reboot):
# cat /etc/modprobe.d/8192cu.conf
options 8192cu rtw_power_mgnt=0
- clicking sound on power on/off squeezelite
- clicking sound on new samplerate
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
info page design
content:
- uptime
- free memory
- top CPU usage
- wifi stats
- audio hardware parameters:
- playback
- capture
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~