gotubecast icon indicating copy to clipboard operation
gotubecast copied to clipboard

Resource temporarily unavailable

Open bronek999 opened this issue 7 years ago • 9 comments

I have problem with gotubecast raspi

Installed OK, no error messages.

First run video is OK.When I try to seek, first seek is OK, another seek crash program

Your pairing code: 851-236-917-659 omxplayer.bin: no process found Video codec omx-h264 width 640 height 360 profile 578 fps 25.000000 Audio codec aac channels 2 samplerate 44100 bitspersample 16 Subtitle count: 0, state: off, index: 1, delay: 0 V:PortSettingsChanged: [email protected] interlace:0 deinterlace:0 anaglyph:0 par:1.00 display:0 layer:0 alpha:255 aspectMode:0 Seek to: 00:01:37 // THIS SEEK IS OK ./raspi.sh: line 21: read: read error: 0: Resource temporarily unavailable // THIS IS NEXT SEEK

bronek999 avatar Jan 04 '18 14:01 bronek999

Looks like a stream connection error in omxplayer. You can try executing the commands (youtube-dl, omxplayer, omxdbus) manually and see if that happens again.

It shouldn't be an issue related to gotubecast :)

cbix avatar Jan 04 '18 21:01 cbix

I have go version 1.9.2 installed youtube-dl works fine. With -g parameter returns https URL of video. Without -g parameter always download mp4 file. omxplayer also works fine, when I start it from command line........ omxdbus not tested. But when I place more videos in play list, first video started OK. Jump to nex video will start next video (vithout any omxdbus command) and program is crashed. omxplayer continue with playing current video

bronek999 avatar Jan 05 '18 08:01 bronek999

Now I tested again. Downloaded new raspi image 2017-11-29-raspbian-stretch.img first boot: Set SSH access and pi user password apt-get update apt-get install omxplayer - was installed in raspbian-stretch.img image apt-get install youtube-dl - install OK cd /tmp wget https://redirector.gvt1.com/edgedl/go/go1.8.5.linux-armv6l.tar.gz tar -C /usr/local -xzf go1.8.5.linux-armv6l.tar.gz export PATH=$PATH:/usr/local/go/bin

command go version return go version go1.8.5 linux/arm --OK

cd ~ go get github.com/CBiX/gotubecast export PATH=$PATH:~/go/bin cd ./home/pi/go/src/github.com/CBiX/gotubecast/examples ./raspi.sh

paired with android phone youtube TV pi@raspberrypi:~/go/src/github.com/CBiX/gotubecast/examples $ ./raspi.sh Your pairing code: 069-175-335-932 SONY F3111 connected omxplayer.bin: no process found Video codec omx-h264 width 1280 height 720 profile 77 fps 25.000000 Audio codec aac channels 2 samplerate 44100 bitspersample 16 Subtitle count: 0, state: off, index: 1, delay: 0 V:PortSettingsChanged: [email protected] interlace:0 deinterlace:0 anaglyph:0 par:1.00 display:0 layer:0 alpha:255 aspectMode:0 VIDEO PLAYING,NOW PRESSED SEEK ON PHONE Seek to: 00:00:47 ./raspi.sh: line 19: read: read error: 0: Resource temporarily unavailable

bronek999 avatar Jan 05 '18 09:01 bronek999

Also tested with fresh build gotubecast with go build main.go

Result same, only difference is SONY F3111 connected WARNING: unable to extract uploader nickname omxplayer.bin: no process found ...

bronek999 avatar Jan 05 '18 09:01 bronek999

Now I tried modify raspi.sh

   video_id)
        YTURL="`youtube-dl -g $YTDL_OPTS https://youtube.com?v=$arg`"
        killall omxplayer.bin
        omxplayer $OMX_OPTS "$YTURL" &
        ;;
    play | pause)
        echo "PLAY|PAUSE pressed block begin"
       //omxdbus org.mpris.MediaPlayer2.Player.PlayPause  // **LINE IS COMMENTED**
        echo "PLAY|PAUSE pressed block end"
        ;;
    stop)
        omxdbus org.mpris.MediaPlayer2.Player.Stop
        ;;

Result for pause command while playing: V:PortSettingsChanged: [email protected] interlace:0 deinterlace:0 anaglyph:0 par:1.00 display:0 layer:0 alpha:255 aspectMode:0 PLAY|PAUSE pressed block begin PLAY|PAUSE pressed block end ./raspi.sh: line 19: read: read error: 0: Resource temporarily unavailable

It seems like raspi.sh cant read output from gotubecast No procces for omxplayer or omxplayer controll. Also no work for youtube-dl.............

After pressed pause button program stopped.

Added line echo $line >> raspi.log to raspi.sh do while

log is: cat raspi.log screen_id 68rkp3cmlo9ankq4agk6dr631c lounge_token AGdO5p8P2ko9EwM2w_PfugLuIyjwnG7igryLVjaUCJkQIwbzg8CRU0qBGEonmuwSb25rBDMAdOpK_Ka7njdiA9Pn-xALU1O4O4cxo-m65WW2nQx0dERYOj4 1516273021 option_sid A9C93B03A5E51D6E option_gsessionid 8Rm9a5wI4jrBhwNnPrEnfYHQmxj8xhL6 generic_cmd loungeStatus [map[devices:[{"app":"pitubecast-v1","capabilities":"que,mus","clientName":"unknown","experiments":"","name":"Raspberry Pi","id":"2a026ce9-4429-4c5e-8ef5-0101eddf5671","type":"LOUNGE_SCREEN","hasCc":"true"},{"app":"android-phone-12.47.58","capabilities":"atp,que,mus","clientName":"android","experiments":"","userAvatarUri":"https://yt3.ggpht.com/-sEUPjrdoCIo/AAAAAAAAAAI/AAAAAAAAAAA/_MPDEdbaTrg/s240-c-k-no-mo-rj-c0xffffff/photo.jpg","type":"REMOTE_CONTROL","localChannelEncryptionKey":"r_3Atdq1nFWl7li-h4f0hfdjTxu2YS6HHdEgWKQM2EQ","pairingType":"manual","name":"SONY F3111","obfuscatedGaiaId":"104785888284692205843","remoteControllerUrl":"ws://192.168.1.68:53321/76b99338-1866-4514-8779-a294cd793d04","id":"coe5a450utis3639ut7v7vnrm1","user":"bronek999"}] connectionEventDetails:{"deviceId":"2a026ce9-4429-4c5e-8ef5-0101eddf5671"}]] pairing_code 839-347-501-286 video_id dXLuBhc30OE pause

bronek999 avatar Jan 05 '18 10:01 bronek999

I had the same problem, but managed to fix it after some amount of googling. The fix is simple, in raspi.sh:

omxplayer $OMX_OPTS "$YTURL" < /dev/null &

omxplayer is taking input from stdin which causes the line read to fail I think.

koochyrat avatar Jun 15 '18 15:06 koochyrat

Hey guys, sorry for the late comment on this. Unfortunately I don't have any RasPi environment now to test omxplayer. Did you manage to fix it with the change from @koochyrat?

cbix avatar Aug 22 '18 21:08 cbix

Hi Just to confirm that the solution proposed by koochyrat also solve me the same problem! Regards

hsmptg avatar Oct 02 '18 14:10 hsmptg

Hi! @bronek999,I got the same problem.Have you solve it?

Luckychuan avatar May 08 '19 14:05 Luckychuan