Pluginmanager fails to find any plugins in linux

64 visualizaciones (últimos 30 días)
Jeff Mandel
Jeff Mandel el 8 de Nov. de 2024 a las 20:21
Respondida: Jeff Mandel el 1 de Dic. de 2024 a las 18:21
I have MATLAB 2024b installed on Ubuntu 24.04.1. I have gstreamer1 and mpg123:
gst-inspect-1.0 mpg123
Plugin Details:
Name mpg123
Description mp3 decoding based on the mpg123 library
Filename /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstmpg123.so
Version 1.24.2
License LGPL
Source module gst-plugins-good
Documentation https://gstreamer.freedesktop.org/documentation/mpg123/
Source release date 2024-04-09
Binary package GStreamer Good Plugins (Ubuntu)
Origin URL https://launchpad.net/ubuntu/+source/gst-plugins-good1.0
mpg123audiodec: mpg123 mp3 decoder
I have libsnd1 installed:
apt list libsndfile1 libsndfile1-dev
libsndfile1-dev/noble,now 1.2.2-1ubuntu5 amd64 [installed]
libsndfile1/noble,now 1.2.2-1ubuntu5 amd64 [installed]
In matlab, I try:
>> import multimedia.internal.audio.file.PluginManager;
>> PluginManager.getInstance.WriteableFileTypes
ans =
0x1 empty cell array
Exploring further, I see:
>> PluginManager.getInstance.getPluginForWrite("test.mp3")
Error using multimedia.internal.audio.file.PluginManager/getPluginForWrite (line 58)
Audio file I/O requires libsndfile.
Install this on your system and restart MATLAB.
I have libsndfile, and I can confirm that matlab finds it:
sudo auditctl -a always,exit -F arch=b64 -S openat -S open -F dir=/usr -k usr
matlab
>> import multimedia.internal.audio.file.PluginManager;
>> PluginManager.getInstance.getPluginForWrite("test.mp3")
>> exit
sudo ausearch -k usr | grep libsndfile
type=PATH msg=audit(1731096294.780:179509): item=0 name="/usr/local/lib/libsndfile.so.1" inode=566340 dev=fc:03 mode=0100755 ouid=0 ogid=0 rdev=00:00 nametype=NORMAL cap_fp=0 cap_fi=0 cap_fe=0 cap_fver=0 cap_frootid=0
I know this issue has been raised before, ( https://www.mathworks.com/matlabcentral/answers/1842843-how-do-i-download-gstreamer-into-matlab-it-is-on-my-computer ), and there is a suggestion that export PATH=/path/to/gstreamer/bin:$PATH might be the solution, but I've placed the location to the gstreamer libraries (/usr/lib/x86_64-linux-gnu/gstreamer-1.0) in both PATH and LD_LIBRARY_PATH without any effect. Note that on my Mac, I see:
>> import multimedia.internal.audio.file.PluginManager;
>> PluginManager.getInstance.WriteableFileTypes
ans =
8×1 cell array
{'flac'}
{'m4a' }
{'mp3' }
{'mp4' }
{'oga' }
{'ogg' }
{'opus'}
{'wav' }
Is there something I'm missing?
  1 comentario
Pramil
Pramil el 21 de Nov. de 2024 a las 9:45
Working for me just fine. Are there any other reproduction steps ?

Iniciar sesión para comentar.

Respuesta aceptada

Jeff Mandel
Jeff Mandel el 1 de Dic. de 2024 a las 18:21
OK, I revisited this after a few apt upgrades and reboots, and now:
>> PluginManager.getInstance.WriteableFileTypes
ans =
6x1 cell array
{'flac'}
{'mp3' }
{'oga' }
{'ogg' }
{'opus'}
{'wav' }
So I try:
>> PluginManager.getInstance.getPluginForWrite("test.mp3")
Error using multimedia.internal.audio.file.PluginManager/getPluginForWrite (line 58)
The file type is not supported
Looking carefully at what you posted, I noticed single quote vs. double quotes. So:
>> PluginManager.getInstance.getPluginForWrite('test.mp3')
ans =
'/usr/local/MATLAB/R2024b/toolbox/shared/multimedia/bin/glnxa64/audio/libmwaudiofilesndfilewriterplugin.so'
Oddly
>> PluginManager.getInstance.getPluginForRead("test.mp3")
ans =
'/usr/local/MATLAB/R2024b/toolbox/shared/multimedia/bin/glnxa64/audio/libmwaudiofilesndfilereaderplugin.so'
Looking in $MATLABROOT/toolbox/shared/multimedia/+multimedia/+internal/+audio/+file/PluginManager.m, both of these routines simply call the routine matlab.internal.audioPluginManager. So why 'getPluginForRead' tolerates double quotes and 'getPluginForWrite' doesn't is a mystery to me. So returning to the original problem I was trying to solve:
>> [y,Fs] = audioread('weight.mp3') ;
>> audiowrite('test.mp3',y,Fs);
>> audiowrite("test.mp3",y,Fs);
Works on both Mac and Linux. Which is fine.
So if someone at MathWorks is bothered by this, passing char(fileToRead) to matlab.internal.audioPluginManager in PluginManager.m will avoid this issue.

Más respuestas (0)

Etiquetas

Productos


Versión

R2024b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by