[mythtv-commits] Ticket #9930: Distorted alsa-output on some soundcards
MythTV
noreply at mythtv.org
Fri Jul 22 10:18:21 UTC 2011
#9930: Distorted alsa-output on some soundcards
-----------------------------------+---------------------------
Reporter: mac20xx@… | Owner: jyavenard
Type: Patch - Bug Fix | Status: new
Priority: minor | Milestone: 0.24.1
Component: MythTV - Audio Output | Version: 0.24.1
Severity: medium | Resolution:
Keywords: distorted alsa output | Ticket locked: 0
-----------------------------------+---------------------------
Comment (by mac <mac20xx@…>):
Replying to [comment:4 jyavenard]:
> "I called them alsa-frames because they are not the same as frames in
mythtv"
>
> They are!
>
> That's why they are called frames instead of samples.
> frame = sample * channels (just like in ALSA)
>
> So when you do:
> channels * output_bytes_per_frame
> you are actually doing:
> channels * channels * sample.
>
> I have no doubt that there could be a problem, but your analysis is
wrong and should it fix anything it's a side effect of your incorrect
calculations.
I' ve attached 4 logfiles to the original ticket created with mythfrontend
-v audio,timestamp
Testing with the original code gave distorted output with 2 soundcards
(Terratec EWX 24/96 and Cambridge DacMagic via usb).
The reason for this is a wrong calculated "size" given to WriteAudio()
Terratec EWX:
2011-07-22 10:33:09.617 WriteAudio: Preparing 2622 bytes (655 frames)
data in the buffer 2622 bytes, written to soundcard 655*2*2 = 2620 bytes
so one sample is missing.
Same for Cambridge DacMagic:
2011-07-22 10:29:49.960 WriteAudio: Preparing 8822 bytes (2205 frames)
data in the buffer 8822 bytes, written to soundcard 2205*2*2 = 8820 bytes
so one sample is missing.
Because only one sample is missing after every call of WriteAudio() the
channels are switched.
I'm not a c-programmer so the patches might be done better but I think my
analysis of the problem is ok.
--
Ticket URL: <http://code.mythtv.org/trac/ticket/9930#comment:5>
MythTV <http://code.mythtv.org/trac>
MythTV Media Center
More information about the mythtv-commits
mailing list