vdellamea / jamulus-server-remote

A web-based remote for Jamulus server
17 stars 8 forks source link

AutoMix error #1

Open ve3meo opened 3 years ago

ve3meo commented 3 years ago

Hi Vincenzo,

I installed the Experimental AutoMix but get the following error in the web browser list when trying either AutoMix or Consolidate:

FFPROBE:ffprobe -show_entries stream=duration -of compact=p=0:nk=1 -v 0 /home/jamulus/recording//Jam-20210206-042158053/Tom_H___Tenor-24_235_235_x_22176-1-2.wav FFPROBE:ffprobe -show_entries stream=duration -of compact=p=0:nk=1 -v 0 /home/jamulus/recording//Jam-20210206-042158053/ZoomBridge-24_235_235_x_1024-0-2.wav Jam-20210206-042158053 69M

There is just the one session file listed when the list is refreshed with three blank lines above it.

In the /home/jamulus/recording folder there are these three files: 20210206.zip consolidated-20210208.zip Jam-20210206-042158053

The consolidated and mix folders are empty.

What appears to be happening is that the consolidated zip file is created in the recording folder with the path to the WAV files but there are no WAV files included.

vdellamea commented 3 years ago

Thanks for the report. The first thought is: are the consolidated and mix folders set with the privileges described in the docs? One test you can do that provides much more output is to run automix from command line, e.g.

sudo php /var/www/html/automix.php single /home/jamulus/recording/Jam-20210206-042158053/

This should generate a Jam-20210206-042158053.mp3 file in the current directory. Let's start with this. No need for sudo if the current directory is owned by the user (i.e. /home/ubuntu)

ve3meo commented 3 years ago

[Thought I had posted the following yesterday so I was puzzled that you were asking me to run it from the command line when I had already done so! But I had left the post in preview mode until now.]

I ran automix from the system prompt and get warnings, notices and error messages. The ones in bold were in red on the terminal:

root@ganaraskals:/var/www/html# php automix.php single /home/jamulus/recording/Jam-20210208-223901003 AUTOMIX 0.5 - part of Jamulus Recording Remote Generating automix for session /home/jamulus/recording/Jam-20210208-223901003. PHP Warning: mkdir(): File exists in /var/www/html/automix.php on line 60 FFPROBE:ffprobe -show_entries stream=duration -of compact=p=0:nk=1 -v 0 /home/jamulus/recording/Jam-20210208-223901003/Tom_H_Tenor-24_235_235_x_22175-0-2.wav PHP Notice: Undefined variable: audionorm in /var/www/html/automix.php on line 291 Guessed Channel Layout for Input Stream #0.0 : stereo Input #0, wav, from '/home/jamulus/recording/Jam-20210208-223901003/TomHTenor-24_235_235_x_22175-0-2.wav': Duration: 00:00:33.07, bitrate: 1536 kb/s Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 48000 Hz, stereo, s16, 1536 kb/s [Parsed_aformat_0 @ 0x559991b43b40] Option 'cl' not found [AVFilterGraph @ 0x559991b43f40] Error initializing filter 'aformat' with args 'sample_fmts=s16:sample_rates=48000:cl=stereo' Error initializing complex filters. Option not found PHP Notice: Undefined variable: tracks in /var/www/html/automix.php on line 105 PHP Warning: sizeof(): Parameter must be an array or an object that implements Countable in /var/www/html/automix.php on line 105 PHP Notice: Undefined variable: offset in /var/www/html/automix.php on line 109 PHP Notice: Undefined variable: channels in /var/www/html/automix.php on line 112 PHP Warning: Invalid argument supplied for foreach() in /var/www/html/automix.php on line 112 PHP Notice: Undefined variable: left in /var/www/html/automix.php on line 157 PHP Notice: Undefined variable: right in /var/www/html/automix.php on line 158 PHP Notice: Undefined variable: inputs in /var/www/html/automix.php on line 162

root@ganaraskals:/var/www/html#

vdellamea commented 3 years ago

Ok, thanks. One thing I found is that there exist variants of ffmpeg with slightly different sets of options, not always documented. PHP notices are not relevant, I will remove them in the final version. Can you run ffmpeg -version ?

ve3meo commented 3 years ago

Where should config.php be located? I have two: ./var/www/html/config.php // this is the one with the added AUTOMIX section ./root/jamulus-server-remote-main/config.php // this is the same as the original, NO AUTOMIX I understood from the README.MD that ./var/www/html/config.php is the only place that edits affected the server and that no server restart is necessary.

