My little tool to stream to Kodi/XBMC
#1
Hi falks

I'm using XBMC for 6-8 month now on a raspberry-pi (raspbmc distribution) and I'm a Golang developper. Because, sometimes, I've got some video, or music that I want to stream from my computer without to have to append them in media database... I did a little tool named "idok".

This tool is pretty simple, works on Linux and (maybe...) on Mac and Windows.

It allows to stream music and video with 2 modes:

* http to kodi : need to open port on you local machine...
* ssh tunneling : no need to open port, but you need the user/pass of ssh connection, or install key pairs (explained in my page)

And, of course, because I love it... you can give youtube url Smile

The page is there http://metal3d.github.io/idok/. Follow instruction to install, or go to the release page: https://github.com/metal3d/idok/releases

Keep in mind that that's the very begining of the developpement process. I will try to enhance Smile

And excuse my poor english, I'm French :p
Reply
#2
Cool

youtube works for me, but trying to use ssh I get:

Code:
nick@envy ~/Downloads $ idok -ssh -sshuser="root" -sshpass="openelec" -target=lounge /home/nick/Music/wedding/drinks/11.Jimmy_Durante-Make_Someone_Happy.mp3
2014/09/08 19:26:46 no id_rsa key found
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x20 pc=0x440909]

goroutine 16 [running]:
runtime.panic(0x6f3e00, 0x8e3ef3)
    /home/patachou/go/src/pkg/runtime/panic.c:279 +0xf5
code.google.com/p/go.crypto/ssh.publicKeyCallback.auth(0xc2080008e0, 0xc20803c840, 0x14, 0x14, 0x7fffb2f998b2, 0x4, 0x7f28d6305050, 0xc208086000, 0x7f28d63033a0, 0xc208022330, ...)
    /home/patachou/goprojects/src/code.google.com/p/go.crypto/ssh/client_auth.go:191 +0x199
code.google.com/p/go.crypto/ssh.(*connection).clientAuthenticate(0xc20804e200, 0xc208050140, 0x0, 0x0)
    /home/patachou/goprojects/src/code.google.com/p/go.crypto/ssh/client_auth.go:34 +0x4d8
code.google.com/p/go.crypto/ssh.(*connection).clientHandshake(0xc20804e200, 0xc208000940, 0x9, 0xc208050140, 0x0, 0x0)
    /home/patachou/goprojects/src/code.google.com/p/go.crypto/ssh/client.go:108 +0x578
code.google.com/p/go.crypto/ssh.NewClientConn(0x7f28d6303ab0, 0xc208038020, 0xc208000940, 0x9, 0xc2080500a0, 0x0, 0x0, 0x0, 0xc2080280d0, 0x0, ...)
    /home/patachou/goprojects/src/code.google.com/p/go.crypto/ssh/client.go:74 +0x100
code.google.com/p/go.crypto/ssh.Dial(0x73a410, 0x3, 0xc208000940, 0x9, 0xc2080500a0, 0xc208000940, 0x0, 0x0)
    /home/patachou/goprojects/src/code.google.com/p/go.crypto/ssh/client.go:196 +0xfd
main.sshforward(0xc2080500a0, 0x7fffb2f998f8, 0x27, 0x7fffb2f998d8, 0x1f)
    /home/patachou/Dev/go/idok/idok.go:227 +0x144
main.main()
    /home/patachou/Dev/go/idok/idok.go:358 +0xb6b

goroutine 19 [finalizer wait]:
runtime.park(0x417e30, 0x8e8a10, 0x8e6c69)
    /home/patachou/go/src/pkg/runtime/proc.c:1369 +0x89
runtime.parkunlock(0x8e8a10, 0x8e6c69)
    /home/patachou/go/src/pkg/runtime/proc.c:1385 +0x3b
runfinq()
    /home/patachou/go/src/pkg/runtime/mgc0.c:2644 +0xcf
runtime.goexit()
    /home/patachou/go/src/pkg/runtime/proc.c:1445

goroutine 20 [syscall]:
os/signal.loop()
    /home/patachou/go/src/pkg/os/signal/signal_unix.go:21 +0x1e
created by os/signal.init·1
    /home/patachou/go/src/pkg/os/signal/signal_unix.go:27 +0x32

goroutine 17 [syscall]:
runtime.goexit()
    /home/patachou/go/src/pkg/runtime/proc.c:1445

goroutine 21 [IO wait]:
net.runtime_pollWait(0x7f28d6304a80, 0x72, 0x0)
    /tmp/makerelease197226928/go/src/pkg/runtime/netpoll.goc:146 +0x66
