QMediaPlayer stuck on loading media - qt5

I want to play an audio file (tested .wav, .mp3, .flac)using QMediaPlayer from the console application on embedded iMX8 device with Yocto HardKnott system. I'm testing code from Qt doc. It work's fine on PC, but it doesn't on the embedded device. It stuck with Media Status: QMediaPlayer::LoadingMedia without any error. I guess that it's something in the system. Playing media from console it's possible using aplay command. What can be a reason? How can I fix it?
QMediaPlayer *player = new QMediaPlayer;
QObject::connect(player, &QMediaPlayer::positionChanged, [=](qint64 position){
qDebug()<< "Current position: " << position;
});
QObject::connect(player, &QMediaPlayer::mediaStatusChanged, [=](QMediaPlayer::MediaStatus status){
qDebug()<< "Media Status: " << status;
});
player->setMedia(QUrl::fromLocalFile("/home/root/test.wav"));
player->setVolume(100);
player->play();
I tried debug Qt plugins on my platform, but I don't see any problem
QFactoryLoader::QFactoryLoader() checking directory path "/usr/lib/plugins/mediaservice" ...
QFactoryLoader::QFactoryLoader() looking at "/usr/lib/plugins/mediaservice/libgstaudiodecoder.so"
Found metadata in lib /usr/lib/plugins/mediaservice/libgstaudiodecoder.so, metadata=
{
"IID": "org.qt-project.qt.mediaserviceproviderfactory/5.0",
"MetaData": {
"Keys": [
"gstreameraudiodecode"
],
"Services": [
"org.qt-project.qt.audiodecode"
]
},
"archreq": 0,
"className": "QGstreamerAudioDecoderServicePlugin",
"debug": false,
"version": 331520
}
Got keys from plugin meta data ("gstreameraudiodecode")
QFactoryLoader::QFactoryLoader() looking at "/usr/lib/plugins/mediaservice/libgstcamerabin.so"
Found metadata in lib /usr/lib/plugins/mediaservice/libgstcamerabin.so, metadata=
{
"IID": "org.qt-project.qt.mediaserviceproviderfactory/5.0",
"MetaData": {
"Keys": [
"gstreamercamerabin"
],
"Services": [
"org.qt-project.qt.camera"
]
},
"archreq": 0,
"className": "CameraBinServicePlugin",
"debug": false,
"version": 331520
}
Got keys from plugin meta data ("gstreamercamerabin")
QFactoryLoader::QFactoryLoader() looking at "/usr/lib/plugins/mediaservice/libgstmediacapture.so"
Found metadata in lib /usr/lib/plugins/mediaservice/libgstmediacapture.so, metadata=
{
"IID": "org.qt-project.qt.mediaserviceproviderfactory/5.0",
"MetaData": {
"Keys": [
"gstreamermediacapture"
],
"Services": [
"org.qt-project.qt.audiosource"
]
},
"archreq": 0,
"className": "QGstreamerCaptureServicePlugin",
"debug": false,
"version": 331520
}
Got keys from plugin meta data ("gstreamermediacapture")
QFactoryLoader::QFactoryLoader() looking at "/usr/lib/plugins/mediaservice/libgstmediaplayer.so"
Found metadata in lib /usr/lib/plugins/mediaservice/libgstmediaplayer.so, metadata=
{
"IID": "org.qt-project.qt.mediaserviceproviderfactory/5.0",
"MetaData": {
"Keys": [
"gstreamermediaplayer"
],
"Services": [
"org.qt-project.qt.mediaplayer"
]
},
"archreq": 0,
"className": "QGstreamerPlayerServicePlugin",
"debug": false,
"version": 331520
}
Got keys from plugin meta data ("gstreamermediaplayer")
QFactoryLoader::QFactoryLoader() checking directory path "/opt/platform-benchmark_app/bin/mediaservice" ...
loaded library "/usr/lib/plugins/mediaservice/libgstmediaplayer.so"
QMediaPluginLoader: loaded plugins for key "org.qt-project.qt.mediaplayer" : ("gstreamermediaplayer")
QFactoryLoader::QFactoryLoader() checking directory path "/usr/lib/plugins/resourcepolicy" ...
QFactoryLoader::QFactoryLoader() checking directory path "/opt/platform-benchmark_app/bin/resourcepolicy" ...

