I made a basic mediaplayer, it automatically loads my favourite stream, GrooveSalad from somafm.com.
Please note, the artist name…
My player has no buttons, only a display. My display reveals stream details, track name, artist name, bit rate, transport type, description, etc…all this without ANY stuttering. Comparing this to Jolla Mediaplayer is like comparing night and day.
I’m going to go out on a limb here and say, I think the code in jolla-mediaplayer for data streams needs to be rewritten. I made plenty of mistakes making my basic player, where the stream stuttered or did not even get started, I eventually got it right, my player does not stutter, ok, maybe once when getting started.
My first car dashboard I built for my Xperia 10II included a media player, could I get it to stream properly with metadata?, nope!, it stuttered (sound familiar?), kept stuttering and eventually settled after many minutes, with occasional dropouts. If I disabled the metadata stream, the stuttering was completely eradicated, so I can’t help but think Jolla should take a fresh look at how their mediaplayer deals with metadata.
One thing I notice; jolla-mediaplayer displays UNKNOWN ARTIST for SomaFM’s Groove Salad stream, where as my mediaplayer DOES show the artists name and without stuttering.
I don’t think there is any need to tinker with anything (i.e. renice) except the code chunks that deal with metadata streaming.
My code for metadata retrieval;
import QtQuick 2.6
import Sailfish.Silica 1.0
import QtGraphicalEffects 1.0
import QtMultimedia 5.6
Page {
allowedOrientations: Orientation.Landscape | Orientation.LandscapeInverted
Rectangle {
id: padding
radius: 40
color: "dodgerblue"
width: 1600; height: 180
anchors.centerIn: parent
border { width: 2; color: "gold" }
Rectangle {
id: screen
color: "dodgerblue"
width: 1500; height: 160
clip: true; radius: 40
anchors.centerIn: parent
Label {
id: printer
property int i
property string sourceText: title.text + " " + audioBitRate.text + " " + audioCodec.text + " " + publisher.text + " " + genre.text
function type() {
text = sourceText.slice(0, ++i);
if (text === sourceText)
printer.text = text;
}
color: "#a0090909"
anchors.verticalCenter: screen.verticalCenter
font { pixelSize: 72; bold: true; italic: false }
NumberAnimation on x {
id: animation
duration: 30000
from: screen.width
to: -screen.width*3
alwaysRunToEnd: true
loops: Animation.Infinite
}
Timer {
id: timer; interval: 100
repeat: true; running: true
onTriggered: printer.type()
}
MediaPlayer {
id: player; source: "https://ice4.somafm.com/groovesalad-128-mp3"
}
Component.onCompleted: player.play()
Item {
id: conveyor
visible: false
smooth: true; antialiasing: true
anchors.verticalCenter: parent.verticalCenter
Label { id: title; text: player.metaData.title ? player.metaData.title : " " }
Label { id: audioBitRate; text: player.metaData.audioBitRate ? Math.max(player.metaData.audioBitRate/1000).toFixed(0) + " kbps": " " }
Label { id: audioCodec; text: player.metaData.audioCodec ? player.metaData.audioCodec : " " }
Label { id: publisher; text: player.metaData.publisher ? player.metaData.publisher : " " }
Label { id: genre; text: player.metaData.genre ? player.metaData.genre : " " }
}
}
DropShadow {
source: printer; anchors.fill: printer
verticalOffset: 6; horizontalOffset: -6
color: "#a0494949"; samples: 17; radius: 8.0
}
}
}
}