lingnand / RPD

Stream radio to command line with ease and comfort
rpd.lynnard.me
8 stars 2 forks source link

字符界面下,从 fmc 连续执行 skip 指令会让 fmd 进程僵死 #5

Open lapsule opened 11 years ago

lapsule commented 11 years ago
pi@raspberrypi ~ $ fmc -a localhost -p 10098 skip
connect: Connection refused
pi@raspberrypi ~ $ ps ax|grep fmd
 2457 pts/0    S+     0:00 grep --color=auto fmd
lingnand commented 11 years ago

把你的~/.fmd/fmd.log贴出来给我看看

lingnand commented 11 years ago

什么叫字符界面下?还有你的连续执行是有没有等到each time the command returns

lapsule commented 11 years ago

就是命令行。这样操作的:

是否考虑加入一个命令缓冲机制,在遇到这种过于频繁的输入的时候过滤掉一些指令,比如如果 2s 内发来多次 skip 指令则只相应最后一条。

pi@raspberrypi ~/.fmd $ cat fmd.log 
Config DoubanFM: uid => 62934668
Config DoubanFM: uname => \u9a6c\u7532\u9a6c\u7532\u7532
Config DoubanFM: token => 7ea1616fda
Config DoubanFM: expire => 1401270907
Config DoubanFM: kbps => 
Config Output: driver => alsa
Config Output: device => default
Config Server: address => 0.0.0.0
Config Server: port => 10098
Player audio driver: Advanced Linux Sound Architecture (ALSA) output
Server listen at 0.0.0.0:10098
Playlist next song
Playlist init empty, request new
Total number of downloaders in the stack is 5; number of requested downloaders is 1
### Downloader obtained for playlist retrieval is 0x2bb92e8
### playlist mode is 1
### Entered Douban playlist retieval mode
Playlist send report: 62934668:n
Playlist request: http://www.douban.com/j/app/radio/people?app_name=radio_desktop_win&version=100&user_id=62934668&expire=1401270907&token=7ea1616fda&channel=0&sid=0&type=n&h=&kbps=
### Curl config finished
Adding all the handles to the multi-handle
Downloader 0x2bb92e8 on mode 1 inited and added to the stack
Trying with initial perform for multi-handle 0x2bb2d80
Initial perform finished
Downloader 0x2bb92e8 stopped and marked to idle
### Downloader finished is 0x2bb92e8; idle 1
Trying to stop all downloaders
Attempting to parse the output
Douban playlist parsing new API response
parsed song
SHA256 validator initiated with SHA256 string: 217f37698c037e9070bd383cb1dff9210be8630dc29573cea56e77fea229b4b0
Music directory not set
Playlist add song 547178 before 0x2c00520
SHA256 validator initiated with SHA256 string: a6a760a6a3faee69f8f227ec77ce8853d19477a4a8345da25d362760a12dff9b
Music directory not set
Playlist add song 1381222 before 0x2c00a18
SHA256 validator initiated with SHA256 string: 1ac234ebcd640c419446e2ea7d95d8169617b019e8b8b93647eb65ca172e7135
Music directory not set
Playlist add song 1385194 before 0x2c00f10
SHA256 validator initiated with SHA256 string: 461e79dd57a0f210af38cc0b6858ced12ba7e0ccdabd402ffc3bcac9c28ec666
Music directory not set
Playlist add song 698236 before 0x2c01408
SHA256 validator initiated with SHA256 string: 3c4dcd75bf6758bc178b8dd5afb2e5d089d6917f4ea35a69b863d42ade8c9bbe
Music directory not set
Playlist add song 374295 before 0x2c01900
Resetting current download to Take That / Reach Out with url http://mr3.douban.com/201311301100/69703016e6330f17d78db76c3fbb48d4/view/song/small/p374295.mp3
Starting song downloaders
Creating the download thread
Player play
Creating play thread
Finished creating play thread
Entered play thread
Download thread started
Getting idle song downloaders
Total number of downloaders in the stack is 5; number of requested downloaders is 2
Configuring fdownloader for 0x2bd7f50
Configuring fdownloader for 0x2be0838
Intializing the song downloader 0x2bd7f50
Setting the url http://mr3.douban.com/201311301100/69703016e6330f17d78db76c3fbb48d4/view/song/small/p374295.mp3(Reach Out) for the song downloader 0x2bd7f50
File path /tmp/fmctmp0 is copied to the song
Intializing the song downloader 0x2be0838
Setting the url http://mr3.douban.com/201311301100/39e2117ba3ef75d3d9b00ed107652694/view/song/small/p698236.mp3(Hotel Song) for the song downloader 0x2be0838
File path /tmp/fmctmp1 is copied to the song
Start performing
Adding all the handles to the multi-handle
Downloader 0x2bd7f50 on mode 2 inited and added to the stack
Downloader 0x2be0838 on mode 2 inited and added to the stack
Trying with initial perform for multi-handle 0x2bb2d80
Blocking on waiting for the file to have some initial size
Waiting for some new content to arrive
Initial perform finished
Wait finished
Blocking on waiting for the file to have some initial size
Waiting for some new content to arrive
Wait finished
Blocking on waiting for the file to have some initial size
Waiting for some new content to arrive
Wait finished
Blocking on waiting for the file to have some initial size
Waiting for some new content to arrive
Wait finished
Blocking on waiting for the file to have some initial size
Waiting for some new content to arrive
Wait finished
Blocking on waiting for the file to have some initial size
Waiting for some new content to arrive
Wait finished
Blocking on waiting for the file to have some initial size
Waiting for some new content to arrive
Wait finished
Blocking on waiting for the file to have some initial size
Waiting for some new content to arrive
Wait finished
Blocking on waiting for the file to have some initial size
Waiting for some new content to arrive
Wait finished
Blocking on waiting for the file to have some initial size
Waiting for some new content to arrive
Wait finished
Blocking on waiting for the file to have some initial size
Waiting for some new content to arrive
Wait finished
Blocking on waiting for the file to have some initial size
Waiting for some new content to arrive
Wait finished
Blocking on waiting for the file to have some initial size
Waiting for some new content to arrive
Wait finished
Attempting to open the input
Opened format input
Attempting to find the stream info
Downloader 0x2be0838 stopped and marked to idle
Configuring fdownloader for 0x2be0838
Setting the url http://mr4.douban.com/201311301100/37b0e28fcc95bad38e5867a19f3c14fa/view/song/small/p1385194.mp3(She Be the One) for the song downloader 0x2be0838
File path /tmp/fmctmp2 is copied to the song
Downloader 0x2be0838 on mode 2 inited and added to the stack
Attempting to find the best stream
Number of streams available: 1
Attempting to open the codec
Attempting to adjusting for resampling
ao setup: bits is 16
ao setup: channels is 2
ao setup: sampling rate is 24000
Song openning process finished.
buf size 188 exceeding current interweave buf size 0. Reallocating the interweave buffer
buf size 2304 exceeding current interweave buf size 188. Reallocating the interweave buffer
Downloader 0x2be0838 stopped and marked to idle
Configuring fdownloader for 0x2be0838
Setting the url http://mr4.douban.com/201311301100/539bbcf48b9af304432304c51f1880a6/view/song/small/p1381222.mp3(You Pulled Me Through (prod. By Harvey Mason & Brian Kennedy)) for the song downloader 0x2be0838
File path /tmp/fmctmp3 is copied to the song
Downloader 0x2be0838 on mode 2 inited and added to the stack
Downloader 0x2be0838 stopped and marked to idle
Configuring fdownloader for 0x2be0838
Setting the url http://mr3.douban.com/201311301100/99545f3db7df98fe40eb08d594e0cb4f/view/song/small/p547178.mp3(Nothing That You Are) for the song downloader 0x2be0838
File path /tmp/fmctmp4 is copied to the song
Downloader 0x2be0838 on mode 2 inited and added to the stack
Downloader 0x2bd7f50 stopped and marked to idle
Playlist skip song
Total number of downloaders in the stack is 5; number of requested downloaders is 1
### Downloader obtained for playlist retrieval is 0x2bb92e8
### playlist mode is 1
### Entered Douban playlist retieval mode
Playlist send report: 62934668:s
Playlist request: http://www.douban.com/j/app/radio/people?app_name=radio_desktop_win&version=100&user_id=62934668&expire=1401270907&token=7ea1616fda&channel=0&sid=374295&type=s&h=|374295:s&kbps=
### Curl config finished
Adding all the handles to the multi-handle
Downloader 0x2bb92e8 on mode 1 inited and added to the stack
Trying with initial perform for multi-handle 0x2bb2d80
Initial perform finished
Downloader 0x2bb92e8 stopped and marked to idle
### Downloader finished is 0x2bb92e8; idle 1
Player stop
Trying to signal cond new content
Trying to stop all downloaders
Clearing old songs
Downloader 0x2be0838 stopped and marked to idle
Attempting to parse the output
Douban playlist parsing new API response
parsed song
SHA256 validator initiated with SHA256 string: 7d65811006371f1faf8a66da4ea0a4f944b9b6a4a216a0ae00bf8ccfe757f71a
Music directory not set
Playlist add song 1476556 before 0x2bfe890
SHA256 validator initiated with SHA256 string: 07a22f3de14af489ce92be62ddb7a1f301623b1fb56ab226e162202215a7de15
Music directory not set
Playlist add song 261603 before 0x2c1d518
SHA256 validator initiated with SHA256 string: 833f75797601a24f58c934a2f546324f1092fad26512f33d205c4fb311f72b6e
Music directory not set
Playlist add song 1390075 before 0x2bfddd8
SHA256 validator initiated with SHA256 string: 943c8324e033ce89a9f859a552963089558317df6fe77e35fd946d89a7ab058c
Music directory not set
Playlist add song 739570 before 0x2c2b470
SHA256 validator initiated with SHA256 string: 37bd21524323dbc4407c7e5cf198e63886eb652303cdcfdba6a970c728bd3827
Music directory not set
Playlist add song 464284 before 0x2c1c6d8
Resetting current download to Maroon 5 / Won’t Go Home Without You (acoustic Version) with url http://mr4.douban.com/201311301101/a5ea2a23451f853a83df51f0e046fceb/view/song/small/p464284_v1.mp3
Starting song downloaders
Player play
Creating play thread
Finished creating play thread
Entered play thread
Configuring fdownloader for 0x2bd7f50
Setting the url http://mr4.douban.com/201311301101/a5ea2a23451f853a83df51f0e046fceb/view/song/small/p464284_v1.mp3(Won’t Go Home Without You (acoustic Version)) for the song downloader 0x2bd7f50
File path /tmp/fmctmp5 is copied to the song
Downloader 0x2bd7f50 on mode 2 inited and added to the stack
Configuring fdownloader for 0x2be0838
Setting the url http://mr3.douban.com/201311301101/6b18081df36069417dd6e855f52eb9c8/view/song/small/p739570.mp3(Good Morning Stranger) for the song downloader 0x2be0838
File path /tmp/fmctmp6 is copied to the song
Downloader 0x2be0838 on mode 2 inited and added to the stack
Blocking on waiting for the file to have some initial size
Waiting for some new content to arrive
pi@raspberrypi ~/.fmd $ 
lingnand commented 11 years ago