The problem was in the system image and lack of gstreamer1.0 packets. It works separately, but it doesn't with Qt Multimedia. The solution is to add packet group gstreamer1.0 and gstreamer1.0-full to fsl image recipe.
CORE_IMAGE_EXTRA_INSTALL += " \
...
packagegroup-fsl-gstreamer1.0 \
packagegroup-fsl-gstreamer1.0-full \
...
"

Related

Composer require private repository from gitlab ssh ignored

I'm trying to pull a private repository from gitlab with composer without any success.
This is what I have in my composer.json file under repositories:
"repositories": [
{
"type": "vcs",
"url": "git#gitlab.com:the-vendor/dashboard-api.git"
}
]
When I clone the project like this: git#gitlab.com:the-vendor/dashboard-api.git manually, everything works fine.
Now when I require the project like so:
"require": {
"the-vendor/dashboard": "dev-orchestrate"
}
I also tried: "dev-main", "dev-main#dev", "dev-orchestrate#dev".
And run: composer update the-vendor/dashboard I get the following error:
Failed to download the-vendor/dashboard-api:The "https://gitlab.com/api/v4/projects/joij%2Fdashboard-api" file could not be downloaded (HTTP/2 404 ):
{"message":"404 Project Not Found"}
Your credentials are required to fetch private repository metadata (git#gitlab.com:the-vendor/dashboard-api.git)
A token will be created and stored in "/root/.composer/auth.json", your password will never be stored
To revoke access to this token you can visit https://gitlab.com/-/profile/personal_access_tokens
Username:
Installation failed, reverting ./composer.json and ./composer.lock to their original content.
I'm not sure what to make of this. Composer should be able to clone the project through ssh. But instead I get that vague 404 and then I have to give my username and password.
I also tried this:
"repositories": [
{
"type": "git",
"url": "git#gitlab.com:the-vendor/dashboard-api.git"
}
]
But then it behaves as if there is no "repositories" in the composer json at all, and I get this error:
Problem 1
- Root composer.json requires the-vendor/dashboard, it could not be found in any version, there may be a typo in the package name.
Potential causes:
- A typo in the package name
- The package is not available in a stable-enough version according to your minimum-stability setting
see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.
- It's a private package and you forgot to add a custom repository to find it
Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.
This is the composer.json of the dashboard-api:
{
"name": "the-vendor/dashboard",
"type": "project",
"description": "TheVendor Dashboards",
"keywords": ["framework", "laravel"],
"license": "proprietary",
"require": {
"php": "^8.1",
"elasticsearch/elasticsearch": "v7.17.0",
"guzzlehttp/guzzle": "^7.2",
"laravel/framework": "^9.2",
"laravel/sanctum": "^2.14.1",
"laravel/tinker": "^2.7",
"ext-pdo": "*"
},
"require-dev": {
"fakerphp/faker": "^1.9.1",
"laravel/sail": "^1.0.1",
"mockery/mockery": "^1.4.4",
"nunomaduro/collision": "^6.1",
"phpunit/phpunit": "^9.5.10",
"phpspec/prophecy": "1.15.0",
"spatie/laravel-ignition": "^1.0"
},
"autoload": {
"psr-4": {
"TheVendor\\Dashboard\\": "app/",
"Database\\Factories\\": "database/factories/",
"Database\\Seeders\\": "database/seeders/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"scripts": {
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"#php artisan package:discover --ansi"
],
"post-update-cmd": [
"#php artisan vendor:publish --tag=laravel-assets --ansi --force"
],
"post-root-package-install": [
"#php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"#php artisan key:generate --ansi"
]
},
"extra": {
"laravel": {
"providers": [
"TheVendor\\Dashboard\\Providers\\AppServiceProvider",
"TheVendor\\Dashboard\\Providers\\ESClientServiceProvider",
"TheVendor\\Dashboard\\Providers\\ESCreateIndexesServiceProvider"
],
"dont-discover": []
}
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true
},
"minimum-stability": "dev",
"prefer-stable": true
}
I wonder if anyone knows what I'm missing.
Alright! I found the problem. There is no need to go for an auth.json with an API Token. This is where I went wrong:
The main branch had a different package name! The branch I was trying to pull had the right one, but if the main composer.json has a different package name you get this error:
Root composer.json requires the-vendor/dashboard, it could not be found in any version, there may be a typo in the package name.
Once you have that, and require the package like this:
"require": [
"the-vendor/dashboard": "dev-orchestrate"
]
With this in the root of composer.json
"repositories": [
{
"type": "git",
"url": "git#gitlab.com:the-vendor/dashboard-api.git"
}
]
It will simply use ssh to clone the private repository

semantic-release in a GitLab pipeline with multiple users

I'm running a semantic-release job in a GitLab pipeline, it works great but only for my user (I configured it). No one else seems able to trigger a release, even if I merge their code. No errors, everything seems to run smoothly. I'm assuming there's some kind of authentication issue and/or everyone needs their own token or something like that? (I've only configured a token via my account and I'm not sure how I'd instruct someone to do that for multiple accounts in GitLab.)
The pipeline looks like this:
variables:
GL_TOKEN: $GL_TOKEN
stages:
- release
publish:
image: node:lts-alpine
stage: release
before_script:
- apk update
- apk add zip unzip git
- npm ci
script:
- npm run build
- npx semantic-release
only:
refs:
- main
and the config (in the package.json) is:
"release": {
"branches": [
"main"
],
"plugins": [
"#semantic-release/commit-analyzer",
"#semantic-release/release-notes-generator",
[
"#google/semantic-release-replace-plugin",
{
"replacements": [
{
"files": [
"style.css"
],
"from": "Version: .*",
"to": "Version: ${nextRelease.version}",
"results": [
{
"file": "style.css",
"hasChanged": true,
"numMatches": 1,
"numReplacements": 1
}
],
"countMatches": true
},
{
"files": [
"package.json"
],
"from": "\"version\": \".*\",",
"to": "\"version\": \"${nextRelease.version}\",",
"results": [
{
"file": "package.json",
"hasChanged": true,
"numMatches": 1,
"numReplacements": 1
}
],
"countMatches": true
}
]
}
],
[
"#semantic-release/git",
{
"assets": [
"style.css",
"package.json"
],
"message": "chore(release): ${nextRelease.version} [skip ci]"
}
],
[
"#semantic-release/exec",
{
"prepareCmd": "node bin/makezip.js"
}
],
[
"#semantic-release/gitlab",
{
"assets": [
{
"path": "file.zip",
"label": "compiled release"
}
]
}
]
]
}
I would suggest creating token per project and using that instead of your personal token.
You can create project token from project Settings > Access Token
This should solve your issue.

