A major performance issue solved: when xwax is displaying in a remote X11 window, the rate of importing tracks is absolutely abysmal. Xwax enables importing of tracks to the player with a shell script called “import.” It’s basically a big case statement enabling the import of different file types based on their extension, and to use the preferred import executable on a particular file type.
Examples given are mpg123 and ffmpeg, and the fallback importer is ffmpeg, so each file type has a command line extension that looks something like this one tweaked for Ogg Vorbis files.
exec ffmpeg -loglevel verbose -hwaccel hw:0 -codec:a vorbis -i "$FILE" -ar "$RATE" -f s16le -codec:a pcm_s16le -
This essentially transcodes a .ogg file into a signed 16-bit little-endian pcm stream, which is what xwax plays. The useful information that -loglevel verbose gives me is the transcoding progress expressed as a multiple of realtime playback speed. The “-” at the end of the command is ffmpeg’s pipe to stdout. Don’t use this command in a shell; it’ll spew garbage characters until it gets through the whole file.
On the bash command line, I tested ffmpeg by using the above command, except replacing the trailing “-” with an output filename with .wav extension. Transcoding a .ogg file of Vegancore by Notausgang reports back between 79x and 95x speed writing to Vegancore.wav
In Xwax, the import script, importing the same track through the UI (which uses the above command), the transcode speed was a glacial 0.35x-1.2x. Absolutely unacceptable. There is not enough data ready for the player to seek to when it uses the timecoder’s position. this was mitigated about by implementing a relative mode, but the whole point is to use the vinyl like it’s vinyl.
I posted the issue to the xwax-devel mailing list and received a quick response suggesting I use X11vnc rather than straight up X11 forwarding, which is an excellent idea, but I couldn’t make x11vnc work on either my macbook pro or my Windows dev machine, so I tried it headless, just on a hunch.
In headless mode, (using the –headless flag along with the –osc flag on xwax startup command) transcode/import performance was the same as the command line, essentially going from minutes to mere seconds to fully import a .ogg track. .mp3 files work similarly, because the Wolfson wm-8731 chip on the Audioinjector Stereo card supports decoding mp3’s in hardware.
This means I can use the Magic Leap to interact with Xwax and not worry about waiting for tracks to load or whether or not I’m going to put the needle down on the control vinyl at a location that hasn’t been transcoded yet. In fact, I was really only looking at the X11 Xwax window to get information about elapsed time, and whether or not the track was fully loaded. So now, it’s time to stop using X11 as a crutch and implement all the necessary affordances in the Magic leap app.
Next up: Draw the waveform of the imported track in UE4 in a radial display.