[mythtv-commits] Ticket #9930: Distorted alsa-output on some soundcards

MythTV noreply at mythtv.org
Fri Jul 22 15:04:27 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:9 jyavenard]:
 > There is something else in your log that is puzzling:
 >
 > > 2011-07-22 10:02:47.387 ALSA: Hardware audio buffer cur: 256 need: 896
 max allowed: 256
 > > 2011-07-22 10:02:47.387 ALSA, Error: Unable to sufficiently increase
 ALSA hardware buffer size - underruns are likely
 >
 > That's to get 110kB of buffer, it shouldn't request 896kB of buffer,
 256kB is plenty... another bug there...

 I don't believe that the Terratec has a buffer of 256k. I think alsa-lib
 returns the wrong size in /proc/asound/.../prealloc but this value is used
 to compute the needed buffer size.


     int cur  = pfile.readAll().trimmed().toInt();
     int max  = mfile.readAll().trimmed().toInt();

     int size = ((int)(cur * (float)requested / (float)buffer_time)
                 / 64 + 1) * 64;

     VBAUDIO(QString("Hardware audio buffer cur: %1 need: %2 max allowed:
 %3")
             .arg(cur).arg(size).arg(max));


 If cur is reported incorrectly from alsa-lib then also size is computed
 wrong but that's really a alsa problem.

 As stated above: your patch works!
 Thanks a lot for your help.

-- 
Ticket URL: <http://code.mythtv.org/trac/ticket/9930#comment:12>
MythTV <http://code.mythtv.org/trac>
MythTV Media Center


More information about the mythtv-commits mailing list