I don't understand in automix.php: if($AUDIONORMALIZATION==true) $audionorm=", dynaudnorm=t=0.1 "; // if($AUDIONORMALIZATION==true) $audionorm=", loudnorm=tp=0.0, aresample=48000"; $command="ffmpeg -hide_banner $inputs $silence". " -filter_complex \"$delays $silencedelay $amix". $silenceamix."concat=n=$total:v=0:a=1 $audionorm". "\" $outname\n"; $AUDIONORMALIZATION is set to false in config.php and not modified anywhere else. $audionorm is undefined unless $AUDIONORMALIZATION is true so the assignment of $audionorm as an ffmpeg option throws an error.

ve3meo commented 3 years ago

ffmpeg -version

ffmpeg version 3.4.8-0ubuntu0.2 Copyright (c) 2000-2020 the FFmpeg developers built with gcc 7 (Ubuntu 7.5.0-3ubuntu1~18.04) configuration: --prefix=/usr --extra-version=0ubuntu0.2 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared libavutil 55. 78.100 / 55. 78.100 libavcodec 57.107.100 / 57.107.100 libavformat 57. 83.100 / 57. 83.100 libavdevice 57. 10.100 / 57. 10.100 libavfilter 6.107.100 / 6.107.100 libavresample 3. 7. 0 / 3. 7. 0 libswscale 4. 8.100 / 4. 8.100 libswresample 2. 9.100 / 2. 9.100 libpostproc 54. 7.100 / 54. 7.100

vdellamea commented 3 years ago

Ok, version 3, which is old. Unfortunately Ubuntu 18 installs by default ffmpeg 3, although it is at 4.3.X. There is a way to install 4, e.g., look here: https://ubuntuhandbook.org/index.php/2020/06/install-ffmpeg-4-3-via-ppa-ubuntu-18-04-16-04/

Regarding config.php: the copy in jamulus-server-remote is just the installable one. The one really used is in /var/ww/html, with the exception that, when you run automix from command line, it does not look at config.php (I did this because I wanted it to be movable in any place - there is a similar bandmates configuration inside. Likely I will do something smarter, e.g., read from config if it is available). Anyway, it is not audionorm the issue (I played a little with audio normalization but the results were not good). I will better manage this soon.

ve3meo commented 3 years ago

are the consolidated and mix folders set with the privileges described in the docs?

Sorry, it takes me a while to figure out how to ask Linux for the answer which I think is No. Should that digit "2" and name "root" be "3" and "jamulus"? The latter I think must be the owner but I do not know what the digit means (yet).

root@ganaraskals:/home/jamulus# ls -l -d */ drwxrwsr-x+ 2 root www-data 4096 Feb 9 03:25 consolidated/ drwxrwsr-x+ 2 root www-data 4096 Feb 8 22:06 mix/ drwxrwsr-x+ 3 jamulus www-data 4096 Feb 9 03:47 recording/ root@ganaraskals:/home/jamulus#

vdellamea commented 3 years ago

I think it is everything okay except the ffmpeg version, too old.

ve3meo commented 3 years ago

I looked at the PPA method and it feels too risky for me with my tiny grasp of things Linux. I might be farther ahead by rebuilding or replacing the server with Ubuntu 20. And I certainly don't want to start either today as I need it tonight.

Now I have had some success but with unknown possible collateral damage. I edited the statement: $delays.= "[$c]aformat=sample_fmts=s16:sample_rates=48000:cl=$monostereo,adelay=". $delay."|".$delay.$volumeincrease."[a$c]; "; removing the bolded string (between the pair of double asterisks (**)).

I've not been able to find in the ffmepg doc the 'cl' option for filter_complex and that's what was throwing an error. The ZIP appeared in the mix folder, was downloaded via the web server and the one MP3 played.

The MP3 is a stereo file even though the only WAV file is mono and, while I thought I had set a pan of 0.1 for my name, the MP3 has me up the middle.

With a more complex session (tonight) with a mix of mono and stereo incoming streams and interrupted or temporary ones, we'll see what the outcomes are.

vdellamea commented 3 years ago