在我的机器上没法produce出这个问题。不频繁切换也会这样么?还有你说的等1-2s是否是等那条命令执行完了的(歌确实已经切换了)?

lapsule commented 11 years ago

刚试了一下,即便不短时间内频繁切换,在播放大约10首歌之后再 skip,虽然 fmd 进程还在, 曲目也会改变,但没有声音,查看状态就一直停在 0:00, 虽然显示 "Playing"

pi@raspberrypi ~ $ fmc
FMD Playing - 私人兆赫 / 64 kbps
Atomic Kitten - Never Get Over You
0:00 / 3:57
lingnand commented 11 years ago

这种情况你只能继续skip,原因是downloader没有速度,所以一直在等速度。有这种问题我怀疑是因为豆瓣的限制,因为我这个版本会同时下载好几首歌,而且会不停下载直至queue empty,所以要是你切的太频繁会在短期内make many connection attempts。你可以尝试修改playlist.hN_SONG_DOWNLOADERS换成1

Jing.fm底下就没这个问题。

lapsule commented 11 years ago

嗯,可能是 douban 的 API 限制,重新执行一下 fmd-update-conf.sh, 把相应的id之类的更新一下就可以继续播放了

lapsule commented 11 years ago

碰到这种问题能否加一个自动跳过的功能? 比如在10s之后 downloader 还是没有回来就自动 skip?

lingnand commented 11 years ago

可以是可以。我可以在downloader里面加限制,比方过多久没速度就跳过;但是这种东西很难说,可能真的网络不太好,user would want to choose to wait for it to recover。所以暂时不会加这种功能。

lingnand commented 11 years ago

豆瓣这种问题比较严重是因为每次skip都会tell Douban you skipped this particular song and fetch new playlist,每个playlist有五六首歌的样子;如果你的网速够快,这意味着如果半分钟你跳3~4首歌可能会下载十几首歌。我也想过这个问题,比如skip的时候不重新fetch playlist,但是终究没有去多研究因为平常不常碰到这个问题。

如果you are particularly troubled by this problem, you can try out the channel '#psn' if you have a Jing.fm account, which does not trigger new playlist fetch on skipping (and generally provides better music quality as well)

lapsule commented 10 years ago
lingnand commented 10 years ago

恩 好的 有空我改一下