Skip to content

Commit 4369fe3

Browse files
committed
- adding \b to toggle buffering on/off (\b to open window)
- vlc on linux will start mutted (volume =0) - updateing build_install_pyradio script as per #203 -updating docs
1 parent 46a75ea commit 4369fe3

File tree

10 files changed

+309
-14
lines changed

10 files changed

+309
-14
lines changed

Changelog

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
1+
2023-10-04 s-n-g
2+
* version 0.9.2.14
3+
* adding players buffering
4+
* [B] will be displayed at top left corner of the window
5+
when player is buffering
6+
* adding "Force transparency" config option (as per #201)
7+
* redisigning players' extra parameters window
8+
* removing command line parameters -ep, -ap, lp
9+
and changing -ocd etc.
10+
* Windows: MPV installation will check CPU flags to
11+
download V3 or normal mpv release
12+
* fix_pyradio_desktop_file: parameters will be placed
13+
after terminal name (before -e)
14+
* fixing mpv parameter which might throw a warning
15+
which would break the TUI
16+
* fixing mplayer volume parsing error
17+
* fixing a couple of python2 crashes
18+
* updating build_install_pyradio (as per #203)
19+
* updating docs
20+
121
2023-07-15 s-n-g
222
* version 0.9.2.13
323
* all search widgets will save up to 20 of their last search terms

README.html

Lines changed: 91 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,12 @@ <h2 id="table-of-contents">Table of Contents <span style="padding-left: 10px;"><
104104
<li><a href="#mplayer">MPlayer</a></li>
105105
<li><a href="#vlc">VLC</a></li>
106106
</ul></li>
107+
<li><a href="#buffering">Buffering</a>
108+
<ul>
109+
<li><a href="#parameters-used">Parameters used</a></li>
110+
<li><a href="#customizing-the-buffering-behaviour">Customizing the buffering behaviour</a></li>
111+
<li><a href="#how-it-works">How it works</a></li>
112+
</ul></li>
107113
<li><a href="#displaying-station-info">Displaying Station Info</a></li>
108114
<li><a href="#copying-and-pasting---registers">Copying and pasting - Registers</a></li>
109115
<li><a href="#pyradio-themes">PyRadio Themes</a>
@@ -206,6 +212,26 @@ <h2 id="requirements">Requirements <span style="padding-left: 10px;"><sup style=
206212
<h2 id="changelog">Changelog <span style="padding-left: 10px;"><sup style="font-size: 50%"><a href="#" title="Go to top of the page">Top</a></sup></span></h2>
207213
<pre style="height: 200px;">
208214

215+
2023-10-04 s-n-g
216+
* version 0.9.2.14
217+
* adding players buffering
218+
* [B] will be displayed at top left corner of the window
219+
when player is buffering
220+
* adding "Force transparency" config option (as per #201)
221+
* redisigning players' extra parameters window
222+
* removing command line parameters -ep, -ap, lp
223+
and changing -ocd etc.
224+
* Windows: MPV installation will check CPU flags to
225+
download V3 or normal mpv release
226+
* fix_pyradio_desktop_file: parameters will be placed
227+
after terminal name (before -e)
228+
* fixing mpv parameter which might throw a warning
229+
which would break the TUI
230+
* fixing mplayer volume parsing error
231+
* fixing a couple of python2 crashes
232+
* updating build_install_pyradio (as per #203)
233+
* updating docs
234+
209235
2023-07-15 s-n-g
210236
* version 0.9.2.13
211237
* all search widgets will save up to 20 of their last search terms
@@ -1542,12 +1568,76 @@ <h3 id="mplayer">MPlayer</h3>
15421568
softvol-max=300
15431569
volstep=1
15441570
volume=50</pre>
1545-
<p style="margin: 1.5em 4em 0 4em; text-indent: -2.5em;"><strong>Note:</strong> Starting with <strong>PyRadio v. 0.8.9</strong>, <em>mplayer</em>’s default profile will use its internal mixer to adjust its volume; this is accompliced using the “<em>softvol=1</em>” and “<em>softvol-max=300</em>” lines above. The user may choose to remove these lines from the config (to activate system-wide volume adjustment) or add them to the config (in case the profile was created by an older <strong>PyRadio</strong> version).</p>
1571+
<p style="margin: 1.5em 4em 0 4em; text-indent: -2.5em;"><strong>Note:</strong> Starting with <strong>PyRadio v. 0.8.9</strong>, <em>mplayer</em>’s default profile will use its internal mixer to adjust its volume; this is accomplished using the “<em>softvol=1</em>” and “<em>softvol-max=300</em>” lines above. The user may choose to remove these lines from the config (to activate system-wide volume adjustment) or add them to the config (in case the profile was created by an older <strong>PyRadio</strong> version).</p>
15461572
<h3 id="vlc">VLC</h3>
15471573
<p>Although <strong>VLC</strong> can use a local configuration file, there seems to be no reliable way of defining the playback volume in it.</p>
15481574
<p>In the past, <strong>VLC</strong> would just use any volume setting it had saved from a previous execution, but now it is possible to save the volume it will use when executed by <strong>PyRadio</strong>.</p>
15491575
<p>This means that <strong>VLC</strong> will start and connect to a station, use whatever volume level it’s stored for it and then <strong>PyRadio</strong> will reset the volume to the desired one (as saved within <strong>PyRadio</strong>).</p>
15501576
<p>The volume will be saved is a file called <em>vlc.conf</em> and reside withing the <em>data</em> directory, inside <strong>PyRadio</strong>’s configuration folder.</p>
1577+
<h2 id="buffering">Buffering <span style="padding-left: 10px;"><sup style="font-size: 50%"><a href="#" title="Go to top of the page">Top</a></sup></span></h2>
1578+
<p>When a station is slow (or the internet connection is slow), one might get to a situation where the connection timeout will run out before the connection with the station can be established. Even worse, <strong>PyRadio</strong> will connect to the station, but the sound will be choppy and crackling.</p>
1579+
<p>The solution is to use a large enough <strong>buffer</strong> to connect to the station; this will effectively make <strong>PyRadio</strong> connect to the station and start receiving data, but will not start playback until the buffer is full.</p>
1580+
<p>All <strong>PyRadio</strong> supported support buffering, using a number of command line parameters to actually set it up. <strong>PyRadio</strong> will remove all this complexity by making is as simple as inserting a single value to the “<em>Buffering</em>” window, shown below.</p>
1581+
<p><a href="https://members.hellug.gr/sng/pyradio/pyradio-buffering-win.jpg" target="_blank"><img style="width: 300px" src="https://members.hellug.gr/sng/pyradio/pyradio-buffering-win.jpg" alt="PyRadio Buffering Window" /></a></p>
1582+
1583+
<p>The window opens by pressing “<strong>\B</strong>” while in the <strong>Main</strong> mode.</p>
1584+
<p>It will display the current buffer size (0 means no buffering), and will permit to adjust it, or use the previously used value (pressing “<strong>r</strong>”).</p>
1585+
<p>In any case, one can enable or disable the use of buffering by pressing “<strong>\b</strong>” (using either the default value or the one set in the “<em>Buffering</em>” window).</p>
1586+
<h3 id="parameters-used">Parameters used</h3>
1587+
<p>The following table shows the command line parameters used by <strong>PyRadio</strong> when the “<em>Buffering</em>” window is used to set up buffering.</p>
1588+
<table>
1589+
<colgroup>
1590+
<col style="width: 38%" />
1591+
<col style="width: 30%" />
1592+
<col style="width: 30%" />
1593+
</colgroup>
1594+
<thead>
1595+
<tr class="header">
1596+
<th>mpv<br>(X in seconds)</th>
1597+
<th>mplayer<br>(X in KBytes)</th>
1598+
<th>vlc<br>(X in seconds)</th>
1599+
</tr>
1600+
</thead>
1601+
<tbody>
1602+
<tr class="odd">
1603+
<td>–demuxer-readahead-secs=X-1</td>
1604+
<td>-cache X</td>
1605+
<td>–network-caching X*1000</td>
1606+
</tr>
1607+
<tr class="even">
1608+
<td>–demuxer-cache-wait=yes</td>
1609+
<td>-cache-min 80</td>
1610+
<td></td>
1611+
</tr>
1612+
<tr class="odd">
1613+
<td>–cache=yes</td>
1614+
<td></td>
1615+
<td></td>
1616+
</tr>
1617+
<tr class="even">
1618+
<td>–cache-secs=X</td>
1619+
<td></td>
1620+
<td></td>
1621+
</tr>
1622+
<tr class="odd">
1623+
<td>–cache-on-disk=yes/no *</td>
1624+
<td></td>
1625+
<td></td>
1626+
</tr>
1627+
</tbody>
1628+
</table>
1629+
<p>* disabled if more than 300KB of memory is free</p>
1630+
<h3 id="customizing-the-buffering-behaviour">Customizing the buffering behaviour</h3>
1631+
<p>In case one wants to use a different set of parameters (when using <strong>mpv</strong> or <strong>mplayer</strong>, but not <strong>vlc</strong>), one would just not use the integrated solution; one would just use a <strong>profile</strong>.</p>
1632+
<p>Please refer to the players’ documentation on profiles and the “<a href="#player-default-volume-level">Player default volume level</a>” section in this document.</p>
1633+
<p>As long as the word “<strong>cache</strong>” is contained in the profile’s name, <strong>PyRadio</strong> will understand this is a buffering profile and act accordingly. But it’s up to the user to make sure this presupposition is honored.</p>
1634+
<h3 id="how-it-works">How it works</h3>
1635+
<p>When buffering is enabled, and a connection to a station initializes, <strong>PyRadio</strong> will display a “<strong>[B]</strong>” at the top left corner of the window, and display “<strong>Buffering:</strong>” and the name of the station in the status bar, until it get a token that the buffering has stopped.</p>
1636+
<p><a href="https://members.hellug.gr/sng/pyradio/pyradio-b.jpg" target="_blank"><img style="width: 450px" src="https://members.hellug.gr/sng/pyradio/pyradio-b.jpg" alt="PyRadio Buffering" /></a></p>
1637+
1638+
<p>An example is shown in the image above.</p>
1639+
<p>Now, this behaviour depends on the station, and the data it sends (or does not send) while it is buffering. For example, an ICY title may be received while buffering, which will be displayed in the status bar.</p>
1640+
<p>It should be noted that, no volume adjustment can be preformed while buffering.</p>
15511641
<h2 id="displaying-station-info">Displaying Station Info <span style="padding-left: 10px;"><sup style="font-size: 50%"><a href="#" title="Go to top of the page">Top</a></sup></span></h2>
15521642
<p>When a connection to a radio station has been established, the station starts sending audio data for the user to listen to.</p>
15531643
<p>Well, that’s obvious, right?</p>

README.md

Lines changed: 55 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ If you face this situation, please refer to [this page](pip-error.md) to resolve
5050
* [MPV](#mpv)
5151
* [MPlayer](#mplayer)
5252
* [VLC](#vlc)
53+
* [Buffering](#buffering)
54+
* [Parameters used](#parameters-used)
55+
* [Customizing the buffering behaviour](#customizing-the-buffering-behaviour)
56+
* [How it works](#how-it-works)
5357
* [Displaying Station Info](#displaying-station-info)
5458
* [Copying and pasting - Registers](#copying-and-pasting---registers)
5559
* [PyRadio Themes](#pyradio-themes)
@@ -756,7 +760,7 @@ Example:
756760
volstep=1
757761
volume=50
758762

759-
**Note:** Starting with **PyRadio v. 0.8.9**, *mplayer*'s default profile will use its internal mixer to adjust its volume; this is accompliced using the "*softvol=1*" and "*softvol-max=300*" lines above. The user may choose to remove these lines from the config (to activate system-wide volume adjustment) or add them to the config (in case the profile was created by an older **PyRadio** version).
763+
**Note:** Starting with **PyRadio v. 0.8.9**, *mplayer*'s default profile will use its internal mixer to adjust its volume; this is accomplished using the "*softvol=1*" and "*softvol-max=300*" lines above. The user may choose to remove these lines from the config (to activate system-wide volume adjustment) or add them to the config (in case the profile was created by an older **PyRadio** version).
760764

761765
### VLC
762766

@@ -768,6 +772,56 @@ This means that **VLC** will start and connect to a station, use whatever volume
768772

769773
The volume will be saved is a file called *vlc.conf* and reside withing the *data* directory, inside **PyRadio**'s configuration folder.
770774

775+
## Buffering
776+
777+
When a station is slow (or the internet connection is slow), one might get to a situation where the connection timeout will run out before the connection with the station can be established. Even worse, **PyRadio** will connect to the station, but the sound will be choppy and crackling.
778+
779+
The solution is to use a large enough **buffer** to connect to the station; this will effectively make **PyRadio** connect to the station and start receiving data, but will not start playback until the buffer is full.
780+
781+
All **PyRadio** supported support buffering, using a number of command line parameters to actually set it up. **PyRadio** will remove all this complexity by making is as simple as inserting a single value to the "*Buffering*" window, shown below.
782+
783+
![PyRadio Buffering Window](https://members.hellug.gr/sng/pyradio/pyradio-buffering-win.jpg)
784+
785+
The window opens by pressing "**\\B**" while in the **Main** mode.
786+
787+
It will display the current buffer size (0 means no buffering), and will permit to adjust it, or use the previously used value (pressing "**r**").
788+
789+
In any case, one can enable or disable the use of buffering by pressing "**\\b**" (using either the default value or the one set in the "*Buffering*" window).
790+
791+
### Parameters used
792+
793+
The following table shows the command line parameters used by **PyRadio** when the "*Buffering*" window is used to set up buffering.
794+
795+
| mpv<br>(X in seconds) | mplayer<br>(X in KBytes) | vlc<br>(X in seconds) |
796+
|--------------------------------|--------------------------|--------------------------|
797+
| --demuxer-readahead-secs=X-1 | -cache X | --network-caching X*1000 |
798+
| --demuxer-cache-wait=yes | -cache-min 80 | |
799+
| --cache=yes | | |
800+
| --cache-secs=X | | |
801+
| --cache-on-disk=yes/no \* | | |
802+
803+
\* disabled if more than 300KB of memory is free
804+
805+
### Customizing the buffering behaviour
806+
807+
In case one wants to use a different set of parameters (when using **mpv** or **mplayer**, but not **vlc**), one would just not use the integrated solution; one would just use a **profile**.
808+
809+
Please refer to the players' documentation on profiles and the "[Player default volume level](#player-default-volume-level)" section in this document.
810+
811+
As long as the word "**cache**" is contained in the profile's name, **PyRadio** will understand this is a buffering profile and act accordingly. But it's up to the user to make sure this presupposition is honored.
812+
813+
### How it works
814+
815+
When buffering is enabled, and a connection to a station initializes, **PyRadio** will display a "**[B]**" at the top left corner of the window, and display "**Buffering:**" and the name of the station in the status bar, until it get a token that the buffering has stopped.
816+
817+
![PyRadio Buffering](https://members.hellug.gr/sng/pyradio/pyradio-b.jpg)
818+
819+
An example is shown in the image above.
820+
821+
Now, this behaviour depends on the station, and the data it sends (or does not send) while it is buffering. For example, an ICY title may be received while buffering, which will be displayed in the status bar.
822+
823+
It should be noted that, no volume adjustment can be preformed while buffering.
824+
771825
## Displaying Station Info
772826

773827
When a connection to a radio station has been established, the station starts sending audio data for the user to listen to.

devel/build_install_pyradio

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -450,10 +450,10 @@ else
450450
fi
451451
if [ -z "$PIPX_ISOLATE" ]
452452
then
453-
pipx install $PIPX_EDITABLE --system-site-packages --force . || pipx_error
453+
python3 -m pipx install $PIPX_EDITABLE --system-site-packages --force . || pipx_error
454454
inst_type=1
455455
else
456-
pipx install $PIPX_EDITABLE --force . || pipx_error
456+
python3 -m pipx install $PIPX_EDITABLE --force . || pipx_error
457457
[ -z "$PIPX_EDITABLE" ] && \
458458
cat requirements_pipx.txt | sed -e 's/#.*//' | xargs pipx inject pyradio
459459
inst_type=2

devel/pre-commit

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,8 @@ do
149149

150150
if [ "$out" = "README.html" ];then
151151
sed -i -e '/http-force.jpg/s/src=/style="width: 600px" src=/' "$out"
152+
sed -i -e '/pyradio-buffering-win.jpg/s/src=/style="width: 300px" src=/' "$out"
153+
sed -i -e '/pyradio-b.jpg/s/src=/style="width: 450px" src=/' "$out"
152154
fi
153155

154156
if [ "$out" = "desktop-notification.html" ];then

pyradio.1

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -874,6 +874,82 @@ This means that \fIVLC\fR will start and connect to a station, use whatever volu
874874

875875
The volume will be saved is a file called \fIvlc.conf\fR and reside withing the \fIdata\fR directory, inside \fBpyradio\fR's configuration folder.
876876

877+
.SH Buffering
878+
879+
When a station is slow (or the internet connection is slow), one might get to a situation where the connection timeout will run out before the connection with the station can be established. Even worse, \fBpyradio\fR will connect to the station, but the sound will be choppy and crackling.
880+
881+
The solution is to use a large enough \fIbuffer\fR to connect to the station; this will effectively make \fBpyradio\fR connect to the station and start receiving data, but will not start playback until the buffer is full.
882+
883+
All \fBpyradio\fR supported support buffering, using a number of command line parameters to actually set it up. \fBpyradio\fR will remove all this complexity by making is as simple as inserting a single value to the "\fIBuffering\fR" window (image available at the link below).
884+
885+
\fIhttps://members.hellug.gr/sng/pyradio/pyradio-buffering-win.jpg\fR
886+
887+
The window opens by pressing "\fI\\B\fR" while in the \fBMain\fR mode.
888+
889+
It will display the current buffer size (0 means no buffering), and will permit to adjust it, or use the previously used value (pressing "\fIr\fR").
890+
891+
In any case, one can enable or disable the use of buffering by pressing "\fI\\b\fR" (using either the default value or the one set in the "\fIBuffering\fR" window).
892+
893+
\fBParameters used\fR
894+
895+
.RS 5
896+
The following list shows the command line parameters used by \fBpradio\fR when the "\fIBuffering\fR" window is used to set up buffering.
897+
898+
\fBmpv \fI(\fBX\fI in seconds)\fR
899+
.RS 3
900+
\fI--demuxer-readahead-secs=\fBX\fI-1
901+
.br
902+
--demuxer-cache-wait=yes
903+
.br
904+
--cache=yes
905+
.br
906+
--cache-secs=\fBX\fI
907+
.br
908+
--cache-on-disk=yes/no \fB*\fR
909+
910+
\fB*\fR disabled if more than 300KB of memory is free
911+
.RE
912+
913+
914+
\fBmplayer \fI(\fBX\fI in KBytes)\fR
915+
.RS 3
916+
\fI-cache \fBX\fI
917+
.br
918+
-cache-min 80\fR
919+
.RE
920+
921+
\fBvlc \fI(\fBX\fI in seconds)\fR
922+
.RS 3
923+
\fI--network-cachin \fBX\fI * 1000\fR
924+
.RE
925+
926+
.RE
927+
928+
\fBCustomizing the buffering behaviour\fR
929+
.RS 5
930+
931+
In case one wants to use a different set of parameters (when using \fImpv\fR or \fImplayer\fR, but not \fIvlc\fR), one would just not use the integrated solution; one would just use a \fBprofile\fR.
932+
933+
Please refer to the players' documentation on profiles and the "\fIPlayer default volume level\fR" section in this man page.
934+
935+
As long as the word "\fBcache\fR" is contained in the profile's name, \fBpyradio\fR will understand this is a buffering profile and act accordingly. But it's up to the user to make sure this presupposition is honored.
936+
937+
.RE
938+
939+
\fBHow it works\fR
940+
.RS 5
941+
942+
When buffering is enabled, and a connection to a station initializes, \fBpyradio\fR will display a "\fI[B]\fR" at the top left corner of the window, and display "\fIBuffering:\fR" and the name of the station in the status bar, until it get a token that the buffering has stopped.
943+
944+
\fIhttps://members.hellug.gr/sng/pyradio/pyradio-b.jpg\fR
945+
946+
An example is shown in the image linked above.
947+
948+
Now, this behaviour depends on the station, and the data it sends (or does not send) while it is buffering. For example, an ICY title may be received while buffering, which will be displayed in the status bar.
949+
950+
It should be noted that, no volume adjustment can be preformed while buffering.
951+
.RE
952+
877953
.SH Displaying Station Info
878954

879955
When a connection to a radio station has been established, the station starts sending audio data for the user to listen to.

0 commit comments

Comments
 (0)