WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: [Tutorial] tinycore OSS audio streaming  (Read 20903 times)

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11049
Re: [Tutorial] tinycore OSS audio streaming
« Reply #15 on: December 31, 2010, 05:02:18 AM »
This is definitely a very nice hack. My first thought would have been to use NAS.
The only barriers that can stop you are the ones you create yourself.

Offline hiro

  • Hero Member
  • *****
  • Posts: 1229
Re: [Tutorial] tinycore OSS audio streaming
« Reply #16 on: December 31, 2010, 07:17:23 AM »
I was freely referring to the manual you had adviced me to read (and what I had absorbed and though t to understand about it)...
Quote
the listen mode can be used to obtain some kind of stream of data from a remote site
Sorry, I haven't read that man page before. ;)

Here are some relevant parts of the old UNIX man pages for it's tcp library. And I guess there are billions of books about this subject...
Code: [Select]
          tcp_connect(fd, lport, faddr, fport)
          tcp_listen(fd, lport, faddr, fport)

          TCP is one of the many protocols which are layered upon IP
          (internet protocol).  It provides full duplex byte stream
          connections between end points called sockets.  The address
          of a socket is composed of the internet address of its host
          and the port number to which the socket is bound.

          Tcp_connect binds socket fd to port lport and attempts to
          set up a connection to the socket bound to port fport on
          host faddr. Tcp_connect returns 0 if the connection is
          established, -1 otherwise.  Communications proceeds by per-
          forming read(2) and write(2) on fd.

          Tcp_listen binds socket fd to port lport and configures the
          socket to listen for connection requests to that port.  If
          faddr and fport are non-zero, only connections coming from
          sockets on machine faddr and bound to port fport are lis-
          tened for.  Tcp_listen returns 0 on success, -1 otherwise.
          Select(2) can be used with a listening socket to provide
          asynchronous polling of connection requests.

Offline hiro

  • Hero Member
  • *****
  • Posts: 1229
Re: [Tutorial] tinycore OSS audio streaming
« Reply #17 on: December 31, 2010, 07:30:48 AM »
This is definitely a very nice hack. My first thought would have been to use NAS.

Quote from: http://radscan.com/nas/nas-README.txt
A X11 build environment (make, xmkmf, imake, X11/ headers, etc) is
required to compile NAS.
Quote from: http://radscan.com/nas/nas-README.txt
Just Say No!
« Last Edit: December 31, 2010, 07:33:13 AM by hiro »

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11049
Re: [Tutorial] tinycore OSS audio streaming
« Reply #18 on: December 31, 2010, 07:36:24 AM »
There's a nas.tcz, no compiling required ;)
The only barriers that can stop you are the ones you create yourself.

Offline hiro

  • Hero Member
  • *****
  • Posts: 1229
Re: [Tutorial] tinycore OSS audio streaming
« Reply #19 on: December 31, 2010, 08:07:24 AM »
It depends on the X print library.
Come on, I don't even have a printer :P

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: [Tutorial] tinycore OSS audio streaming
« Reply #20 on: December 31, 2010, 11:26:29 PM »
Here are some relevant parts of the old UNIX man pages for it's tcp library.

Any particular reason you use tcp for this specific task (as opposed to udp)?
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: [Tutorial] tinycore OSS audio streaming
« Reply #21 on: December 31, 2010, 11:35:37 PM »
Heh, I was thinking exact same when I first ran into that dep.
On a closer look it is one lib of 20KB ;)
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11049
Re: [Tutorial] tinycore OSS audio streaming
« Reply #22 on: January 01, 2011, 04:18:06 AM »
It's unnecessary as well :P

It's a part of the default link line of the Imakefiles, "just in case" the app also uses that. Using -Wl,-as-needed in ldflags usually gets rid of those, or they could also be removed from the generated Makefile. (they, because there are other unused libs linked in too).
The only barriers that can stop you are the ones you create yourself.

Offline hiro

  • Hero Member
  • *****
  • Posts: 1229
Re: [Tutorial] tinycore OSS audio streaming
« Reply #23 on: January 01, 2011, 06:22:40 AM »
Any particular reason you use tcp for this specific task (as opposed to udp)?
None at all. I leave this as an exercise for the reader :)

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: [Tutorial] tinycore OSS audio streaming
« Reply #24 on: January 20, 2011, 09:11:00 AM »
Wondering if anyone has attempted to take this a step further, i.e. controlling player, volume and netcat of the target box from the source box - all I could think of would be running a ssh server on the target box and client on source box to achieve this.
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline hiro

  • Hero Member
  • *****
  • Posts: 1229
Re: [Tutorial] tinycore OSS audio streaming
« Reply #25 on: January 20, 2011, 03:19:11 PM »
You mean to have something even more lightweight than mpd?

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: [Tutorial] tinycore OSS audio streaming
« Reply #26 on: January 21, 2011, 02:35:51 AM »
No idea about mpd.
What I mean is particularly to control alsamixer/ossmix and to reinitiate the netcat pipe - which would die if it had been cancelled on source machine side - on the target machine.
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline hiro

  • Hero Member
  • *****
  • Posts: 1229
Re: [Tutorial] tinycore OSS audio streaming
« Reply #27 on: January 21, 2011, 09:37:29 AM »
Yeah, well, you can either run the listening process on the target in a loop, like that: "while true; do soundserver.sh; done"

Or, if you have ssh with key certification enabled (copy the source machine's public key to the .ssh/authorized_keys file on the target.), include something like this in the source machine's script: "ssh other_command.sh".

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: [Tutorial] tinycore OSS audio streaming
« Reply #28 on: January 21, 2011, 12:36:04 PM »
Not using ssh with key certification enabled, just dropbear sshd and dropbear client.
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline hiro

  • Hero Member
  • *****
  • Posts: 1229
Re: [Tutorial] tinycore OSS audio streaming
« Reply #29 on: January 21, 2011, 02:11:42 PM »
dropbear knows how to read the authorized_keys file, just cp your public key in there and you can automate ssh commands without typing your password