To make the infra-structure simple; the DB, the sourcelist (search-result-field) and the internal file format (*.pmd), uses the exact same formating. That means, we can dump the raw output of the DB to the gui, a favorite list, or ie. to the smart-add function. This helps a lot when it comes to speed. Sometimes you might forget that pMusic is not compiled binary, but just a bash script.
GeekNote: To be technically correct, the sourcelist and *.pmd file contains only the first 15 columns of the DB format. They have no use of the last items of info.
The DB structure
Let's look at one line of my DB:
/mnt/sdb1/musikk/Tindrum - Drums Of War.mp3|Tindrum|Drums Of War|Drums of war|1|1988|Hard Rock|Live||mp3|175|04:02|117|/mnt/sdb1/musikk/Tindrum - Drums Of War.mp3|gtk-audio|2aa59ada-3dd8-40b7-878a-bb682fca7b30|479933cd-d787-4126-8315-7749ca4781a1|Tindrum|/mnt/home/pmusic storage/albumart/Tindrum - Drums Of War.jpg||,1357415329,1357417187
Most of this is straightforward, but 3 things might not seem logical:
Writing to the DB
pMusic allows 2 major ways to write info to the DB. Either by (1) user interaction or the default (2) silent mode.
(1) user interaction
The static way is to start the indexer (Menu > Music sources > My Music) which scans your system for audio-files and adds the info to the DB. Depending on your music collection, this might take a long time, but place all available information (ID3-tags and stream info) to the DB at once.
(2) silent mode
The default dynamic behavior is to store info as you play. When you press the Play-button, pMusic
All this info must be written to the DB - but that's not straightforward - we can't just start writing...
Keep the DB in shape
In addition, there are mechanisms to keep the DB in shape. When you add a file to the playqueue, pMusic checks it in func_add - functions check_source and fix_db.
If the added file is not already in the DB, ask user to scan the source directory for new music. This message shows up embedded in the main window to not disturb the user too much. It could be that we don't want to respond to this message, and that is just ok.
If the added file has its line in the DB, but not present in your system, something should probably be updated, and this message below will show up. But, if the filename is found in the DB with another path than the defined, pMusic will play the alternative source instead. Therefor, this box is not often seen in recent versions of pMusic.
The Playlist file format
I mentioned earlier the internal file format *.pmd used by ie. the favorites structure. But, for the user, the pMusic format is the *.pmu found in the save box. You can choose to save to an external format as *.m3u or *.pls, but to get the full power of pMusic, *.pmu is the recommended choice. This because it cooperates well with the DB.
*.pmu contains the same info as in the playqueue. This makes it possible to dump a *.pmu into the playqueue, while a *.m3u has to be converted. Since all information in a *.pmu is grabbed from the DB, we can quickly revert, and grab the full track-info back from the DB. This is seen when expanding a *.pmu in the sourcelist (left pane). - We see full track-info including rating calculation. When expanding a m3u/pls we only see the actual info inside the file.
When looking at the playqueue in the gui, you see 3 columns:
Length | Track title | Path
In fact there are 2 more hidden columns, and all are part of the *.pmu file:
Icon | Length | Track title | Path | ID
The Icon holds gtk-play when the play-icon is shown, else it's empty. This will of course always be empty inside a *.pmu file
The ID holds an unique id-number together with the path. This is necessary to avoid conflict when playqueue contains several instances of the same song. The ID keeps track of which of the similar songs you are playing/moving/editing.
Unlike *.m3u, the *.pmu playlist does not handle relative paths. This to stay close to the DB format. Instead pMusic will search for an alternative path if playing track is not found. The statusbar will show this information during search. Code found in func_progressbar.
The short story of the pMusic file formats is:
*.pmd mirrors the DB
*.pmu mirrors the playqueue
This is the basic structure of the pMusic data format.
No comments posted yet.
However, there is still much work to be done.
While on the surface there doesn't seem to be much happening, behind the scenes development is actually heating up! We have a new member on the team who has been very busy adding and editing thousands of lines of code along with the old faces of zigbert, iguleder and gyro (GitHub handle gyrog) updating and refining code and 666philb (GitHub handle mrfricks) churning out exciting new xenialpup beta releases. I myself am working on a slacko-631 bugfix release (but I may bump the version number to reflect the massive changes in woof).
Without further ado I'd like to welcome the said new member of the woof-CE team wdlkmpx (GitHub handle - a.k.a. jlist on the Puppy forum). He has been pushing several pull requests lately and they have all been sound so I decided to make him a full member. So if something goes wrong some of the heat is off me!
Puppy development isn't just woof-CE. An important part of Puppy is the initrd.gz ('initial ramdisk', for want of a better term) that takes care of the booting of Puppy after the bootloader and kernel have done their respective jobs. I started the initrd_progs woof repo to reliably reproduce the initrd programs which wdlkmpxhas improved substantially. << Read totally re-written!
So where to now?
Unfortunately, we haven't many builders to test the various distro compatibility. While we all would love Puppy to be our full time jobs, it doesn't pay the bills! We are going to rationalise the number of distros that are supported by woof-CE. Don't panic though. We are going to preserve all the old code in a Legacy branch so that if an enthusiast does come along wishing to revive one of the relegated distros then they don't have to start from scratch.
Distros facing the chop are
as well as old unsupported upstream projects such as Lucid Lynx and older Slackware and Debian releases. Old puppy 2, 3 and 4 repo databases will be removed from woof (not the main repo).
Rationalising of the build scripts is also a priority. A functions library would make life a lot easier and the code more readable. Numerous other improvements need to be made.
Consideration to shifting firmware out of the zdrv and making fdrv (system sfs files) load by default is under review. This will also require a new kernel structure, although old kernels (from the huge style) will still work. Old kernel 'pets' will be removed.
Also, the integration of the initrd_progs into woof-CE would be desirable. The resulting initrd.gz would be smaller and faster with the latest busybox and supporting programs included.
I would also like to see some C sources in woof for core programs so that they can be compiled on the fly in a chroot. This should not be a problem when native building but may have to be addressed for a cross build.
Applications should be grouped to make it easier for builders to make a minimal or an "everything including the kitchen sink" Puppy! The woof GUI will need substantial improvements.
These changes will take time and effort. They are designed for maximum compatibility when a distro is built and hopefully reduce compatibility issues.
I look forward to any comments and may even start a forum thread about this for those who don't want to register here.
Posted on 5 Jun 2016, 01:00 by zigbert
Output sound processing
The output sound processing is done after the stream has left the pMusic play-engine. So, it will only affect the Linux sound driver (Alsa). This is a smooth processing, and most often the recommended choice. The downside is that it will affect the sound output of all other apps using the Alsa driver, and does not have all the capabilities of the input processing.
pMusic offers a basic Volume and Balance controller. The Volume slider will work for mono as well as stereo, but the Balance does of course require a stereo channel. The default channel is Master, and this is most often a mono channel, and does not support different level for left and right speaker. You must specify correct channel for your system to get mixer volume to work as a balance controller. This is done in the preferences. Menu->File->Preferences. (See image below). There is also a mute-button in this basic sound processing module.
In addition, the output sound processing includes the equalizer embedded from pEqualizer. This is a frontend to alsaequal made by 01micko. This gives easy access to tuning the sound fitting your speakers and ears. Be aware that you can save your equalizer settings to a preset for later use. Check out the pEqualizer manual
When the equalizer is installed on your system, all sound is ported through it. Even if choosing the Flat preset the sound is filtered. It does not have a true bypass. If you are one of those wanting the raw output, the solution is to avoid using auto as your defined soundcard. This is the default setting, and to be changed in the preferences. Note that by setting the soundcard you also bound the Alsa driver to pMusic. This means other programs will not play audio as long as pMusic is active. On the other hand, pMusic will not play if sound driver is in use by other program.
Input sound processing
The input processing is tweaking the sound stream going into pMusic, so this gives more options to manipulate the streams structure (ie. tempo and fading). The downside of input processing is that it has to reload the stream setup, and it will give a tick/pause when changing the values.
The input processing is put inside the generated playing command to the exec-file: $HOME/.pmusic/tmp/exec (check out the backend monitor plugin).
It is the -af (audiofilter) switch that defines the input sound processing, and we see here that volume is increased by 2dB, treble by 3dB while bass is decreased by 7dB. The -af values is grabbed from:
ffmpeg -i "/mnt/sdb1/musikk/mp3/Yngwie Malmsteen - Mistreated.mp3" -ss 134 -af "volume=2,treble=gain=3,bass=gain=-7" -f rtp rtp://127.0.0.1:1234 -ss 134 -af "volume=2,treble=gain=3,bass=gain=-7" -f au - 2>> /root/.pmusic/tmp/ffmpeg_output | aplay 2> /root/.pmusic/tmp/aplay_error
$HOME/.pmusic/tmp/ffmpeg_filter - for internal use
$HOME/.pmusic/tmp/ffmpeg_filter_basic - for plugin
$HOME/.pmusic/tmp/ffmpeg_filter_EQ - for plugin
So, the infrastructure are ready to test out your new sound processing plugin. If you want to look into how pMusic uses ffmpeg as its play engine it is described in the blogpost ffmpeg - the multimedia hub.
Manipulate Export files
The gui-module for input processing is also used when exporting files in the playqueue. This gives the abilities to convert the stream more radically than just changing the format. Since this is the same gui-module, all values stays active also when exporting the tracks. To avoid your exported files to be changed, keep the Bypass switch on.
Input volume / Normalize
Increasing the input volume should be used by caution, as it could give distortion to the sound. To optimize the input volume level, use the Normalizer. The normalizer will unify volume of all tracks, but never increase volume more than to a level without distortion. This is handy when your tracks comes from different sources, since the recording level was probably not the same. The normalizer uses resources on the volume calculation, and depending on your system, it will give a small gap before playing.
The output volume will not distort.
Posted on 18 Jun 2016, 02:59 by jamesb
The internal sourcelist
In the default frontend, this is the big field to the left, and it shows output of
The Smartadd dock
Show the Smartadd dock by pressing the button beside the search field - see image below. This is a tool adding tracks depending on your requests. You define how many tracks to be added (by sort order or randomly), and where the smartadd should look. Either in the sourcelist (image above) or the internal database (all audio files on system). This is all good, but it is the filters that make it 'smart'. From version 5.1.0, there are 3 filters:
Each time you have played a song it is stored in the database, so pMusic 'knows' how many times you have played each song. I use this filter when I want some random music - but still, I want music I like. So, setting the rating filter to 3 - I only get songs I have heard 3 times earlier. I get different kind of music (I set it to random), but since I have played these songs 3 times before, I most likely enjoy them.
The genre info is based on the meta-info stored in the database. If this info isn't present, this filter is useless and will lead to an error message. An interesting feature is the free search. - The string in the genre-field can be ie. 'eta' and will accept Metal/metal/Heavy metal/Black metal/...
If info exist, this filter allows us to specify beats per minute of the songs we like to hear.
The filter buttons shows quick info of the filter status. Here we see the rating filter is set to 3 while the tempo-button shows the minimum beats per minute - 120. Genre filter is not set, so button doesn't show any info.
The pMusic indexer stores the tempo of the song to the database. It requires a full scan (Menu->Music Sources->My Music) or that you've listen the song. (See Witing to the DB for more info). The tempo detection is done in funcC via the trackinfo function (func_trackinfo --> stream_info) and the result is seen in the Stream tab in the Track info window. Tempo detection requires soundtouch to be installed on your system. There is a dependency checker in the Help menu. Tempo features is introduced in pMusic 5.1.0
The basic command is pmusic /path/file, and it will start pmusic with an empty playqueue and play the requested song. If pMusic is already running, it will add the file to the existing playqueue. To override this dynamic behavior, use the switches:
-a to ensure the file is added to the existing queue
-P to ensure the file will start playing
See pmusic --help for a full set of switches.
External file browser
The dynamic behavior of the commandline described above will all file browsers benefit of. As long as audio MIME types are associated with pMusic, you can click on an audio file in your file browser and pMusic will show up and start playing. The next files you click on, will nicely be added to the playqueue.
If using the Rox file browser (used in most Puppy linux), there is an option to add all audio files in the selected directory. This is available from the right-click menu.
Track info - Album tab
There is also an option to add tracks from the Track info window - Album tab. Right-click in the list, and you get the option to add track(s) to the playqueue.
The search field
The search field gives of course input to the search-engine. You can also activate the internal file browser by enter a path here. But in addition, it lets us add music to the playqueue by entering the address - either a file path or an internet URL. Mostly, other solutions are preferable, but when you ie. want to add an internet URL to the playqueue, this is the most handy way to do it. Copy the address in a browser - paste it into the search field - press enter.
No comments posted yet.
This might be called a bugfix release to Slacko 6.3.0 but it is so much more than that!
This is the first ever official puppy to support UEFI booting for both for 32 and 64 bit versions and the same ISO image will boot legacy BIOS PCs as well. And there is so much more that is improved, such as the theming, sound detection, firewall, default application management plus our home grown apps such as pMusic.
It is still based on upstream 14.1 but has all the latest security and bugfix updates. There is much more going on here than a point release can convey that is why we have given it 2 points!
I Hope you enjoy using Slacko!
Posted on 23 Jun 2016, 17:25 by zigbert