The latest posts in full-text for feed readers.
After upgrading my UPnP/DLNA server software Gerbera to the latest release v1.12.1, the kitchen radio showed all audio album folders as <Leer> ("Empty"). Other UPnP clients showed the the audio files just fine and could play them without problems.
At first I thought it had something to do with transcoding (most of my audio files are ogg/vorbis, which need to be converted for the radio to play), but the radio showed folders with only mp3 files as empty, too.
I knew that the radio has a debug port, and I "only" needed to find out how to enable it. It turned out that the radio's netRemote.misc.fsDebug.component and netRemote.misc.fsDebug.traceLevel API endpoints are the key: component selects the part of the radio software whose debugging level shall be configured, and traceLevel then lets you query and set the debug level of the previously selected component.
After many tries and firmware crashes I finally knew that component 14 (UPnP browsing, "AVB") was the one I had been looking for and raising the log level from 2 to 5 gave me helpful log messages via telnet on port 514:
(Thread2): [ 87.986738] AVB (3): Browse for '34203', from 0, max 100 items, server 'f42aa029-7c99-47d2-b6ed-53b9e06cc3a7' (Thread2): [ 87.987678] AVB (4): Using sort criteria '+upnp:originalTrackNumber' (Thread2): [ 87.988558] AVB (4): Invoking AVB_REQTYPE_BROWSE request (b0b449e8 b0b449e8) (Thread2): [ 88.087921] AVB (5): (MS_BrowseResponded) errorCode=0 (Thread2): [ 88.099874] AVB (4): Resource: Not found (Thread2): [ 88.101841] AVB (4): 2: (0xa200) (68044) 2 Become 1(Single Version) (Thread2): [ 88.111814] AVB (4): Resource: Not found (Thread2): [ 88.111982] AVB (4): 2: (0xa200) (68054) 2 Become 1 (Orchestral Version) (Thread2): [ 88.119992] AVB (4): Resource: Not found (Thread2): [ 88.120341] AVB (4): 2: (0xa200) (68034) One Of These Girls (Thread2): [ 88.127823] AVB (4): Resource: Not found (Thread2): [ 88.127985] AVB (4): 2: (0xa200) (68024) Wannabe (Junior Vasquez Remix Edit) (Thread2): [ 88.129514] AVB (3): Browse OK - 4 matches, 4 returned, 4 copied (Thread2): [ 88.129649] AVB (3): TotalMatches = 4
The log messages told me that the radio actually got the list of
songs in the album folders, but rejected them because
Resource not found
- although it did not request the URLs.
For comparison I installed minidlna on my laptop; the radio could list and play all audio files without problems.
I captured DIDL-Lite XML responses with Wireshark from both minidlna and Gerbera, decoded and compared them with Meld - but I could not spot the problem :(
Then I remembered that I had tagged the old Gerbera version in the git clone on my home server. I installed it, recorded the UPnP server responses with Wireshark's SSH remote capture feature and compared them to the new ones:
The only relevant difference were the audio file URLs: Old gerbera from 2022-02 had the server's IP address, the new version used the domain name.
- http://192.168.3.3:49152/content/media/object_id/736/res_id/0/ext/file.ogg + http://mediatomb.home.cweiske.de:49152/content/media/object_id/51123/res_id/0/group/default/ext/file.ogg
So I removed the <virtualURL> setting from Gerbera's configuration .. and the radio showed all files again.
In my bug report Karl Straussberger told me that other devices had similar problems, and that I should use externalURI instead of virtualURL.
The whole thing took 4 hours distributed over 2 days. API documentation was another hour..
Published on 2023-11-11 in music, upnp
My music library consists of mostly ogg/vorbis files, and I wanted to store the text that is sung directly in the files.
This is mostly uncharted territory - at least for .ogg files. It took three weeks of research to learn about the possibilities, solutions in other file formats and problems.
Lyrics can be synchronized or unsynchronized:
unsynchronized lyrics is just the song text as you see it in the booklet of a CD
It's plain text with newlines .
synchronized lyrics is the text plus timing information, which allows media players to show the exact line that is currently being sung. Karaoke depends on this.
In addition to the text lines, timing information is needed - be it for lines or even single words or syllables.
There is a huge number of different formats that allow you to store lyrics/subtitles in separate files.
Let's have a look at MP3 first because tool support is better and there is an official standard for both synchronized and unsynchronized lyrics.
"Official" is not really correct here; the MP3 standard does not define how to store meta data in a file:
The MP3 standards do not define tag formats for MP3 files, nor is there a standard container format that would support metadata and obviate the need for tags.
However, several de facto standards for tag formats exist. As of 2010, the most widespread are ID3v1 and ID3v2, and the more recently introduced APEv2.
The ID3v2 standard has meta tags for both synced and unsynced lyrics:
On Linux, there is kid3 and SYLTeditor (which did not install on Ubuntu 14.04).
For Windows, you have MiniLyrics, SYLTeditor and there once was Window Media Player 11 which could add synchronized lyrics to mp3 files.
kid3-cli can be used on the shell to add lyrics stored in .lrc files to mp3:
$ kid3-cli -c "set SYLT='countdown.lrc' ''" countdown.mp3
Extracting the lyrics via CLI is also possible:
$ kid3-cli -c "get SYLT:/dev/stdout" countdown.mp3
On Linux, there is not a single application
that displays
synchronized lyrics stored in the file when playing
an music track.
As of 2021, only Lollypop supports displaying synchronized lyrics stored in the file when playing an music track. All other players that claim lyrics support either rely on local .lrc files or try to download the lyrics from somewhere on the internet.
On Windows you may use MiniLyrics which reads and displays SYLT data in mp3 files without problems.
Musique and Rhythmbox at least show embedded unsynchronized lyrics.
ogg/vorbis is a patent-free audio codec and thus my preferred choice over mp3.
Tool support for lyrics is nearly non-existent.
A small list of meta data tags for ogg/vorbis is listed in Vorbis I specification: 5.2.2. Content vector format and standalone in comment field and header specification. In addition, the xiph wiki lists proposed field names and links to three websites that propose some additional ones ( 1, 2, 3). Neither of them mentions lyrics.
The topic was mentioned on the vorbis mailing list in 2006 and 2008 with the conclusion that there is no standard, one should try CMML. I did not find any tools, example files or supporting clients for it, though.
OggKate can be used for synchronized lyrics, and kid3 uses the LYRICS tag to store unsyced lyrics in ogg files.
OggText was brainstormed in 2008 as well, but was never brought any further.
In 2008 OggKate, a format for synchronized lyrics in ogg/vorbis files, was invented and implemented.
Kate is an overlay codec, originally designed for karaoke and text, that can be multiplexed in Ogg.
It does not only provide plain text lyrics but also animations, different colors, fonts and other styles.
It is not some data in a meta data tag field, but a separate stream inside an .ogg file, accompanying the music stream (just like movie files have both video and audio streams):
+----------+--------------------------+ | Metadata | Audio stream | +----------+--------------------------+
+----------+--------------------------+ | Metadata | A u d i o s t r e a m | | | L y r i c s s r e a m | +----------+--------------------------+
This has several implications:
✔ When playing the file, the text is available when it needs to be displayed.
No need to allocate extra memory for the lyrics, and no need for additional timing information in the lyrics data.
✔ Interweaving the audio and lyrics data makes it suitable for live audio streams that simply cannot have all the lyrics available at the beginning.
✘ Adding lyrics is not simply setting a tag but breaking up the whole file and re-assembling the whole file.
✘ Extracting lyrics requires reading the whole file and re-assembling the single pieces.
Players will need to do this if they not only want to display the current line or syllable, but provide a glimpse to the following ones.
The 99% standard use case - lyrics for music files of max. 10 minutes length - does not benefit from this format. Even operas with a length of several hours only have about 100kiB data of timed lyrics (LRC), which is nothing for yesterday's hardware.
Another argument for streaming was made on the Xiph MIME Types and File Extensions talk page:
If you want it without the timing, you have to store it in headers, as streaming it will get you the text only as its presentation time is reached.
You could do that if you were loading from a file, but that's only a special case, so it's best to leave that text interleaved with other streams.
A player wanting to display the entirety of the lyrics at once would have to, if possible (eg, if not streaming), scan the entire file to recover the text. Parsing Ogg packets is relatively fast, so a threaded player could do this while starting streaming a file and have the text ready in under a second for a typical song I suppose.
I don't believe the "special case" argument; even when you're playing the middle of a ogg/vorbis file via HTTP you still have to fetch the beginning of the file to get information about the header and general structure.
Creating and reading OggKate streams is done via kateenc and katedec. oggenc's --lyrics only works if kate support is compiled in, which is not the case on Ubuntu 14.04.
The only tool able to display OggKate lyrics streams in audio files I found is VLC 2.2.2, if you start playing and then select the subtitle. (2.1.6 does not detect the subtitle stream at all).
kateenc from libkate-tools on Ubuntu 14.04 allows one to convert .lrc and .srt into kate streams, which then can be muxed into ogg audio files with oggz:
$ kateenc -o lyrics.ogg -t lrc -l en countdown.lrc
$ oggz-merge -o countdown-with-lyrics.ogg countdown.ogg lyrics.ogg
Extracting the lyrics as LRC is possible with katedec:
$ katedec -t lrc oggz-kateenc-countdown.ogg
Playing kate'd ogg/vorbis files works fine on VLC, mplayer, armarok, xine, audacious and ogg123 (even if they do not show the lyrics).
GStreamer-based applications like Rhythmbox and Totem open a new window that looks for extensions that understand "Kate decoder", but fail. Totem plays the file nontheless, but Rhythmbox does not. Amarok 2.8 sometimes opened that window, but also plays the file.
The OggKate author - who never left his name anywhere by the way - provided OggKate patches for several media players:
The patch got included in 2009 into gst-plugins-bad 0.10.
Unfortunately it is not included in gstreamer 1.0 (yet), which explains the installation popup.
There is no officially endorsed vorbis tag/field for unsynchronized lyrics. The only tag in the wild I found was LYRICS which is created by the kid3 editor and lyrico.
We can add it with vorbiscomment from a lyrics text file:
$ vorbiscomment -a file.ogg -t LYRICS="$(cat lyrics.txt)"
$ vorbiscomment --list countdown-unsync-vorbiscomment.ogg
title=Countdown aligned
artist=cweiske
date=2016
genre=Speech
encoder=Lavf53.21.1
LYRICS=ten
nine
eight
seven
six
5
4
3
2
1
0
oggz-comment can also be used to add unsynchronized lyrics to .ogg files:
$ oggz-comment file.ogg -o file-with-lyrics.ogg LYRICS="$(cat lyrics.txt)"
$ oggz-comment -l file-with-lyrics.ogg
Vorbis: serialno 0033215013
Vendor: Lavf53.21.1
title: Countdown aligned
artist: cweiske
date: 2016
genre: Speech
encoder: Lavf53.21.1
LYRICS: ten
nine
eight
seven
six
5
4
3
2
1
0
Both Lollypop and Rhythmbox display them.
Windows Media Audio files support synced and unsynced lyrics in their meta tags. The ASF specification unfortunately does not define meta data tag names and thus also no meta data lyrics formats.
kid3 shows the synchronized lyrics in the .wma file with a tag name of WM/Lyrics_Synchronized.
Windows explorer on Windows XP is able to add unsychronised lyrics, Windows Media Player 11 could write both synchronized and unsynchronized lyrics.
No tool I tested is able to display the lyrics embedded in .wma files while playing music.
exiftool at least shows them on cli, and kid3 notices that there are synchronized lyrics inside - but does not show them.
The Advanced Audio Coding format is mostly used by Apple's iTunes. I saw screenshots of the iTunes meta data editor that had a (unsynchronized) lyrics field. I did not follow this any further.
MiniLyrics claims to support lyrics in .m4a/.aac files.
The list of tools I found that could work with lyrics embedded in audio files, alphabetically sorted:
Clementine is a music player that is able to show unsynchronized lyrics from mp3 files. Does neither support ogg lyrics nor synchronized text.
eyeD3 is a linux command line application that reads and writes mp3 tags, supporting ID3v1, 2.3 and 2.4.
Unfortunately it is not able to extract a single tag in a way that's readable by other programs, and is also not able to extract synchronized lyrics:
songname/content description (TIT2): Countdown aligned>
Hardware and settings used for encoding (TSSE): Lavf53.21.1>
]]>
It is able to add unsynchronized lyrics to mp3 files:
$ eyeD3 --lyrics="eng::ten
nine
eight
seven
six
5
4
3
2
1
0" countdown.mp3
exiftool is the swiss army knife of meta tags. It's able to extract data from most image, document and audio file types.
It shows synchronized lyrics from mp3 and wma files, and unsynchronized from mp3, ogg and wma:
$ exiftool countdown-sync-kid3-id3v2.4.mp3 |grep -i lyr
Synchronized Lyrics Type : Lyrics
Synchronized Lyrics Description :
Synchronized Lyrics Text : [00:00.00].ten, [00:01.00].nine, [00:02.00].eight, [00:03.00].seven, [00:04.00].six, [00:05.00].5, [00:06.00].4, [00:07.00].3, [00:08.00].2, [00:09.00].1, [00:10.00].0, [00:11.00].
$ exiftool countdown-sync-wmp11.wma |grep -i lyr
Lyrics : ten..nine..eight..seven..six..5..4..3..2..1..0
Lyrics Synchronised : ..vsynchronized lyricstennine�.eight�.seven�.six�.5�.4�.3p.2X.1@.0(#
It does not show OggKate texts.
The windows-only Foobar2000 supports plugins, and one of the plugins/"components" is Lyrics Show Panel 3 (foo_uie_lyrics3).
While it claims to be able to read both synced and unsynced lyrics from ogg and mp3 files, it does so by using its own (configurable) meta tag, storing LRC in the tag for synced text. It does not support SYLT/USLT tags.
The meta data editor kid3 runs on Linux and supports mp3, ogg and wma.
It has a usable synced lyrics editor and documentation for it. Importing LRC is supported.
kid3-qt was the only software that actually supported storing unsynced lyrics inside ogg/vorbis files by setting the LYRICS tag.
kid3-cli is a command line tool that can be used to read and write .lrc files from and to mp3 files.
Gnome application Lollypop supports SYLT in mp3 files, at least those that have been added by SYLT Editor, but not those by kid3.
It also reads .lrc files.
lyrico automatically finds and downloads unsynchronized lyrics and is able to embed them into mp3, ogg, wma and m4a files.
It does not support synchronized text.
MiniLyrics is not available for Linux.
It reads synchronized and unsynchronized lyrics from mp3 meta data, but does not support the WMP11 generated lyrics in wma files, nor does it support .ogg. It claims to support M4A (AAC) files, but I did not test that.
It includes an editor for synchronized lyrics and can import LRC files.
Musique version 1.4 is able to read and display unsynchronized lyrics from mp3 files.
oggz-comment from oggz-tools is able to read and write ogg/vorbis meta tags.
See the example how to use it to add unsynchronized lyrics.
Gnome's Rhythmbox displays unsynchronized lyrics in .ogg files because I made a patch for it.
SYLT editor is Freeware for Windows and Linux, but it did not install on Ubuntu 14.04 correctly.
On windows it worked, but proved to not support SYLT lyrics embedded by other editors. It even once did not read SYLT from a file that it wrote itself previously..
I can't recommend it.
VLC was the only application I found able to display OggKate lyrics in .ogg files - when enabling audio visualization, the text is printed on top of that. (version 2.2.2 worked, 2.1.6 did not)
It does not support SYLT, but you can load .srt subtitle files when playing music with audio visualization enabled.
vorbis-comment from vorbis-tools is also able to read and write ogg/vorbis meta tags.
See the example how to use it to add unsynchronized lyrics.
Windows XP's Explorer is able to show and edit meta data of .wma files - and it allows you to add unsynchronized lyrics. You cannot set the lyrics language as you could with Windows Media Player 11, though.
Windows Media Player 11 was available on Window XP and Windows Vista. To my knowledge it is the only application able to add synchronized lyrics to .wma files via its Advanced Tag Editor.
This tag editing capabilities were removed in Windows Media Player 12, much to the dismay of users.
Windows Media Player was not able to actually display the synchronized lyrics, which maybe was the reason for its removal. But the removal of the lyrics editing feature from WMP means that Microsoft officially has given up on lyrics in .wma, and maybe even on .wma itself.
If you ever try to install Windows Media Player 11 on an old copy of Windows XP, you'll notice that it will fail because it cannot prove the XP installation as "genuine" anymore.
You can work around this by manually extracting wmp11-windowsxp-x86-DE-DE.exe with 7-zip and manually executing all the wm*.exe files.
List of hardware music players with lyrics support:
During the course of my research I created a number of audio files with the various tools. As base I used countdown.ogg from Corsica_S's countdown.wav but had to align it to the exact full seconds with Audacity. Then I created a lyrics .lrc file and used the various tools to add lyrics to it.
The following applications miss support for embedded lyrics:
I'm dissatisfied with the state of embedded lyrics support on Linux.
For ogg/vorbis files - of which my music library consists mostly - I did not find a satisfying solution. OggKate is too complex for most needs; something like SYLT for vorbis would be better suited - or even simply embedding LRC into a SYNCLYRICS tag.
The ID3v2 SYLT format is binary and would have to be base64 encoded, as it is done with album art in vorbis files, too.
And then, tool support would again be missing :(
Published on 2016-07-26 in music, tools
While ripping CDs, I noticed that abcde did not use CD-Text that was available on the CD - but that is important if the information is missing from Musicbrainz.
I found a bug report that suggested to install the icedax package that brings a fixed cdda2wav binary.
abcde.conf must also be modified to fall back to cdtext instead of using musicbrainz as only source:
CDDBMETHOD=musicbrainz,cdtext
Now I also know what to do when I manually want to read cd-text on the linux command line:
$ cdda2wav -J -v titles -D /dev/sr0 Type: ROM, Vendor 'ATAPI ' Model 'iHAS524 A ' Revision 'BL2J' MMC+CDDA 569344 bytes buffer memory requested, 4 buffers, 55 sectors #icedax version 1.1.11, real time sched., soundcard, libparanoia support CDINDEX discid: TbQEPRnVPidhqKSD.48c1zlPxVY- CDDB discid: 0xfe104621 CD-Text: detected CD-Extra: not detected Album title: '04: Leben der Ritter / Mächtige Burgen' [from ] Track 1: 'Thema 1: Ritter' Track 2: 'Thema 1: Was sind Ritter?' Track 3: 'Thema 1: Das Training der Ritter' Track 4: 'Thema 1: Was ist ein sogenanntes Gestech?' Track 5: 'Thema 1: Die Ausbildung zu einem Ritter' Track 6: 'Thema 1: Lernen von Manieren und Umgangformen' Track 7: 'Thema 1: Die Nachricht vom Boten' Track 8: 'Thema 1: Der Ritterschlag ' Track 9: 'Thema 1: Aus was besteht die Rüstung?' Track 10: 'Thema 1: Wann lebten die Ritter?' Track 11: 'Thema 1: Aussterben der Ritter' Track 12: 'Thema 1: Große Feste ' Track 13: 'Thema 2: Burgen' Track 14: 'Thema 2: Was ist eine Burg?' Track 15: 'Thema 2: Wann gab es die ersten Burgen?' Track 16: 'Thema 2: Alles aus Stein' Track 17: 'Thema 2: Der Bau einer Burg' Track 18: 'Thema 2: Wie lang dauerte der Bau einer Burg?' Track 19: 'Thema 2: Die Gebäude einer Burg' Track 20: 'Thema 2: Wasser ist wichtig' Track 21: 'Thema 2: Viele Krabbeltiere' Track 22: 'Thema 2: Was passiert in den Werkstätten?' Track 23: 'Thema 2: Der Kerker' Track 24: 'Thema 2: Was ist der Palas?' Track 25: 'Thema 2: Die Fenster' Track 26: 'Thema 2: Das Spielzeug in der Ritterzeit' Track 27: 'Thema 2: Was gab es zum Essen?' Track 28: 'Thema 2: Mit den Fingern essen' Track 29: 'Thema 2: Die Wachen in der Burg' Track 30: 'Thema 2: Angriff' Track 31: 'Thema 2: Viele verschiedene Angriffsmöglichkeiten' Track 32: 'Thema 2: Was ist der Bergfried?' Track 33: 'Thema 2: Das Ende der Ritterzeit'
Published on 2020-11-21 in linux, music
I got an Amazon gift card as birthday present and thus had to spend that money somehow. In the end I bought a music album I did not yet possess as .mp3 files.
Originally I wanted to know if the professionally created mp3 files contain embedded lyrics, and so I looked at the meta data:
$ id3v2 -R 01\ -\ Tim\ McGraw.mp3
PRIV: (unimplemented)
TIT2: Tim McGraw
TPE1: Taylor Swift
TALB: Taylor Swift
TCON: Country (2)
TCOM:
TPE3:
TRCK: 1/15
TYER: 2008
TPE2: Taylor Swift
COMM: ()[eng]: Amazon.com Song ID: 208225224
TCOP: © 2008 Big Machine Records, LLC
TPOS: 1/1
APIC: ()[, 3]: image/jpeg, 315095 bytes
01 - Tim McGraw.mp3: No ID3v1 tag
The PRIV did alert me, and an internet search gave two blog posts that explained the issue:
I could extract the XML with exiftool:
EK5M23vD
Amazon.com
00602517874695
USCJY0603008
0683844761475530868664102416XXXX
8eb80bb9028cbb6caf122dd4984c2b823b82aa0b2cf22b61a369187567dc0ffe
unspecified
Download - Paid
XXXXXXXX==
]]>
So the mp3 can be traced back to me if my computer gets stolen/hacked and the files are uploaded somewhere. A watermark, just as some e-books have them.
I removed the PRIV frames with:
$ eyeD3 --remove-frame PRIV *.mp3
I did not know this until writing this blog post, but some files have watermarks embedded in the sound itself: Universal's Audible Watermark.
Published on 2020-09-20 in kundeistkönig, music
I recently bought a Libratone ZIPP v1 wireless speaker, which lets me play music via UPnP, Bluetooth, 3.5mm audio jack and USB socket.
In preparation for a garden party, I browsed the music library and copied all the files onto a FAT32-formatted USB drive. Then I plugged the drive into the Zipp, and it played the files in the order I copied them onto the USB stick. No randomization.
One solution is to randomize the filenames with fileshuffle. It prepends numbers so the order of files when alphabetical sorted is random:
000. Die Ärzte - Jazz ist anders - 01 - Himmelblau.ogg 001. Freundeskreis - Quadratur Des Kreises - 06 - A-N-N-A.ogg 002. Wincent Weiss - Irgendwas gegen die Stille - 06 - Nur ein Herzschlag entfernt.ogg 003. 04 - Sixpence None The Richer - Sixpence None The Richer - Kiss Me.ogg 004. Sportfreunde Stiller - Die gute Seite - 01 - Wie lange sollen wir noch warten.ogg
This means spending some extra time coping the files onto the flash drive again, because the Zipp plays them in the order that they were created. Renaming files afterwards does not affect the playing order.
A directory with files on a FAT-formatted partition consists of a directory table, an index with meta data for each file in that directory (directory entry). Part of those meta data is the location of the actual file data on disk.
The idea is now to shuffle the contents of the directory table, without moving the file data around. This should be much faster, since it's only a couple of kilobytes to modify instead of writing a gigabyte of music files.
Such a tool already exists: Mike Kazantsev wrote vfat_shuffler that takes a directory, and shuffles the entries in the directory table.
I stumbled across some bugs that he fixed literally within minutes, and now I have a tool in my ~/bin that takes only seconds to randomize the music files:
$ sudo /home/cweiske/bin/vfat_shuffler --umount --list /dev/sdb1 / [ 50758] 2raumwohnung - kommt zusammen - 12 - Wir trafen uns in einem Garten.ogg [ 127272] Wincent Weiss - Irgendwas gegen die Stille - 11 - Wir sind.ogg [ 83266] Annett Louisan - In meiner Mitte - 07 - Auf der Jagd nach Mr. Big.ogg [ 62764] 05 - Positively Somewhere.ogg [ 99569] Liquido - At the rocks - 03 - catch me.mp3 [ 84098] Bad Lamps - Soultronic EP - 01 Never Know the Difference.ogg [ 93508] Green Day - Dookie - 07 - Basket Case.mp3 [ 126940] Wincent Weiss - Irgendwas gegen die Stille - 10 - Wenn mir die Worte fehlen.ogg [ 105385] Milow - North & South - 01 - You and Me (in my pocket).mp3
Published on 2020-09-12 in hardware, music
After years of using the unmaintained MediaTomb UPnP server, I switched to Gerbera. Gerbera builds on the MediaTomb codebase and adds new features like cover images, compiles on current distributions, and is maintained.
Our Dreambox satellite receiver is able to stream radio into the network, but only in the mpeg/ts2 format which no radio supports. I configured Gerbera to use vlc to automatically convert the TS2 streams into mp3 when a radio wants to play them, but after a software update on the home server transcoding ceased to work.
The new working configuration for Gerbera 1.2.0 and VLC 3.0.3-1-0+deb9u1:
audio/mpeg
yes
yes
no
]]>
Some parameters are the result of me trying to minimize the amount of lines that get written into the gerbera log file.
vlcpulse audio output error: PulseAudio server connection failure: Connection refused
Solution: --aout alsa.
dbus interface error: Failed to connect to the D-Bus session daemon: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11
Solution: --no-dbus
What stays are the following lines:
main interface error: no suitable interface module main libvlc error: interface "globalhotkeys,none" initialization failed dummy interface: using the dummy interface module... dummy mux: Open
Unfortunately, there is no way to get rid of those. Using --quiet also hides errors which is not something that I want.
That ticket #5047 also does not give me much hope that this will become any better in the future.
Published on 2018-12-27 in music, upnp
I'm using an old Raspberry Pi 1 as UPnP music player for my stereo, but had a) cracks when starting playing music the first time after booting up and b) bad overall sound quality when playing music and radio plays.
Many people fixed that problem by buying a cheap USB sound card and using that on their RPi1, and this is what I did. I paid 2€ on ebay and got it 5 days later. (I could have paid 1 US$ on aliexpress, but that would have taken 2 months of shipping time.)
The Debian 9 running on the Pi detected the USB sound card without problems, but I needed to tell alsa to make the USB card default. aplay -l told me the USB card is number 1, so I created /etc/asound.conf:
pcm.!default { type hw card 1 } ctl.!default { type hw card 1 }
When testing that with aplay, I found out that the cheap sound card only supports stereo, not mono:
$ aplay /usr/share/sounds/alsa/Front_Right.wav
Playing WAVE '/usr/share/sounds/alsa/Front_Right.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Mono
aplay: set_params:1305: Channels count non available
$ aplay -D plughw:1,0 /usr/share/sounds/alsa/Noise.wav
(works)
I experimented with different settings until I finally found the solution in the archlinux forums:
pcm.!default { type plug slave { pcm "hw:1,0" } } ctl.!default { type hw card 1 }
I'm using gmrender-resurrect as UPnP renderer, and it did not automatically use the default ALSA card - despite its --gstout-audiodevice=sysdefault option.
With aplay -L (note the uppercase L) I found the card name that I could use and adjusted the systemd init file to use the following options:
--gstout-audiosink=alsasink --gstout-audiodevice=hw:CARD=Device,DEV=0
No cracks anymore! Good sound quality!
Published on 2018-01-31 in linux, music
Because I want to re-purpose my my Banana Pi, I switched to an old Raspberry Pi 1 as UPnP renderer for the stereo system in the living room.
Since most of the day the power strip is switched off, I wanted the Raspberry Pi to boot as fast as possible - so that we don't have to wait for too long to be able to use it after powering on.
I used systemd-analyze to check what slows down the boot, and saw:
$ systemd-analyze Startup finished in 3.143s (kernel) + 1min 31.686s (userspace) = 1min 34.830s $ systemd-analyze blame 12.246s dhcpcd.service 6.185s dev-mmcblk0p2.device 3.501s networking.service ...
At first I switched from DHCP to a static IP by adding the following to /etc/dhcpcd.conf:
interface enxb827eb9e8acf
static ip_address=192.168.3.36/24
static routers=192.168.3.3
static domain_name_servers=192.168.3.3
(The network interface name can be found with ifconfig.)
After rebooting I saw that the dhcpcd startup had dropped from 12 seconds to 7! But that's still too long for static network configuration.
The log told me why the DHCP client daemon took so long:
$ journalctl ... Jan 20 22:26:44 raspistereo dhcpcd[256]: enxb827eb9e8acf: carrier acquired Jan 20 22:26:44 raspistereo dhcpcd[256]: enxb827eb9e8acf: probing address 192.168.3.36/24 Jan 20 22:26:49 raspistereo dhcpcd[256]: enxb827eb9e8acf: using static address 192.168.3.36/24 ...
It spent 5 seconds checking if someone else in the network is using the same IP address. That's something I do not need, so I disabled it in /etc/dhcpcd.conf, together with IPv6 that I don't need in my internal network:
noarp
ipv4only
noipv6
Rebooting and ... 2.2 seconds for dhcpcd. That's 10 seconds faster now. gmediarenderer is available after 16 seconds now:
$ systemd-analyze critical-chain gmrender.service gmrender.service +1.527s └─sound.target @14.714s
(I'd like to have 2-3 seconds boot time, but the current state is acceptable.)
Published on 2018-01-21 in linux, music
When I wrote the Embedded lyrics article, I learned about lyrico. It is a tool to download (unsynchronized) lyrics from several sources on the internet for your whole music collection, and can put them into text files or directly into the meta tags of the music files.
Unfortunately it was hard to use:
It stored the configuration file in the same directory as its code is stored, and it wrote the configuration file everytime you started it.
And it failed hard if there was no config file at all. That made it impossible to install it system-wide and run it without root access.
You had to define the music library directory at first, even though you could also pass it from command line - which would then overwrite the previously set source directory.
Altogether it was that strange behavior that prevented me from using lyrico.
Because it would not fix itself, I sat down two evenings and rewrote the configuration parser, let it automatically create config files if there are none and use the correct user application config directory via the appdirs package. And made it work with UTF-8 characters in file and directory names.
Now lyrico works the way it should, and I can use it to add lyrics into all my music files - see my fork. How nice that Rhythmbox reads the lyrics tags now.
Published on 2017-07-26 in music, tools
Last year I discovered that there is nearly no support for embedded lyrics in Linux media players.
At work I mainly use Rhythmbox to play music, so there was an itch to scratch: I desperately wanted to have it read lyrics from the meta data of my ogg/vorbis music files.
I found Gnome bug #463978 which is open since 2007, and soon has its tenth anniversary - the request to support embedded lyrics.
On IRC I talked to Rhythmbox' maintainer Jonathan Matthew (moch) who gave me some hints and reviewed my patches. The third patch version was accepted and committed into Rhythmbox' Git repository.
So, the next Rhythmbox release (3.5.0 or 3.4.2) will read lyrics directly from ogg/vorbis files, using the LYRICS and SYNCLYRICS tags.
Lyrics in MP3 ID3 tags (SYLT/USLT) is still missing, because GStreamer does not support that yet.
Published on 2017-07-17 in music, tools