Discussion:
Internet Radio
gt
2011-05-08 13:52:24 UTC
Permalink
Hello list,

I didn't find any information about radio support in the documentation.
But found a few references through an internet search.

What i would like to know is:

1. Is streaming stuff safe with cmus.

2. How to manage the network buffer settings.

I added an m3u playlist to cmus containing radio stations and it picked
them up fine, and played fine. But i wanted to adjust the buffer size,
which i couldn't in the lack of any setting available.

In the meanwhile i am using mplayer, and it works just fine. I would
prefer cmus though, since i am using its status display script in my dwm
bar.
Johannes Weißl
2011-05-08 14:46:59 UTC
Permalink
Hi gt,
Post by gt
1. Is streaming stuff safe with cmus.
What does that mean? If you mean: Is cmus guaranteed to not segfault /
not execute remote code when streaming, I suspect the answer is "No".
But the same answer is true for all audio/video players (and because all
players use third-party libraries, it's not even in their hands).
Other players (VLC/MPlayer) have the advantage of more developers /
users to check the source code...

If you have very high security requirements, you should consider running
the player in an isolated environment (dummy user, virtual machine,
cheap additional computer, ...).
Post by gt
2. How to manage the network buffer settings.
I added an m3u playlist to cmus containing radio stations and it picked
them up fine, and played fine. But i wanted to adjust the buffer size,
which i couldn't in the lack of any setting available.
I never needed this, but the manpage says:

buffer_seconds (10) [1-20]
Size of player buffer in seconds.

Does it work for you?


Johannes
gt
2011-05-09 06:21:50 UTC
Permalink
Post by Johannes Weißl
Hi gt,
Post by gt
1. Is streaming stuff safe with cmus.
What does that mean? If you mean: Is cmus guaranteed to not segfault /
not execute remote code when streaming, I suspect the answer is "No".
But the same answer is true for all audio/video players (and because all
players use third-party libraries, it's not even in their hands).
Other players (VLC/MPlayer) have the advantage of more developers /
users to check the source code...
If you have very high security requirements, you should consider running
the player in an isolated environment (dummy user, virtual machine,
cheap additional computer, ...).
cmus --help gives

--listen ADDR listen on ADDR instead of ~/.cmus/socket
ADDR is either a UNIX socket or host[:port]
WARNING: using TCP/IP is insecure!

Also, the man page states:

Never make cmus listen to the internet.

So i was a bit confused about this TCP/IP warning.
Post by Johannes Weißl
Post by gt
2. How to manage the network buffer settings.
I added an m3u playlist to cmus containing radio stations and it picked
them up fine, and played fine. But i wanted to adjust the buffer size,
which i couldn't in the lack of any setting available.
buffer_seconds (10) [1-20]
Size of player buffer in seconds.
Does it work for you?
I thought this setting was for local files only. Anyway, i tried playing
around with it. I tried setting it to 30, but it says

Error: integer in range 1..20 expected

I think it should be possible to specify a value greater than 20. Also, i
think i found a bug, because when i tried changing the value to 20 from the
default 10, though it didn't give an error, but still the value remained at 10.
Experimenting with different values, i found that it only changes values between
1-10, instead of the said 1-20.

PS: Do you listen to internet radio, or other music streaming? If yes,
then what player do you use?
Johannes Weißl
2011-05-09 07:13:54 UTC
Permalink
Hi gt,
Post by gt
Post by Johannes Weißl
If you have very high security requirements, you should consider running
the player in an isolated environment (dummy user, virtual machine,
cheap additional computer, ...).
cmus --help gives
--listen ADDR listen on ADDR instead of ~/.cmus/socket
ADDR is either a UNIX socket or host[:port]
WARNING: using TCP/IP is insecure!
Never make cmus listen to the internet.
So i was a bit confused about this TCP/IP warning.
Ah, now I know where the uncertainty comes from :-)! This is completely
unrelated from listening to mp3/ogg streams. The --listen options lets
cmus be controlled by cmus-remote over the network.
Post by gt
Post by Johannes Weißl
buffer_seconds (10) [1-20]
Size of player buffer in seconds.
Does it work for you?
I thought this setting was for local files only. Anyway, i tried playing
around with it. I tried setting it to 30, but it says
Error: integer in range 1..20 expected
I think it should be possible to specify a value greater than 20.
Also, i think i found a bug, because when i tried changing the value
to 20 from the default 10, though it didn't give an error, but still
the value remained at 10. Experimenting with different values, i
found that it only changes values between 1-10, instead of the said
1-20.
You are right, I looked into the code, and cmus never allows more than
30 chunks (== 10 seconds). I see no problem in changing this, I don't
even know why it was introduced (the limitation is already there in the
first git commit). However, changing it to more than 10 seconds doesn't
make much sense... if you specify e.g. 60, you will have to wait pretty
long till the stream starts playing, and during this time cmus interface
blocks.
For me even one second is enough. Is your connection very slow so you
need more than 10 seconds? (buffer_seconds=10 is `mplayer -cache 1800`)

But either the documentation or the implementation should be fixed...
Post by gt
PS: Do you listen to internet radio, or other music streaming? If yes,
then what player do you use?
Yes, and I use cmus (works well for me). Really handy is the possibility
to save/view streams in playlists (e.g. :load news-radio.pl).


Johannes
Jason Woofenden
2011-05-09 07:13:39 UTC
Permalink
Post by gt
cmus --help gives
--listen ADDR listen on ADDR instead of ~/.cmus/socket
ADDR is either a UNIX socket or host[:port]
WARNING: using TCP/IP is insecure!
Never make cmus listen to the internet.
So i was a bit confused about this TCP/IP warning.
These messages about it being insecure are about allowing
cmus-remote to work over TCP, and have nothing to do with streaming
music.

I assume that TCP (for cmus-remote) is insecure because it cannot
be restricted to only your user. That is, any user on your system
(or network, if you don't restrict it to localhost) has full access
to cmus, and through it (:shell) your account.



I use use cmus for streaming occasionally. It works well for me.


Take care, - Jason
Johannes Weißl
2011-05-09 07:47:00 UTC
Permalink
Post by Jason Woofenden
I assume that TCP (for cmus-remote) is insecure because it cannot
be restricted to only your user. That is, any user on your system
(or network, if you don't restrict it to localhost) has full access
to cmus, and through it (:shell) your account.
Hmm, but cmus is not completely unprotected... it requires a password
(length >= 6) for authentication, and dangerous commands like :shell or
:run are not allowed. I guess the problem is that all traffic is
unencrypted (password can be sniffed), and nobody has ever checked if a
malicious user can do harm by executing other commands...

By the way: Is the cmus-remote working for you over the network? I did a
short test, and it doesn't work for me (even 2.3.3 doesn't). There is
some problem in the protocol, I wonder why it worked before...


Johannes
gt
2011-05-09 07:50:14 UTC
Permalink
Post by Jason Woofenden
Post by gt
cmus --help gives
--listen ADDR listen on ADDR instead of ~/.cmus/socket
ADDR is either a UNIX socket or host[:port]
WARNING: using TCP/IP is insecure!
Never make cmus listen to the internet.
So i was a bit confused about this TCP/IP warning.
These messages about it being insecure are about allowing
cmus-remote to work over TCP, and have nothing to do with streaming
music.
I assume that TCP (for cmus-remote) is insecure because it cannot
be restricted to only your user. That is, any user on your system
(or network, if you don't restrict it to localhost) has full access
to cmus, and through it (:shell) your account.
I use use cmus for streaming occasionally. It works well for me.
Thanks for the explanation. Nice to hear people use cmus for streaming.
Post by Jason Woofenden
Hi gt,
Post by gt
Post by Johannes Weißl
If you have very high security requirements, you should consider running
the player in an isolated environment (dummy user, virtual machine,
cheap additional computer, ...).
cmus --help gives
--listen ADDR listen on ADDR instead of ~/.cmus/socket
ADDR is either a UNIX socket or host[:port]
WARNING: using TCP/IP is insecure!
Never make cmus listen to the internet.
So i was a bit confused about this TCP/IP warning.
Ah, now I know where the uncertainty comes from :-)! This is completely
unrelated from listening to mp3/ogg streams. The --listen options lets
cmus be controlled by cmus-remote over the network.
Thanks, for the clarification.
Post by Jason Woofenden
Post by gt
Post by Johannes Weißl
buffer_seconds (10) [1-20]
Size of player buffer in seconds.
Does it work for you?
I thought this setting was for local files only. Anyway, i tried playing
around with it. I tried setting it to 30, but it says
Error: integer in range 1..20 expected
I think it should be possible to specify a value greater than 20.
Also, i think i found a bug, because when i tried changing the value
to 20 from the default 10, though it didn't give an error, but still
the value remained at 10. Experimenting with different values, i
found that it only changes values between 1-10, instead of the said
1-20.
You are right, I looked into the code, and cmus never allows more than
30 chunks (== 10 seconds). I see no problem in changing this, I don't
even know why it was introduced (the limitation is already there in the
first git commit). However, changing it to more than 10 seconds doesn't
make much sense... if you specify e.g. 60, you will have to wait pretty
long till the stream starts playing, and during this time cmus interface
blocks.
For me even one second is enough. Is your connection very slow so you
need more than 10 seconds? (buffer_seconds=10 is `mplayer -cache 1800`)
But either the documentation or the implementation should be fixed...
I have a 512kbps connection which is more than sufficient. But, the line
quality is very poor, and i experience a lot of noise in the line. So
sometimes, i like to increase the buffer to experience smooth playback.
Post by Jason Woofenden
Post by gt
PS: Do you listen to internet radio, or other music streaming? If yes,
then what player do you use?
Yes, and I use cmus (works well for me). Really handy is the possibility
to save/view streams in playlists (e.g. :load news-radio.pl).
So, i suppose i can stick with cmus for streaming :D
Though, i would love to have better buffer handling settings like
mplayer has.

Thanks.
Johannes Weißl
2011-05-09 08:49:55 UTC
Permalink
Post by gt
I have a 512kbps connection which is more than sufficient. But, the line
quality is very poor, and i experience a lot of noise in the line. So
sometimes, i like to increase the buffer to experience smooth playback.
Ok, I attached a patch that allows a maximum value of 300 seconds (50 MiB!).
I hope this is enough :-)
Post by gt
Post by Johannes Weißl
Yes, and I use cmus (works well for me). Really handy is the possibility
to save/view streams in playlists (e.g. :load news-radio.pl).
So, i suppose i can stick with cmus for streaming :D
Though, i would love to have better buffer handling settings like
mplayer has.
Now with the increased buffer size, do you need anything else in cmus
that mplayer offers?


Johannes
gt
2011-05-09 09:49:53 UTC
Permalink
Post by Johannes Weißl
Post by gt
I have a 512kbps connection which is more than sufficient. But, the line
quality is very poor, and i experience a lot of noise in the line. So
sometimes, i like to increase the buffer to experience smooth playback.
Ok, I attached a patch that allows a maximum value of 300 seconds (50 MiB!).
I hope this is enough :-)
Wow, that was fast. Thanks, and i am sure this'll be enough for everyone
out there.
Post by Johannes Weißl
Now with the increased buffer size, do you need anything else in cmus
that mplayer offers?
I think this should suffice for now. Thanks a lot again for the speedy
patch.
Gregory Petrosyan
2011-05-09 09:56:03 UTC
Permalink
Post by gt
Post by Johannes Weißl
Post by gt
I have a 512kbps connection which is more than sufficient. But, the line
quality is very poor, and i experience a lot of noise in the line. So
sometimes, i like to increase the buffer to experience smooth playback.
Ok, I attached a patch that allows a maximum value of 300 seconds (50 MiB!).
I hope this is enough :-)
Wow, that was fast. Thanks, and i am sure this'll be enough for everyone
out there.
Post by Johannes Weißl
Now with the increased buffer size, do you need anything else in cmus
that mplayer offers?
I think this should suffice for now. Thanks a lot again for the speedy
patch.
Yeah, indeed! Patch is in the master now.

                Gregory
gt
2011-05-10 04:29:59 UTC
Permalink
Post by Gregory Petrosyan
Post by gt
Post by Johannes Weißl
Ok, I attached a patch that allows a maximum value of 300 seconds (50 MiB!).
I hope this is enough :-)
Wow, that was fast. Thanks, and i am sure this'll be enough for everyone
out there.
Post by Johannes Weißl
Now with the increased buffer size, do you need anything else in cmus
that mplayer offers?
I think this should suffice for now. Thanks a lot again for the speedy
patch.
Yeah, indeed! Patch is in the master now.
                Gregory
Thanks, i just updated cmus-git, and the patch is working fine.

Continue reading on narkive:
Loading...