net.(*pollDesc).Wait(0xc20802a140, 0x72, 0x0, 0x0)
    /home/patachou/go/src/pkg/net/fd_poll_runtime.go:84 +0x46
net.(*pollDesc).WaitRead(0xc20802a140, 0x0, 0x0)
    /home/patachou/go/src/pkg/net/fd_poll_runtime.go:89 +0x42
net.(*netFD).Read(0xc20802a0e0, 0xc208015000, 0x1000, 0x1000, 0x0, 0x7f28d6303418, 0xb)
    /home/patachou/go/src/pkg/net/fd_unix.go:232 +0x34c
net.(*conn).Read(0xc208038020, 0xc208015000, 0x1000, 0x1000, 0x0, 0x0, 0x0)
    /home/patachou/go/src/pkg/net/net.go:122 +0xe7
bufio.(*Reader).fill(0xc208004300)
    /home/patachou/go/src/pkg/bufio/bufio.go:97 +0x1b3
bufio.(*Reader).Read(0xc208004300, 0xc20804e420, 0x5, 0x5, 0x5, 0x0, 0x0)
    /home/patachou/go/src/pkg/bufio/bufio.go:175 +0x230
io.ReadAtLeast(0x7f28d6304d08, 0xc208004300, 0xc20804e420, 0x5, 0x5, 0x5, 0x0, 0x0, 0x0)
    /home/patachou/go/src/pkg/io/io.go:289 +0xf7
io.ReadFull(0x7f28d6304d08, 0xc208004300, 0xc20804e420, 0x5, 0x5, 0x14, 0x0, 0x0)
    /home/patachou/go/src/pkg/io/io.go:307 +0x71
code.google.com/p/go.crypto/ssh.(*streamPacketCipher).readPacket(0xc20804e400, 0xc200000005, 0x7f28d6304d08, 0xc208004300, 0x0, 0x0, 0x0, 0x0, 0x0)
    /home/patachou/goprojects/src/code.google.com/p/go.crypto/ssh/cipher.go:137 +0xd8
code.google.com/p/go.crypto/ssh.(*connectionState).readPacket(0xc208024120, 0xc208004300, 0x0, 0x0, 0x0, 0x0, 0x0)
    /home/patachou/goprojects/src/code.google.com/p/go.crypto/ssh/transport.go:110 +0xe7
code.google.com/p/go.crypto/ssh.(*transport).readPacket(0xc208024120, 0x0, 0x0, 0x0, 0x0, 0x0)
    /home/patachou/goprojects/src/code.google.com/p/go.crypto/ssh/transport.go:106 +0x67
code.google.com/p/go.crypto/ssh.(*handshakeTransport).readOnePacket(0xc208086000, 0x0, 0x0, 0x0, 0x0, 0x0)
    /home/patachou/goprojects/src/code.google.com/p/go.crypto/ssh/handshake.go:153 +0x105
code.google.com/p/go.crypto/ssh.(*handshakeTransport).readLoop(0xc208086000)
    /home/patachou/goprojects/src/code.google.com/p/go.crypto/ssh/handshake.go:133 +0x27
created by code.google.com/p/go.crypto/ssh.newClientTransport
    /home/patachou/goprojects/src/code.google.com/p/go.crypto/ssh/handshake.go:101 +0x101

