#12366 NORM 13.1.0: XO-4 24-bit sound playback is bad

Zarro Boogs per Child bugtracker at laptop.org
Mon Dec 31 05:50:50 EST 2012


#12366: XO-4 24-bit sound playback is bad
---------------------------------+------------------------------------------
           Reporter:  Sunny Bao  |       Owner:  saadia       
               Type:  defect     |      Status:  new          
           Priority:  normal     |   Milestone:  13.1.0       
          Component:  kernel     |     Version:  not specified
         Resolution:             |    Keywords:               
        Next_action:  never set  |    Verified:  0            
Deployment_affected:             |   Blockedby:               
           Blocking:             |  
---------------------------------+------------------------------------------

Comment(by dsd):

 Looking at mmp3_sspa_hw_params(), the only suspicious thing is this:

 {{{
         /* I2S protocol: need to double the audio sample size to ensure
          * that word_size bit can be sent out. the word_size - 1 length of
          * 0 would be ignored in codec. it should be also appiled to other
          * formats besides S16_LE */
         sspa_ctrl |= SSPA_CTL_XSSZ1(word_size) |
                      SSPA_CTL_XWDLEN1(word_size);
         sspa_sp |= SSPA_SP_FPER((bits_per_frame << 1) - 1) |
                      SSPA_SP_FWID(bits_per_frame - 1);
 }}}

 and indeed, bits_per_frame is set as 48 here, for a 24 bit audio sample.
 This is also double what happens on arm-3.0-wip for MMP2. But, this does
 work for other audio formats, and the S24 handling is consistent with
 other bit depths. So I don't think we have a reason to doubt this code.

 So, going down to the codec... also can't immediately see anything wrong
 there - it does communicate the 24bit format to the chip in a way that
 agrees with the datasheet.

 Why did this work on XO-1.75? mmp2_i2s_dai only supports
 SNDRV_PCM_FMTBIT_S16_LE, so we never even try 24 bit. I guess we would
 have the same issue there otherwise. As a quick fix, I've pushed
 38b7d1046d64f276896fc1e18d7ae81c188ff7ed to arm-3.5 to disable 24-bit for
 now, matching XO-1.75.

 But having 24-bit audio is desirable. I wonder if Mitch (with his
 experience + OFW wizardry) can quickly test this under OFW to see if we
 even have a base case to work towards? Now that we have a workaround this
 is not urgent.

 One area of doubt I have is this: ALSA offers two 24-bit formats: S24_LE
 is 24 bits of audio packed into 4 bytes (I'm not exactly sure of which
 arrangement). There is also S24_3LE which is 24 bits in 3 bytes.

 I would expect mmp-sspa's mmp3_sspa_hw_params() to somehow refer to this -
 i.e. it would set a bit width to 32-bits (or 64, given that it seems to
 want to double it) - but it doesn't.

 Also, the codec datasheet says that 24 bit is supported, but it doesn't
 seem to explain whether it expects 24-bit data to be presented in a 3-byte
 or 4-byte format.

-- 
Ticket URL: <http://dev.laptop.org/ticket/12366#comment:4>
One Laptop Per Child <http://laptop.org/>
OLPC bug tracking system


More information about the Bugs mailing list