Hallo Portal,
endlich habe ich mich mal aufgerafft und ein Plugin geschrieben, das die Darstellung eines bzw. mehrerer Spectrum Analyzer ermöglicht. Es dient als Vermittler zwischen VDR-Plugins, die "(PCM-)Datenquellen" und/oder "Visualisierungs-Clients" sind.
Zwar hat _Frank_ schon so etwas ähnlich gemacht, aber da ich keine Soundkarte im VDR-Rechner habe, konnte ich seinen Ansatz nicht benutzen.
Und weil bald im Wohnzimmer der CD-Player durch den alleinigen Einsatz eines VDR ersetzt werden soll, muss natürlich auch die Visualisierung der Musik mit dabei sein (eigentlich gedacht für's graphlcd, aber das dauert wohl noch ein wenig).
Erster Testkandidat ist das mp3ng-plugin von Morone als Datenquelle und es ist auch direkt für Visualisierung zuständig (das lcdproc-plugin habe ich auch schon angetestet und probeweise zur Visualisierung genutzt).
Auszug aus der README:
This is a 'Sp'ectrum 'An'alyzer Plugin for the Video Disk Recorder (VDR).
Requirements:
VDR & (lib)fftw3
Description:
A plugin that can receive PCM-data from other plugins (e.g. mp3ng)
to compute frequency-data and to provide them to other plugins
to display a 'Sp'ectrum 'An'alyzer.
It is meant as a kind of middleware between
these providers and clients to be as generic as needed to be able to implement
the visualisation on all kinds of output-devices (OSD, lcd, graphlcd, framebuffer, etc.).
Sketch of the architecture:
| Data-provider sends PCM-data ---> | SpAn-plugin | >--- Visualization-clients
request the spectrum-data "making s.th. handsome out of it" |
Installation:
cd /put/your/path/here/VDR/PLUGINS/src
tar -xzf /put/your/path/here/vdr-span-X.Y.Z.tar.bz2
ln -s span-X.Y.Z span
cd /put/your/path/here/VDR
make
make plugins
./vdr -P span
Setup:
Activate spectrum analyzer? yes/no
De-(Activates) the plugin.
yes: The plugin receives data (only if clients also request data) and
on request hands the results over to clients.
no: In this case all data provider- and visualization-plugins are
rejected when trying to hand over data or to request results.
Use logarithmic diagram yes/no
A (yet naive) try to equalize the heights of the bars a bit.
Lower frequencies are prevailing which results in an "high dynamic
range of the heights of the bars" (= mostly few extremely high bars on
the left, further right more decreasing or even no bars at all).
yes: Suspends a "no" at "Use pure (unequalized) data". Scaling of the heights
of the bars is done logarithmically.
no: No logarithmic scaling is done.
Tips to improve this way of equalizing are warmly welcome!
Hide mainmenu entry yes/no
Should be self-explanatory.
At the moment there is no use of displaying the plugin's entry in the
main menu. See ToDo (way below) for the reason.
Use pure (unequalized) data yes/no
yes: Really compute the pure data without equalizing anyhow.
no: Values of higher frequencies are emphasized resulting in a "bit nicer way
of displaying the frequencies" than with pure data.
Notes:
- Tested on VDR-1.4.0 with a FF-DVB-s 2MB (CPU = PIII 1,2GHz) with mp3ng-plugin
as self-made data provider as well as visualization-client.
Additionally the lcdproc-plugin was used as visualization-client,
but just as a proof-of-concept. Thus, there were two clients
active simultaneously.
- I would be very glad if the authors of plugins for rendering vdr-information
on (external) displays (graphlcd/graphtft/lcdproc/etc.) or the OSD (mp3(ng)/
cdda/radio?/muggle?) used the data provided by this plugin to visualize
a spectrum analyzer.
Generic example how to use it:
// Please see the "real" README for the "HowTo".
TODO:
- Test the stuff with cdda-plugin (provider) and graphlcd-plugin (visualization)
- Test it on my streaming-client (it's a PIII 450MHz with DXR3 now)
- Implement the output of the names of all data-source- and visualization-plugins on
selecting the mainmenu's entry.
A change in the "Plugin-Service-Protocol" could be neccessary to support getting ALL
plugins that can handle a service.
- Implement bar-peaks and their fall off
Alles anzeigen
Zu finden ist es auf http://lcr.vdr-developer.org/
Da es die erste Version ist, möchte ich alle bitten, Nachsicht zu üben, falls der VDR sich mal beendet, während "visualisiert" wird. Aber ich denke, dass ich viele Fehler bereits behoben habe - aber man weiss ja nie, wo sich noch einer versteckt - irgendwo, wo ich während der Tests nicht hingekommen oder dran gedacht habe.
Sollte doch mal was schief gehen, meldet dies bitte.
Ein paar Infos, die sich bereits angesammelt haben, ab hier.
So, ich hoffe, dass ich nichts Wichtiges vergessen habe und nun viel Spaß!
Viele Grüße
Chriss
Edit: Visualisierungsclient-Versionen zum Testen - Benutzung auf eigene Gefahr und evtl. mit ein paar Anpassarbeiten vor dem Kompilieren:
[ANNOUNCE] vdr-span-0.0.1
[ANNOUNCE] vdr-span-0.0.1