Opened 8 years ago

Closed 6 years ago

Last modified 6 years ago

#10087 closed Bug Report - General (Works for me)

mythmusic: 88.2KHz/24bit/6ch FLAC/WAV distorts

Reported by: ignissport@… Owned by:
Priority: trivial Milestone: unknown
Component: Plugin - MythMusic Version: 0.24-fixes
Severity: low Keywords:
Cc: Ticket locked: no


88.2KHz/24bit/6ch becomes distorted on playback when played in mythmusic. This occurs in both FLAC and WAV formats.

I've replicated this on two machines with very different hardware setups. One was an Audigy 2 ZS running through headphones over pulseaudio, the other was an onboard SP/DIF direct to an external amp (no pulse). Both played other formats fine, but heavily distorted when playing FLAC/WAV in this specific sample rate/bit depth/channel.

44.1KHz/16bit/Stereo plays fine. 48KHz/16bit/Stereo plays fine. 88.2KHz/24bit/Stereo plays fine. 88.2KHz/16bit/6ch plays fine. 96KHz/24bit/Stereo plays fine. 96KHz/24bit/6ch plays fine.

It's just 88.2KHz/24bit/6ch that distorts. If I re-encode the FLAC/WAV as 16bit, it plays back fine.

The FLAC/WAV also plays fine in other media players (including mythffplay) and passes a "flac -t" test.

mythffplay output: (a file that distorts) Audio: flac, 88200 Hz, 6 channels, s32

(a file that does not distort) Audio: pcm_s16le, 88200 Hz, 6 channels, s16

I suspect this may have something to do with changes introduced ticket #9930, but I can't be sure.

Both test machines are running v0.24.1-96-ge89d6a9 branch fixes/0.24

I've marked it as low/trivial as I suspect I'm the 0.0001% of the population that actually has media in this format.

Change History (9)

comment:1 Changed 7 years ago by paulh

Owner: paulh deleted
Status: newassigned

comment:2 Changed 6 years ago by paulh

Is this still a problem with current master?

I just tried 3 random flac files that I could find all with 88.2KHz/24bit they all played fine in MythMusic but couldn't find any 6 channel ones to test, the closest I could find was one that was flagged as Audio: flac, 88200 Hz, 5.1(side), s32 don't know if that is the same as the 6 channel ones you had problems with?

Incidentally mythffmpeg had problems playing that file and mythavtest played it but seemed to jump about randomly while playing it. MythMusic played it without problems though.

comment:3 Changed 6 years ago by ignissport@…

You may be right. 88.2KHz/24bit/6ch seems to be playing for me now. However, I recently changed hardware from SP/DIF to HDMI (new amp), which means that it's now sending raw 6ch PCM to my receiver rather than converting to Dolby Digital on-the-fly.

I've thrown together a test suite to test *ALL* the formats. I've only got 1Mbps of upload bandwidth, so it may take a while to download the higher res ones.

I've recently formatted my other PC (now on Raring Ringtail), and I'm yet to install MythTV on it to re-test. I'll try and run both PCs through the test suite in the near future and post back with results.

comment:4 Changed 6 years ago by ignissport@…

I've run through all of the above tests on two different systems.

They all played perfectly on my HTPC over HDMI.

On my desktop machine, the following two produced a noticeable distortion:

  • 48KHz/16bit/6ch
  • 96KHz/16bit/6ch

It sounded a lot like clipping. The desktop machine config:

  • Mythtv fixes/0.26 (from ppa) v0.26.0-138-g69cd78b
  • Creative Labs SB Audigy 2 ZS [SB0350]
  • Stereo headphones
  • Ubuntu 13.04 Raring Ringtail 64bit
  • Audio Output Device: "ALSA:pulse"
  • Speaker Configuration: Stereo

All files played OK in rhythmbox on the same machine.

comment:5 Changed 6 years ago by paulh

Any chance you could test again with current master? Jean-Yves fixed a problem with the audio output that could have fixed the clipping you was hearing.

FWIW I just tried all the tracks from your test suite and they all played fine for me.

comment:6 Changed 6 years ago by JYA

Resolution: Works for me
Status: assignedclosed

I tested all samples list above with no issue in 0.27 As I first tested on a system where the hardware support all the sampling rate and all the sample size, it wasn't any indications that there wasn't a problem...

So I modified the tests and listen them all as follow: no resampling / no sample size conversion: all ok no resampling / no sample size conversion / Upmixer active: all ok force resampling to 48Khz / no sample size conversion: all ok force resampling to 48kHz/ no sample size conversion / Upmixer active: all ok force resample to 48kHz / force sample conversion to signed 16 bits: all ok force resample to 48kHz / force sample conversion to signed 16 bits / Upmixer active: all ok

There was a long standing bug introduced in mythtv 0.24 where all floats >= 1.0 would be converted to either -32768 (instead of 32767) in 16 bits conversion, or -231 (instead of 231-1); resulting in distortion whenever clipping occurred.

this was resolved in 0.27/master.

Please upgrade.. 0.24 is long outdated

comment:7 Changed 6 years ago by JYA

oh, nd don't use ALSA:pulse

pulse resample everything to a single sampling rate, by default 44.1kHz

I didn't test with AC3 on-the-fly encoding... will do now

comment:8 Changed 6 years ago by JYA

tested with AC3 output re-encoding... all fine too

comment:9 Changed 6 years ago by ignissport@…

I've just run through all the tests myself on v0.26.1-7-gdc1d80 and v0.27-beta-89-gfb1a3c5.

All tests played back perfectly in both versions. My AV receiver reported input sample rates that matched the input files, and it changed with the tracks.

The only thing I noticed was playing a raw 5.1 DTS file in the music player - it played back fine, but in the past it would perform a DTS passthrough, where now it appears to decode it to multichannel PCM. AC3 passthrough still works fine from Live TV and the video player for streams with DD/DTS audio. It's just the music player that decides to decode it to PCM. The MythMusic audio device is set to 'default', so I'm not sure why it behaves different to the other modules. That said, it's no big deal - it doesn't really matter whether the PC or my AV receiver does the DTS decoding as the end result is the same.

Actually, disabling AC3 passthrough in MythMusic would allow the visualizations to work with DD/DTS content. However, it seems that nothing gets passed to the visualisation at all with multichannel audio - it just flatlines (this can be replicated with any 5.1 FLAC from my test suite). Let me know if you think I should raise a different ticket for that one.

Oh, and thanks for looking into it. It's in a much better state now :)

P.S. PulseAudio? - Not even once. alsa:hdmi all the way.

Note: See TracTickets for help on using tickets.