What exactly is...

… the CM6631 fix?

I’ve been trying to work this out myself and had a look through the code, but my php-fu is weak.

cmedia.com.tw/ProductsDetail … no-43.html :stuck_out_tongue:

I think Curious was wondering what the cmedia “fix” in the volumio web ui settings was. How does the fix work? What is actually involved? I inquired about this in the forum also, but got no responses.

Exactly this. I was hoping that Michaelangelo (or some other dev) might be able to shed some light. The wording

has piqued my interest. What is this dirty fix and what are the downsides of using this dirty fix? Is it a forced resample?

I’m more than happy messing around with Linux (which has been my main operating system for fifteen years now), but PHP still eludes me: I ask simply because I am “curious” :slight_smile:

I’ve made this feature to resolve an issue with my personal setup.
I was using this USB-Audio interface:

I bought it from an ebay seller. Unfortunately the firmware of my interface was “buggy” and when I skip from tracks of different bit depth or sample rate, the sound is horribly “desynced” (it seems like “robotic” sound); in that situation the only way to solve the problem was STOP or PAUSE the playback and then return to PLAY. So I integrated this “dirty fix” into the PlayerUI code. Exactly into /_player_engine.php https://github.com/RuneAudio/RaspyFi/blob/master/_player_engine.php#L89

here is the code:

if (isset($_SESSION['cmediafix']) && $_SESSION['cmediafix'] == 1 && $status['state'] == 'play' ) { $status['lastbitdepth'] = $_SESSION['lastbitdepth']; if ($_SESSION['lastbitdepth'] != $status['audio']) { sendMpdCommand($mpd,'cmediafix'); } }If the bit depth of the current song differ from bit depth of previous track, I’ll fire the special command cmediafix

function sendMpdCommand($sock,$cmd) { if ($cmd == 'cmediafix') { $cmd = "pause\npause\n"; fputs($sock, $cmd); } else { $cmd = $cmd."\n"; fputs($sock, $cmd); } }
the “super-awesome” command cmediafix, simply sends two pause commands in sequence.

I hope to have answered to your curiosity.

Ciao.
Simone.

That’s exactly what I was looking for - thanks Orion (for both answering the question and all your work on this project :smiley:)

Hello guys.
On a different note, I wish to raise a small issue pertaining to audio output.
I happen to use the CM6631A USB Decoder with a AK4396 DAC.
With the Raspberry/Volumio sample rate setting at 24B96K all files with sample rate of 24B96K or lower play smoothly without any stutter or any problem.
However files with sample rate of 24B176K and 24B192K and 32B192K stutter badly.
On the other hand when the sample rate setting is 24B192K all files with sample rates of 24B192K and 32B192K play smoothly and without any problems, however files with lower sample rates like 24B96K to 16B44K stutter badly.
I would be greatly pleased for your views and advice on this apparent paradox.
Thank you.