cl is an option of the aformat command (https://ffmpeg.org/ffmpeg-filters.html#aformat-1 ). The only situation where $monostereo does something is when a track is made of more than one file, some mono and some stereo. If at least one is stereo, the consolidated track will be stereo. Without it, if I remember well the result is mono. Thus without it it will function anyway. Regarding the pan, if you noticed, file names have the profile name without '-', which is substituted by '_'. I see your name is coded as Tom_H___Tenor, likely being Tom-H---Tenor originally: put underscores in config too. Conversion is something I did not implement but I will do it. And have a good rehearsal :)

ve3meo commented 3 years ago

OK, found the option 'cl', abbrev. of 'channel_layouts' at https://ffmpeg.org/ffmpeg-filters.html#aformat-1 and https://ffmpeg.org/ffmpeg-utils.html#Channel-Layout

ve3meo commented 3 years ago

I restored the 'cl' option but with the full name 'channel_layouts' and that executes without the error.

I was wrong about the mix zip location - it is in 'recording', not in 'mix'. Delete ZIPs still deletes it.

vdellamea commented 3 years ago

Thank you! good idea, I will put it immediately in the code. Did you try to change the name in config?

ve3meo commented 3 years ago

Regarding the pan, if you noticed, file names have the profile name without '-', which is substituted by '_'. I see your name is coded as Tom_H___Tenor

I have 'Tom_H___Tenor' =>0.1, in both config,php and automix.php. The profile name has space characters, not underscores.

The audio file is Tom_H___Tenor-24_235_235_x_22175-0-2.wav

ve3meo commented 3 years ago

are the consolidated and mix folders set with the privileges described in the docs?

Sorry, it takes me a while to figure out how to ask Linux for the answer which I think is No. Should that digit "2" and name "root" be "3" and "jamulus"? The latter I think must be the owner but I do not know what the digit means (yet).

root@ganaraskals:/home/jamulus# ls -l -d */ drwxrwsr-x+ 2 root www-data 4096 Feb 9 03:25 consolidated/ drwxrwsr-x+ 2 root www-data 4096 Feb 8 22:06 mix/ drwxrwsr-x+ 3 jamulus www-data 4096 Feb 9 03:47 recording/ root@ganaraskals:/home/jamulus#

The 'consolidated' and 'mix' zip files are still being written to the 'recording' folder. image

The 3 folders appear to have the same permissions except for that digit I noticed. Nevertheless, the Consolidate and AutoMix functions work as do their Downloads and Delete Zips. image

vdellamea commented 3 years ago

Yes, those are the correct privileges, and until now I left all zipped files in the Recordings directory, only because it is easier to delete all zips. However, from what I have read on FB, is the only issue now the panning, that does not recognize the names? If so, I could write a small script to check what happens.

vdellamea commented 3 years ago

(by the way, I am also rewriting the panning algorithm to use the same spacing but sequentially, so, with an ordered naming, you can predict where each one will be).

reinhardwh commented 3 years ago

@vdellamea Thanks for the "automix" feature. Very useful and working fine for me.

ve3meo commented 3 years ago

Back in mid-March, I upgraded from Ubuntu 18.04 to 20-something, or so I thought. Subsequently, jamulus-server-remote was not writing the MP3 files. I finally got around to checking today and a test of a tiny session did work as it should. Then I discovered that, according to the info on my cloud service account, I must have restored the 18.04 snapshot in the process of what I thought was deleting it. The ffmpeg is version 4.2.4-1ubuntu0.1. One of those mysteries that I guess should be calked up to a temporary phantom.

That said, should I anticipate that there will be something adverse that might happen with the upgrade to 20?

vdellamea commented 3 years ago

That said, should I anticipate that there will be something adverse that might happen with the upgrade to 20?

I am not sure - however, the default installed is still 4.2.4. I am sure Jamulus 3.7 is different, and I am working on - I supposed to finish the new release today, but weather was excellent, I spent the whole day out.

vdellamea commented 3 years ago

The new version is out :)

reinhardwh commented 3 years ago

Hello, thanks for the new revision. I really like your "Server Remote"

Downloaded the ZIP file.

automix.php in ZIP file ends ?> ?>

Should only be "one" ?>

Kind regards Reinhard

ve3meo commented 3 years ago

I didn't want to do a full install on my Ubunto 18.0.4 server. I thought that it would only be necessary to replace the PHP files of my 0.4 JRS. That proved to be correct except for the fact that my jamulus service is named jamulus.service, not jamulus-headless.service as in the new worker.php for the SIGUSR commands. I changed the php as I was unsure if I could change jamulus.service. Restarted apache2 (maybe not needed) and I'm back in business. Hope there's nothing else I should have done!

vdellamea commented 3 years ago

@ve3meo so good news for me too :) . I think nothing else should be done in fact.

vdellamea commented 3 years ago

@reinhardwh thanks, corrected.