What am I doing wrong?
If I have helped you or increased your knowledge, click the 'thumbs up' button to give thanks :) (People with less than 20 posts won't see the "thumbs up" button.)
Reply
#3
mmmhhh strange...

It seems that line of my code generate the problem.

== > sshClientConn, err := ssh.Dial("tcp", fmt.Sprintf("%s:%d", RASPIP, SSHPORT), config)

There are several cases that can break that... (once again, my tool is young Smile )

Is "lounge" a valid hostname ? have you try with lounge.local or with IP address ?

At home, I cannot use "raspbmc" hostname but "raspbmc.local" or the IP. If you can try...

If it really doesn't work, I will give you a little tool I make to check some basic points.

PS: maybe openelec has got a ssh server that is not standard. I had a lot of problems with rapsbmc using "dropbear" ssh server, an I had to patch the the crypto package... I will take a look on openelec as soon as I can.

Seen that "youtube" is working... I think I know what can append...

Tonight (it's 11:26 am here) I will try to install openelec on a SD card and check what appends. I'm pretty sure to know what is the problem... If everything is ok, that will be fixed tomorow (I will fill an issue on my github repo)

Thanks for your tests
Reply
#4
lounge is a valid hostname and works with youtube. Pretty sure openelec uses openssh not dropbear.
If I have helped you or increased your knowledge, click the 'thumbs up' button to give thanks :) (People with less than 20 posts won't see the "thumbs up" button.)
Reply
#5
That's very strange...

I just installed openelec 4.0.7. I only activated ssh service on installation process.

I did:
$ idok -ssh -sshuser=root -sshpass=openelec -target=192.168.1.50 /home/patachou/Musique/tuhouhu_m1.wav
2014/09/08 21:23:54 Listening port on raspberry: 11406
2014/09/08 21:24:04 {"id":1,"jsonrpc":"2.0","result":"OK"}

And the wave is working...

Same with "openelec" hostname (without .local), working here.

Can you tell me which version you are using ? of openelec, linux (or mac ?) version ?

And can you give me, please, what gives the output of "file ~/.local/bin/idok" to be sure that my install script hasn't installed 32 bit version on a 64 bit system.

The only problem I have with openelec is that it take too long to open ssh tunnel, and idok quit thinking that the player is stopped... I should enhance the test timer...

To give you my configuration:
Host : Fedora 20 x64
Raspberry : 512 - openelec 4.0.7 (stable)

Ho my god I know what is the problem !

I was suprised that your log tells "no id_rsa key found", because I have one Smile So i moved my .ssh directory and the problem appears !

I'm now sure of how to fix this, I will tell you when you will be able to get new revision. Sorry and thanks a lot for your tests
Reply
#6
@nickr, it should be fixed. You can reinstall (I change the script url, see the page) and now idok -version should give 0.2.6

I fixed the ssh problem. Thanks a lot to have reported this behaviour.
Reply
#7
I'll try this tonight.
If I have helped you or increased your knowledge, click the 'thumbs up' button to give thanks :) (People with less than 20 posts won't see the "thumbs up" button.)
Reply
#8
Really nice tool! Thanks Smile

A little problem though:

Code:
$ gst-launch-1.0 pulsesrc device=alsa_output.pci-0000_00_1b.0.analog-stereo.monitor ! audioresample ! lamemp3enc  ! filesink location=/dev/stdout | idok -stdin -target=192.168.1.16 -ssh
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x1 pc=0x804d32a]

goroutine 16 [running]:
runtime.panic(0x8295a00, 0x841c173)
    /home/patachou/go/src/pkg/runtime/panic.c:279 +0xe9
main.main()
    /home/patachou/Dev/go/idok/idok.go:460 +0x141a

goroutine 17 [runnable]:
runtime.MHeap_Scavenger()
    /home/patachou/go/src/pkg/runtime/mheap.c:507
runtime.goexit()
    /home/patachou/go/src/pkg/runtime/proc.c:1445

goroutine 18 [runnable]:
bgsweep()
    /home/patachou/go/src/pkg/runtime/mgc0.c:1976
runtime.goexit()
    /home/patachou/go/src/pkg/runtime/proc.c:1445

goroutine 19 [runnable]:
runfinq()
    /home/patachou/go/src/pkg/runtime/mgc0.c:2606
runtime.goexit()
    /home/patachou/go/src/pkg/runtime/proc.c:1445

goroutine 20 [runnable]:
os/signal.loop()
    /home/patachou/go/src/pkg/os/signal/signal_unix.go:19
created by os/signal.init·1
    /home/patachou/go/src/pkg/os/signal/signal_unix.go:27 +0x37
Reply
#9
Wow, nice...
Can you tell me if you installed with "install.sh" example or from sources ? Because I changed some stuffs in the "alpha" release that is not (yet) compiled and packaged...

If you are using install.sh system, please wait that I do a new release or try to:

- remove idok (from /usr/local/bin or .local/bin...)
- go install github.com/metal3d/idok (if you've installed golang)

Anyway, I will package the last release on saturday Smile

And thanks a lot for your tests

PS: later, could you please fill an issue on github for I can better manage bugs ? Smile
Reply
#10
I installed via this command:
Code:
$ bash <(curl -L https://github.com/metal3d/idok/releases/download/20140910-1/install-idok.sh)

I don't have go installed, so I'll wait for your next package Smile

Thanks!
Reply
#11
(2014-11-13, 22:21)Metal3d Wrote: Anyway, I will package the last release on saturday Smile

Did you have time to package it?
Reply

Logout Mark Read Team Forum Stats Members Help
My little tool to stream to Kodi/XBMC0