Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Upsampling MQA files to original resolution with sox
03-07-2017, 19:55
Post: #1
Upsampling MQA files to original resolution with sox
Can you do what's proposed in this CA threat with MinimStreamer?

https://www.computeraudiophile.com/forum...esolution/

Quote:
general usage:
sox -S input.mqa.flac output.flac -vsM 352800

so with the above MQA file:
sox -S 2L-087_06_stereo_DXD_FLAC.mqa.flac MQA_upsampled.flac rate -vsM 352800

Now playback

MQA_upsampled.flac
2L-087_stereo-DXD_06.flac

********
I already us SOXR for transcoding. If I understand the post correctly you could play decode and play MQA files this way.

Or am I mistaken? ... If so, please feel free to remove this post.
Find all posts by this user
Quote this message in a reply
04-07-2017, 02:20
Post: #2
RE: Upsampling MQA files to original resolution with sox
I think this would work using convOut in stream.options to pass the necessary upsampling parameters to libsoxr but it will be a few days before I can try it.
Find all posts by this user
Quote this message in a reply
04-07-2017, 19:59
Post: #3
RE: Upsampling MQA files to original resolution with sox
(04-07-2017 02:20)simoncn Wrote:  I think this would work using convOut in stream.options to pass the necessary upsampling parameters to libsoxr but it will be a few days before I can try it.

That would be great! Thank you!
Find all posts by this user
Quote this message in a reply
04-07-2017, 21:31
Post: #4
RE: Upsampling MQA files to original resolution with sox
I haven't been able to find a way to get ffmpeg to pass the -vsM options (or equivalent) to the libsoxr library. Any suggestions would be appreciated.
Find all posts by this user
Quote this message in a reply
24-05-2018, 06:09
Post: #5
RE: Upsampling MQA files to original resolution with sox
(04-07-2017 21:31)simoncn Wrote:  I haven't been able to find a way to get ffmpeg to pass the -vsM options (or equivalent) to the libsoxr library. Any suggestions would be appreciated.
I believe computeraudiophile.com has come up with some simple changes to ffmpeg, but would require compiling a forked version. I'm not interested in mqa but in using sox, convolving, and some custom resampling programs, though mqa could be easily handled with sox. I created a ffmpeg script that parses the file name and passes it to sox. Unfortunately it appears to play, but without sound. I'm not sure what minimstreamer is expecting back from sox, raw format? Does this have the potential to work, before I pursue it too far?

FILE_NAME="$(echo "$@" | awk -F'-i | -vn' '{print $2}')"
sox -q -D "${FILE_NAME}" -t raw -r 192000 -e signed-integer -c 2 -b 24 --endian little -

Thanks again,
Mike
Find all posts by this user
Quote this message in a reply
24-05-2018, 22:12
Post: #6
RE: Upsampling MQA files to original resolution with sox
If you are using your ffmpeg script in place of the real ffmpeg, it is very unlikely that this approach will work because your script would need to support and implement all the ffmpeg options that MinimServer uses.
Find all posts by this user
Quote this message in a reply
10-06-2018, 19:22 (This post was last modified: 10-06-2018 19:25 by ps3guy.)
Post: #7
RE: Upsampling MQA files to original resolution with sox
(24-05-2018 22:12)simoncn Wrote:  If you are using your ffmpeg script in place of the real ffmpeg, it is very unlikely that this approach will work because your script would need to support and implement all the ffmpeg options that MinimServer uses.
This is what I have come up with that works for custom upsampling

1. Set the following in minimserver
stream.transcode=flac:wav24;192
stream.converter=pathtocustom/ffmpeg

2. Create custom script named ffmpeg as follows:
#/bin/sh
#removed -ar 192000 to disable ffmpeg upsampling - added quotes around the input file name (between -i and -vn) they were stripped during the echo stage
FFMPEG_MOD="ffmpeg $(echo -n "$@" | sed -e 's/ -ar 192000//' | sed -e 's/-i /-i "/' | sed -e 's/ -vn/" -vn/')"

ORIG_RATE=$(ffprobe -v error -show_entries stream=sample_rate -of default=noprint_wrappers=1:nokey=1 "${FILE_NAME}")
UPSAMPLE="192000"

eval "$FFMPEG_MOD" | sox -q -D -t raw -r "${ORIG_RATE}" -c 2 -b 24 -e signed-integer --endian little - \
-t raw -e signed-integer -b 24 - vol 0.92 amplitude rate -v -b 99.0 -p 45 -a 192000 dither -S

The only thing I would like is the to be able to use flac:wav32;192 this would allow me to send 32 bit data as 24 with zero padding. Why? Some dacs will not accept 24 bit only 32 bit data. Not an issue except some renderers do not simply pad zeros but mess add dither, etc. Any chance of adding 32 bit output option?

Thanks again,
Mike
Find all posts by this user
Quote this message in a reply
10-06-2018, 21:33
Post: #8
RE: Upsampling MQA files to original resolution with sox
Thanks for sharing this solution.

The restriction to 24-bit WAV transcoding dates from an era when no renderers supported 32-bit WAV. This is now outdated and should be fixed.
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)