-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJOURNAL
162 lines (114 loc) · 5.35 KB
/
JOURNAL
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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
2017-09-30
- working towards build that can work on my laptop
make clean && make
ulimit -c 1000 # enable core dumps
WEB_ROOT=/home/alex/gh/alexcb/raspberrypimusic/resources/web/ sudo -E ./my123 ~/music streams playlists
curl localhost/library | jq .
2017-10-19
Found a bug:
this crashes when current_track_payload is NULL; sds doesn't allocate a new string
when a NULL reference is passed in.
sdscpy( data->current_track_payload, s );
fixed the underlying sdscpylen() method to allocate a string if NULL is passed in
2017-10-19
TODO:
- Test websockets work, we should be able to run:
python tools/test_websocket.py
- it should first print out {"type": "welcome"}
- it should then send a {"type": "ping"} to the server, then it should wait for a pong
- TODO: get this working:
curl localhost/playlists | jq .
- need a way to display all playlists
- need a way to post a new playlist (all in one go -- dont worry about posting just deltas)
- when a playlist is changed, we'll just create a version number based on the time
- this will be used while pushing "now playing" messages via websockets, so we don't
have to refresh the playlist all the time
2017-10-21
Whenever a song changes, we need to push a message: '{ "playing": true, "song_id": 4, "playlist_ver": 999 }'
The playlist ver will be a number identifying the current playlist.
a playlist in this context is actually a set of playlists. e.g.
{
version: 999,
playlists: [
{
name: quick_album,
items: [
{ artist: foo, song: bar, album: blah, path: /home/...}, # song id 0
{ artist: foo, song: bar, album: blah, path: /home/...}, # song id 1
{ artist: foo, song: bar, album: blah, path: /home/...}, # song id 2
]
},
{
name: otherplaylist,
items: [
{ artist: foo, song: bar, album: blah, path: /home/...}, # song id 3
{ artist: foo, song: bar, album: blah, path: /home/...}, # song id 4
{ artist: foo, song: bar, album: blah, path: /home/...}, # song id 5
]
},
],
]
the playlist will have the path from the /library endpoint
TODO: implement a POST /playlist to reload the playlist, and similarly a GET /playlist to retrieve it
2017-11-03
wrote tools/post_playlist.py to test sending playlists
the fetch can be tested with: curl localhost/playlists | jq .
when posting a playlist, it freezes up; posting an empty playlist works. <-- this only happened once, seems like an intermittent problem
after doing an empty post, restarting the server caused a crash (it tried playing the first file of an empty playlist)
I can now play music.
TODO:
- enable id3 caching
- enable playing streams
- enable playlist deletion
2017-11-12
start server with:
make clean && make
WEB_ROOT=/home/alex/gh/alexcb/raspberrypimusic/resources/web/ sudo -E ./my123 ~/music streams playlists
python tools/test_websocket.py
python tools/post_playlist.py
start websocket streamer with:
TODO:
- [done] change playlist to reference "track" struct instead of playlist_item -- this is to avoid storing id3 tags in multiple areas
Running on the pi:
cd ~/mpg123hack/
git fetch && git checkout origin/master && make clean && make
LOG_LEVEL=DEBUG WEB_ROOT=/home/alex/mpg123hack/resources/web/ sudo -E ./my123 /media/nugget_share/music/alex-beet/ streams playlists /home/alex/id3_cache
Running locally with all music:
make clean && make
LOG_LEVEL=DEBUG WEB_ROOT=/home/alex/gh/alexcb/raspberrypimusic/resources/web/ sudo -E ./my123 /media/nugget_share/music/alex-beet/ streams playlists alex-beet-cache
or running with local music
LOG_LEVEL=DEBUG WEB_ROOT=/home/alex/gh/alexcb/raspberrypimusic/resources/web/ sudo -E ./my123 ~/music streams playlists-local local-music-cache
Then change the playlist with:
./tools/ncurses-interface/go.py
sudo gdb ./my123 -ex 'handle SIGPIPE nostop noprint pass' -ex 'run ~/music streams playlists local-music-cache'
updating libmpg123 on raspberrypi:
mkdir ~/mpg123_src
cd ~/mpg123_src
wget 'https://downloads.sourceforge.net/project/mpg123/mpg123/1.25.6/mpg123-1.25.6.tar.bz2?r=https%3A%2F%2Fsourceforge.net%2Fprojects%2Fmpg123%2Ffiles%2F&ts=1514839666&use_mirror=newcontinuum'
tar xvjf mpg123.tar.bz2
cd mpg123-1.25.6
./configure
make
sudo make install
Finding recently modified albums:
find /media/nugget_share/music/alex-beet/ -mtime -5 -ls | grep -v mp3$
gapless - boards of canada - music has the right, fuck buttons - tarrot, carbon based lifeforms, apoptygma bezerk welcome to earth
gapless - tests/gapless -- has a 17 track beethoven song
NEXT UP: streaming:
- need to support both files and streams as playlist items:
1524327174.147370464 level=ERROR file=src/playlist_manager.c line=87 res=1 path=http://live-mp3-128.kexp.org:80/kexp128.mp3 msg="failed to lookup track"
- testing stream
sudo fbi -T 2 panda.jpg
sudo fbi -T 1 panda.jpg
echo hello > /dev/tty1
To send text to console:
date | sudo tee /dev/tty0
date | sudo tee /dev/tty1
To wake up the console screen via ssh
echo -ne "\033[9;0]" | sudo tee /dev/tty1 > /dev/null
To clear the screen:
echo -ne "\033c" | sudo tee /dev/tty1 > /dev/null
To send random data:
cat /dev/urandom >/dev/fb0
To draw a pixel on the screen:
printf "\x00\xFF\xFF\x00" | dd bs=4 seek=$((103 * 1024 + 205)) >/dev/fb0