is there any rest API in bitbucket which can download the file at particular commit?

I know about this API
/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/browse/{path:.*}?at={commitId}
But with this API for binary files we get this response
{
"binary": true,
"path": {
"components": [
"src",
"log-output.7z"
],
"parent": "src",
"name": "log-output.7z",
"extension": "7z",
"toString": "src/log-output.7z"
}
}
For text files we get this response
{
"lines": [
{
"text": "abcd"
}
],
"start": 0,
"size": 1,
"isLastPage": true
}
I can re-create files with API response for text but is there any way to download the binary file or to get their size ?

AWS Code Build - cached DOWNLOAD_SOURCE taking too long

I am trying to improve the build speed of one of my projects on CodeBuild. The project uses a Github source provider and source caching of type local is enabled.
The first time I ran the build it took 103 secs. I ran it again immediately after the first one finished expecting it to run in a few seconds due to source caching, but it took 60 secs.
What I am missing here? Is the cache not working? If it is working, why does it take that long on the second run?
Thanks
Project Details:
{
"projectsNotFound": [],
"projects": [
{
"environment": {
"computeType": "BUILD_GENERAL1_LARGE",
"imagePullCredentialsType": "SERVICE_ROLE",
"privilegedMode": true,
"image": "111669150171.dkr.ecr.us-east-1.amazonaws.com/***********/ep-build-env:latest",
"environmentVariables": [
{
"type": "PLAINTEXT",
"name": "NEXUS_URI",
"value": "http://***************"
},
{
"type": "PLAINTEXT",
"name": "REGISTRY",
"value": "111669150171.dkr.ecr.us-east-1.amazonaws.com/*********"
}
],
"type": "LINUX_CONTAINER"
},
"timeoutInMinutes": 60,
"name": "StorefrontApi",
"serviceRole": "arn:aws:iam::111669150171:role/CodeBuild-ECRReadOnly",
"tags": [],
"artifacts": {
"type": "NO_ARTIFACTS"
},
"lastModified": 1571227097.581,
"cache": {
"type": "LOCAL",
"modes": [
"LOCAL_DOCKER_LAYER_CACHE",
"LOCAL_SOURCE_CACHE",
"LOCAL_CUSTOM_CACHE"
]
},
"vpcConfig": {
"subnets": [
"subnet-fd7f958b"
],
"vpcId": "vpc-71e3f414",
"securityGroupIds": [
"sg-19b65e6c",
"sg-9e28e9f9"
]
},
"created": 1571082681.262,
"sourceVersion": "refs/heads/ep-mysql",
"source": {
"buildspec": "version: 0.2\n\nphases:\n build:\n commands:\n - env\n - cd extensions\n - mvn --settings $CODEBUILD_SRC_DIR_DEVOPS_WINE/pipelines/storefront/build-war/settings.xml --projects storefront/ext-storefront-webapp -am -DskipAllTests clean install\n\nartifacts:\n secondary-artifacts:\n storefront-war:\n base-directory: $CODEBUILD_SRC_DIR/extensions/storefront/ext-storefront-webapp/target\n files:\n - \"*.war\"\n\ncache:\n paths:\n - '/root/.m2/**/*'\n - '/root/.npm/**/*'",
"insecureSsl": false,
"gitSubmodulesConfig": {
"fetchSubmodules": false
},
"location": "https://github.com/*****************.git",
"gitCloneDepth": 1,
"type": "GITHUB",
"reportBuildStatus": false
},
"badge": {
"badgeEnabled": false
},
"queuedTimeoutInMinutes": 480,
"secondaryArtifacts": [],
"logsConfig": {
"s3Logs": {
"status": "DISABLED",
"encryptionDisabled": false
},
"cloudWatchLogs": {
"status": "ENABLED"
}
},
"secondarySources": [
{
"insecureSsl": false,
"gitSubmodulesConfig": {
"fetchSubmodules": false
},
"location": "https://github.com/*****************.git",
"sourceIdentifier": "DEVOPS_WINE",
"gitCloneDepth": 1,
"type": "GITHUB",
"reportBuildStatus": false
}
],
"encryptionKey": "arn:aws:kms:us-east-1:111669150171:alias/aws/s3",
"arn": "arn:aws:codebuild:us-east-1:111669150171:project/StorefrontApi",
"secondarySourceVersions": [
{
"sourceVersion": "refs/heads/staging",
"sourceIdentifier": "DEVOPS_WINE"
}
]
}
]
}
Apparently, at time of writing, CodeBuild does not use the native git client to fetch the source from GitHub. I understand that the CodeBuild internal teams have an internal feature request to move from whatever they're using to the native git client to improve performance.
Does your repository, by change, have lots of large files in its history? You can use this answer for a command to run to analyze your repository.
If you have lots of large files in your history and you're able to remove them, you can then use a tool like BFG Repo Cleaner to rewrite history. That should speed up the DOWNLOAD_SOURCE phase.
Also, if you have a dedicated support plan with AWS, you should reach out to your TAM to upvote the feature request to move to native git for GitHub source downloads.

How to exclude files from bundling in aurelia.json

I'd like to prevent src/config.js to be bundled in scripts/app-bundle.js
I saw that previously the syntax was:
"bundles": {
"dist/app-build": {
"includes": [
"[**/*.js]",
"**/*.html!text",
"**/*.css!text",
"cloneya",
"dexie",
"jquery",
"jquery-ui",
"medium-editor-webpack",
"moment",
"polymer/mutationobservers",
"safe-json-stringify"
],
excludes: [
"config.js" // So our wildcard globbing doesn't include this config file
],
...
However the new syntax is different: aurelia.json:
"bundles": [
{
"name": "app-bundle.js",
"source": [
"[**/*.js]",
"**/*.{css,html}"
],
"excludes" : [
"**/config.js"
]
},
My temptative 'exclude' statement doesn't do the trick
Solution is actually given on the GitHub page: https://github.com/aurelia/cli
Optionally, you can define an exclude list by setting the source
property to be an object containing both an include and exclude array
of patterns. This is helpful when you're trying to define multiple
bundles from your source code.
{
"name": "app-bundle.js",
"source": {
"include": [
"[**/*.js]",
"**/*.{css,html}"
],
"exclude": [
"**/sub-module/**/*",
]
}
},
{
"name": "sub-module-bundle.js",
"source": [
"**/sub-module/**/*",
]
}
Make sure you have version > 0.19.0