Transmit buffer underflow when trying to play audio using an externally attached codec board

442 views
Skip to first unread message

Shadi Abdu-Rahman

unread,
Aug 10, 2015, 8:25:32 AM8/10/15
to BeagleBoard
Hi all,

I'm having trouble using an audio codec board with a custom device tree overlay (see below) with the Beaglebone Black. When exporting the overlay, the codecs seem to register fine:

dmesg
[ 1375.144463] bone_capemgr bone_capemgr: part_number 'BB-BONE-XA-SK-AU', version 'N/A'
[ 1375.152305] bone_capemgr bone_capemgr: slot #4: override
[ 1375.157799] bone_capemgr bone_capemgr: Using override eeprom data at slot 4
[ 1375.164864] bone_capemgr bone_capemgr: slot #4: 'Override Board Name,00A0,Override Manuf,BB-BONE-XA-SK-AU'
[ 1375.206351] bone_capemgr bone_capemgr: slot #4: dtbo 'BB-BONE-XA-SK-AU-00A0.dtbo' loaded; overlay id #0
[ 1375.464260] cs4270 2-0048: found device at i2c address 48
[ 1375.469699] cs4270 2-0048: hardware revision 3
[ 1375.485782] cs4270 2-0049: found device at i2c address 49
[ 1375.491222] cs4270 2-0049: hardware revision 3
[ 1375.504744] (NULL device *): Setting gpio_int_masterclk_enable = 0
[ 1375.513334] asoc-simple-card ocp:sound: cs4270-hifi <-> 48038000.mcasp mapping ok
[ 1375.521095] (NULL device *): Setting gpio_int_masterclk_enable = 0
[ 1375.529893] asoc-simple-card ocp:sound: cs4270-hifi <-> 48038000.mcasp mapping ok

aplay -l
**** List of PLAYBACK Hardware Devices ****
card
0: XMOSAudioSlice [XMOS-Audio-Slice], device 0: davinci-mcasp.0-cs4270-hifi-a cs4270-hifi-0 []
 
Subdevices: 1/1
 
Subdevice #0: subdevice #0
card
0: XMOSAudioSlice [XMOS-Audio-Slice], device 1: davinci-mcasp.0-cs4270-hifi-b cs4270-hifi-1 []
 
Subdevices: 1/1
 
Subdevice #0: subdevice #0

lsmod:
snd_soc_davinci_mcasp    14391  2
snd_soc_simple_card    
8156  0
snd_soc_edma            
1150  1 snd_soc_davinci_mcasp
snd_soc_cs4270          
6875  2
snd_soc_omap            
2573  1 snd_soc_davinci_mcasp
snd_soc_core          
156881  5 snd_soc_davinci_mcasp,snd_soc_edma,snd_soc_omap,snd_soc_simple_card,snd_soc_cs4270
snd_compress          
11668  1 snd_soc_core
snd_pcm_dmaengine      
5061  2 snd_soc_core,snd_soc_omap
snd_pcm                
77081  4 snd_soc_davinci_mcasp,snd_soc_core,snd_soc_omap,snd_pcm_dmaengine
snd_timer              
16860  1 snd_pcm
snd                    
56902  4 snd_soc_core,snd_timer,snd_pcm,snd_compress
soundcore              
6869  1 snd
pvrsrvkm              
147014  0
omap_aes              
13089  0
omap_sham              
19190  0
tda998x                
11683  1
tilcdc                
27919  0
omap_rng                
4354  0
rng_core                
7270  1 omap_rng
drm_kms_helper        
106610  3 tda998x,tilcdc
uio_pdrv_genirq        
3317  0
leds_gpio              
3102  0
uio                    
8330  1 uio_pdrv_genirq

but when I try to play an audio file I get a stream of transmit buffer underflows and no audio:

aplay test128.wav
Playing WAVE 'test128.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo
underrun
!!! (at least 1.630 ms long)
underrun
!!! (at least 5.413 ms long)
underrun
!!! (at least 0.636 ms long)
underrun
!!! (at least 5.369 ms long)
underrun
!!! (at least 0.217 ms long)
underrun
!!! (at least 0.641 ms long)
underrun
!!! (at least 5.254 ms long)

dmesg
[ 1493.190031] davinci-mcasp 48038000.mcasp: Transmit buffer underflow
[ 1493.201647] davinci-mcasp 48038000.mcasp: Transmit buffer underflow
[ 1493.218719] davinci-mcasp 48038000.mcasp: Transmit buffer underflow
[ 1493.229946] davinci-mcasp 48038000.mcasp: Transmit buffer underflow
[ 1493.245328] davinci-mcasp 48038000.mcasp: Transmit buffer underflow
[ 1493.259411] davinci-mcasp 48038000.mcasp: Transmit buffer underflow
[ 1493.270549] davinci-mcasp 48038000.mcasp: Transmit buffer underflow

Using a software oscilloscope, I can see that the frame clock starts on mcasp0_fsx frame clock line but stops after a few periods. There’s no activity on the on the mcasp0_axr2 audio out line.

This might be related to the problem mentioned here, but I couldn't see a solution for it. I might also have missed something trivial. Any pointers or help would be much appreciated.

Additional information:
I’m using the v4.1.3-bone15 linux kernel with debian-8.1-minimal-armhf-2015-06-09 compiled as per Robert C Nelsons instructions here.

The board I’m using is an XMOS XA-SK-AUDIO slice and consists of two Cirrus Logic cs4270 codecs and an onboard oscillator generating the master clock. I’ve interfaced the board to a XMOS micro controller to make sure the board is in working order (and it is). When connected to the BBB, reset de-assertion and some initial i2c codec configuration (setting the codecs in software mode) are handled by the same XMOS micro controller.

The overlay I’m using (compiled and installed using bb-overlays) looks like this:
/dts-v1/;
/plugin/;

/ {
    compatible = "ti,beaglebone", "ti,beaglebone-black";
    part-number = "BB-BONE-XA-SK-AU";
    version = "00A0";
 
    exclusive-use =
        /
* pin header usage */
        "P9.25",    /
* mcasp0_ahclkx <- MCLK */
        "P9.31",    /
* mcasp0_aclkx <-> BCLK*/
        "P9.29",    /
* mcasp0_fsx <-> LRCLK */
        "P9.30",    /
* mcasp0_axr0 <- ADC_DATA0 */
        "P9.41",    /
* mcasp0_axr1 <- ADC_DATA1 */
        "P9.28",    /
* mcasp0_axr2 -> DAC_DATA0 */
        "P9.27",    /
* mcasp0_axr3 -> DAC_DATA1 */
        /
* hardware ip usage */
        "gpio0_15",    /
* ext-mclk-sel -> MCLK_FSEL */
        "gpio0_20", /
* CLKOUT2 disabled */
        "gpio1_27", /
* internal 24.576 MHz oscillator disabled */
        "mcasp0";

    fragment@0 {
        target = <&am33xx_pinmux>;
        __overlay__ {
            i2c2_pins: pinmux_i2c2_pins {
                pinctrl-single,pins = <
                    /
* Pullup resistors available on codec board */
                    0x17c 0x2b        /
* i2c2_scl,        (PIN_INPUT | MUX_MODE3) */
                    0x178 0x2b        /
* i2c2_sda,         (PIN_INPUT | MUX_MODE3) */
                >;
            };
           
            mcasp0_pins: pinmux_mcasp0_pins {
                pinctrl-single,pins = <
                    0x1ac 0x20        /
* mcasp0_ahclkx,    (PIN_INPUT_PULLDOWN | MUX_MODE0) */
                    0x190 0x20        /
* mcasp0_aclkx,    (PIN_INPUT_PULLDOWN | MUX_MODE0) */
                    0x194 0x20        /
* mcasp0_fsx,        (PIN_INPUT_PULLDOWN | MUX_MODE0) */
                    0x198 0x20        /
* mcasp0_axr0,        (PIN_INPUT_PULLDOWN | MUX_MODE0) */
                    0x1a8 0x20        /
* mcasp0_axr1,        (PIN_INPUT_PULLDOWN | MUX_MODE0) */
                    0x19c 0x02        /
* mcasp0_axr2,        (PIN_OUTPUT_PULLDOWN | MUX_MODE2) */
                    0x1a4 0x02        /
* mcasp0_axr3,        (PIN_OUTPUT_PULLDOWN | MUX_MODE2) */    
                    /
* disable internal 24.576 MHz oscillator */
                    0x06c 0x07      /
* gpio1_27,        (PIN_OUTPUT_PULLDOWN | MUX_MODE7) */
                >;
            };
           
            gpio_pins: pinmux_gpio_pins {
                pinctrl-single,pins = <
                    /
* ext-mclk-sel */
                    0x184 0x17        /
* gpio0_15,        (PIN_OUTPUT_PULLUP | MUX_MODE7) */
                    /
* disable CLKOUT2 to allow usage of mcasp0_axr1 on P9_41 */
                    0x1b4 0x2b        /
* gpio0_20,        (PIN_INPUT | MUX_MODE3) */
                >;
            };
        };
    };
   
    fragment@1 {
        target = <&i2c2>;
        __overlay__ {
            pinctrl-names = "default";
            pinctrl-0 = <&i2c2_pins>;
            status = "okay";
            #address-cells = <1>;
            #size-cells = <0>;
            clock-frequency = <100000>;
           
            cs4270m: cs4270@48 {
                compatible = "cirrus,cs4270";
                status = "okay";
                #sound-dai-cells = <0>;
                reg = <0x48>;
                name-prefix = "a";
                va-supply = <&ldo4_reg>;
                vd-supply = <&ldo4_reg>;
                vlc-supply = <&ldo4_reg>;
            };
           
            cs4270s: cs4270@49 {
                compatible = "cirrus,cs4270";
                status = "okay";
                #sound-dai-cells = <0>;
                reg = <0x49>;
                name-prefix = "b";
                va-supply = <&ldo4_reg>;
                vd-supply = <&ldo4_reg>;
                vlc-supply = <&ldo4_reg>;
            };
        };
    };

    fragment@2 {
        target = <&mcasp0>;
        __overlay__ {
            pinctrl-names = "default";
            pinctrl-0 = <&mcasp0_pins>;
            status = "okay";
            #sound-dai-cells = <0>;
            op-mode = <0>;    /
/ MCASP_IIS_MODE
            tdm
-slots = <2>;
            num
-serializer = <4>;
            serial
-dir = <        // 0: INACTIVE, 1: TX, 2: RX
               
2 2 1 1
           
>;
            tx
-num-evt = <1>;
            rx
-num-evt = <1>;
       
};
   
};

    fragment@3
{
        target
= <&ocp>;
        __overlay__
{
            sound
{
                compatible
= "simple-audio-card";
                simple
-audio-card,name = "XMOS-Audio-Slice";
               
                simple
-audio-card,widgets =
                   
"Line", "Line In 1",
                   
"Line", "Line Out 1",
                   
"Line", "Line In 2",
                   
"Line", "Line Out 2"
                   
;
                simple
-audio-card,routing =
                   
"a AINA", "Line In 1",
                   
"a AINB", "Line In 1",
                   
"Line Out 1", "a AOUTA",
                   
"Line Out 1", "a AOUTB",
                   
"b AINA", "Line In 2",
                   
"b AINB", "Line In 2",
                   
"Line Out 2", "b AOUTA",
                   
"Line Out 2", "b AOUTB"
                   
;
                   
                simple
-audio-card,int-masterclk-enable = <&gpio1 27 0>;

                simple
-audio-card,dai-link@1 {
                    format
= "i2s";
                    frame
-master = <&cpu_node1>;
                    bitclock
-master = <&cpu_node1>;
                    cpu_node1
: cpu {
                        sound
-dai = <&mcasp0>;
                        system
-clock-frequency = <24576000>;
                   
};
                    codec_node1
: codec {
                        sound
-dai = <&cs4270s>;
                        system
-clock-frequency = <24576000>;
                   
};
               
};
               
                simple
-audio-card,dai-link@0 {
                    format
= "i2s";
                    frame
-master = <&cpu_node0>;
                    bitclock
-master = <&cpu_node0>;
                    cpu_node0
: cpu {
                        sound
-dai = <&mcasp0>;
                        system
-clock-frequency = <24576000>;
                   
};
                    codec_node0
: codec {
                        sound
-dai = <&cs4270m>;
                        system
-clock-frequency = <24576000>;
                   
};
               
};
           
};
       
};
   
};
};


I've also made the following modifications to cs4270.c, simple-card.c, and soc-core.c to add a mechanism to disable the internal BBB master clock, as well as to fix issues with missing source/sink widgets,
[  137.408549] cs4270 2-0048: ASoC: no source widget found for AINA
[  137.414737] cs4270 2-0048: ASoC: Failed to add route AINA -> direct -> Capture
[  137.422016] cs4270 2-0048: ASoC: no source widget found for AINB
[  137.428137] cs4270 2-0048: ASoC: Failed to add route AINB -> direct -> Capture
[  137.435477] cs4270 2-0048: ASoC: no sink widget found for AOUTA
[  137.441445] cs4270 2-0048: ASoC: Failed to add route Playback -> direct -> AOUTA
[  137.448928] cs4270 2-0048: ASoC: no sink widget found for AOUTB
[  137.454922] cs4270 2-0048: ASoC: Failed to add route Playback -> direct -> AOUTB

and name collisions:
[   51.364492] asoc-simple-card ocp:sound: control 2:0:0:Master Playback Volume:0 is already present
[   51.373469] cs4270 2-0049: ASoC: Failed to add Master Playback Volume: -16
...
[   51.393905] ------------[ cut here ]------------
[   51.398561] WARNING: CPU: 0 PID: 44 at fs/sysfs/dir.c:31 sysfs_warn_dup+0x51/0x5c()
[   51.406281] sysfs: cannot create duplicate filename '/devices/platform/ocp/ocp:sound/davinci-mcasp.0-cs4270-hifi'

diff --git a/sound/soc/codecs/cs4270.c b/sound/soc/codecs/cs4270.c
index e6d4ff9
..4805747 100644
--- a/sound/soc/codecs/cs4270.c
+++ b/sound/soc/codecs/cs4270.c
@@ -140,11 +140,11 @@ struct cs4270_private {
 
};
 
 
static const struct snd_soc_dapm_widget cs4270_dapm_widgets[] = {
-SND_SOC_DAPM_INPUT("AINL"),
-SND_SOC_DAPM_INPUT("AINR"),
+SND_SOC_DAPM_INPUT("AINA"),
+SND_SOC_DAPM_INPUT("AINB"),
 
-SND_SOC_DAPM_OUTPUT("AOUTL"),
-SND_SOC_DAPM_OUTPUT("AOUTR"),
+SND_SOC_DAPM_OUTPUT("AOUTA"),
+SND_SOC_DAPM_OUTPUT("AOUTB"),
 
};
 
 
static const struct snd_soc_dapm_route cs4270_dapm_routes[] = {
diff
--git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c
index
33feee9..1383b0f 100644
--- a/sound/soc/generic/simple-card.c
+++ b/sound/soc/generic/simple-card.c
@@ -28,6 +28,7 @@ struct simple_card_data {
         
struct asoc_simple_dai codec_dai;
     
} *dai_props;
     
unsigned int mclk_fs;
+    int gpio_int_masterclk_enable;
     
int gpio_hp_det;
     
int gpio_hp_det_invert;
     
int gpio_mic_det;
@@ -50,7 +51,7 @@ static int asoc_simple_card_startup(struct snd_pcm_substream *substream)
     ret
= clk_prepare_enable(dai_props->cpu_dai.clk);
     
if (ret)
         
return ret;
-    
+
     ret
= clk_prepare_enable(dai_props->codec_dai.clk);
     
if (ret)
         clk_disable_unprepare
(dai_props->cpu_dai.clk);
@@ -167,6 +168,12 @@ static int asoc_simple_card_dai_init(struct snd_soc_pcm_runtime *rtd)
     
if (ret < 0)
         
return ret;
 
+    /* TODO: Logic for enabling internal clock if specified in DT*/
+    if (gpio_is_valid(priv->gpio_int_masterclk_enable)) {
+        dev_info(NULL, "Setting gpio_int_masterclk_enable = 0");
+        gpio_set_value(priv->gpio_int_masterclk_enable, 0);
+    }
+
     
if (gpio_is_valid(priv->gpio_hp_det)) {
         snd_soc_card_jack_new
(rtd->card, "Headphones",
                       SND_JACK_HEADPHONE
,
@@ -195,16 +202,18 @@ static int asoc_simple_card_dai_init(struct snd_soc_pcm_runtime *rtd)
 
}
 
 
static int
-asoc_simple_card_sub_parse_of(struct device_node *np,
-                  struct asoc_simple_dai *dai,
-                  struct device_node **p_node,
-                  const char **name,
-                  int *args_count)
+asoc_simple_card_sub_parse_of(struct simple_card_data *priv,
+                    struct device_node *np,
+                    struct asoc_simple_dai *dai,
+                    struct device_node **p_node,
+                    const char **name,
+                    int *args_count, bool codec_device, int idx)
 
{
     
struct of_phandle_args args;
     
struct clk *clk;
     u32 val
;
     
int ret;
+    const char *str = NULL;
 
     
/*
      * Get node via "sound-dai = <&phandle port>"
@@ -225,6 +234,18 @@ asoc_simple_card_sub_parse_of(struct device_node *np,
     if (ret < 0)
         return ret;
 
+    /* get name-prefix */

+    if (codec_device) {
+        /* NULL bypasses the device name check in soc-core */
+        priv->snd_card.codec_conf[idx].dev_name = NULL;
+        priv->snd_card.codec_conf[idx].of_node = *p_node;
+        of_property_read_string(*p_node, "name-prefix", &str);
+        if (str)
+            priv->snd_card.codec_conf[idx].name_prefix = str;
+        else
+            priv->snd_card.codec_conf[idx].name_prefix = NULL;
+    }
+
     
/* Parse TDM slot */
     ret
= snd_soc_of_parse_tdm_slot(np, &dai->slots, &dai->slot_width);
     
if (ret)
@@ -334,16 +355,16 @@ static int asoc_simple_card_dai_link_of(struct device_node *node,
     
if (ret < 0)
         
goto dai_link_of_err;
 
-    ret = asoc_simple_card_sub_parse_of(cpu, &dai_props->cpu_dai,
+    ret = asoc_simple_card_sub_parse_of(priv, cpu, &dai_props->cpu_dai,
                         
&dai_link->cpu_of_node,
                         
&dai_link->cpu_dai_name,
-                        &cpu_args);
+                        &cpu_args, false, idx);
     
if (ret < 0)
         
goto dai_link_of_err;
 
-    ret = asoc_simple_card_sub_parse_of(codec, &dai_props->codec_dai,
+    ret = asoc_simple_card_sub_parse_of(priv, codec, &dai_props->codec_dai,
                         
&dai_link->codec_of_node,
-                        &dai_link->codec_dai_name, NULL);
+                        &dai_link->codec_dai_name, NULL, true, idx);
     
if (ret < 0)
         
goto dai_link_of_err;
 
@@ -357,8 +378,10 @@ static int asoc_simple_card_dai_link_of(struct device_node *node,
 
     
/* DAI link name is created from CPU/CODEC dai name */
     name
= devm_kzalloc(dev,
-                strlen(dai_link->cpu_dai_name)   +
-                strlen(dai_link->codec_dai_name) + 2,
+                strlen(dai_link->cpu_dai_name) +
+                strlen(dai_link->codec_dai_name) +
+                (priv->snd_card.codec_conf[idx].name_prefix ?
+                strlen(priv->snd_card.codec_conf[idx].name_prefix) + 3 : 2),
                 GFP_KERNEL
);
     
if (!name) {
         ret
= -ENOMEM;
@@ -367,6 +390,9 @@ static int asoc_simple_card_dai_link_of(struct device_node *node,
 
     sprintf
(name, "%s-%s", dai_link->cpu_dai_name,
                 dai_link
->codec_dai_name);
+    if (priv->snd_card.codec_conf[idx].name_prefix)
+        sprintf(name, "%s-%s", name,
+                priv->snd_card.codec_conf[idx].name_prefix);
     dai_link
->name = dai_link->stream_name = name;
     dai_link
->ops = &asoc_simple_card_ops;
     dai_link
->init = asoc_simple_card_dai_init;
@@ -459,6 +485,15 @@ static int asoc_simple_card_parse_of(struct device_node *node,
             
return ret;
     
}
 
+    /* request GPIO to control internal 24.576MHz oscillator */
+    priv->gpio_int_masterclk_enable = of_get_named_gpio_flags(node,
+                "simple-audio-card,int-masterclk-enable", 0, &flags);
+
+    if (priv->gpio_int_masterclk_enable == -EPROBE_DEFER)
+        return -EPROBE_DEFER;
+    gpio_request_one(priv->gpio_int_masterclk_enable, GPIOF_OUT_INIT_LOW,
+                   "Internal Clock Enable Pin");
+
     priv
->gpio_hp_det = of_get_named_gpio_flags(node,
                 
"simple-audio-card,hp-det-gpio", 0, &flags);
     priv
->gpio_hp_det_invert = !!(flags & OF_GPIO_ACTIVE_LOW);
@@ -498,13 +533,18 @@ static int asoc_simple_card_probe(struct platform_device *pdev)
     
struct snd_soc_dai_link *dai_link;
     
struct device_node *np = pdev->dev.of_node;
     
struct device *dev = &pdev->dev;
-    int num_links, ret;
+    int num_links = (np && of_get_child_by_name(np,
+                    "simple-audio-card,dai-link")) ?
+                    of_get_child_count(np) : 1;
+    struct snd_soc_codec_conf codec_conf[num_links];
+    int ret;
 
-    /* Get the number of DAI links */
+    /* Get the number of DAI links
     if (np && of_get_child_by_name(np, "simple-audio-card,dai-link"))
         num_links = of_get_child_count(np);
     else
         num_links = 1;
+    */

 
     
/* Allocate the private data and the DAI link array */
     priv
= devm_kzalloc(dev,
@@ -519,6 +559,8 @@ static int asoc_simple_card_probe(struct platform_device *pdev)
     dai_link
= priv->dai_link;
     priv
->snd_card.dai_link = dai_link;
     priv
->snd_card.num_links = num_links;
+    priv->snd_card.codec_conf = codec_conf;
+    priv->snd_card.num_configs = num_links;
 
     priv
->gpio_hp_det = -ENOENT;
     priv
->gpio_mic_det = -ENOENT;
@@ -589,6 +631,11 @@ static int asoc_simple_card_remove(struct platform_device *pdev)
     
struct snd_soc_card *card = platform_get_drvdata(pdev);
     
struct simple_card_data *priv = snd_soc_card_get_drvdata(card);
 
+    if (gpio_is_valid(priv->gpio_int_masterclk_enable)) {
+        gpio_set_value(priv->gpio_int_masterclk_enable, 0);
+        gpio_free(priv->gpio_int_masterclk_enable);
+    }
+
     
if (gpio_is_valid(priv->gpio_hp_det))
         snd_soc_jack_free_gpios
(&simple_card_hp_jack, 1,
                     
&simple_card_hp_jack_gpio);
diff
--git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index
2373252..4808089 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1102,6 +1102,9 @@ static void soc_set_name_prefix(struct snd_soc_card *card,
 
     
for (i = 0; i < card->num_configs; i++) {
         
struct snd_soc_codec_conf *map = &card->codec_conf[i];
+
+        if (!map->name_prefix)
+            continue;
         
if (map->of_node && component->dev->of_node != map->of_node)
             
continue;
         
if (map->dev_name && strcmp(component->name, map->dev_name))


Thanks in advance,
Shadi

henni...@googlemail.com

unread,
Oct 18, 2015, 8:49:40 PM10/18/15
to BeagleBoard
Hi,

I have the same problem.
Which kernel are you using?
I'm currently working with the offical BeagleBone 4.1 kernel.
The only useful information I found is this post:
"An underrun (playback) event occurs when the serializer transfer
data from the XRBUF buffer to the XRSR shift register, but the
XRBUF hasn't been filled. Similarly, the overrun (capture) event
occurs when data from the XRSR shift register is transferred to
the XRBUF but it hasn't been read yet."
So I think there is a problem with the mcasp interface and ASoC.

Rick Mann

unread,
Oct 18, 2015, 9:58:12 PM10/18/15
to beagl...@googlegroups.com
I've had the same problem with kernels later than 3.8. On 3.8, I switched to using ti,da830-evm-audio (davinci-evm.c, I think). My DTS (for both types of sound card) call for a 12MHz McASP master clock, but in 4.x kernels, I would actually see a 24MHz signal come off the master clock, and I think that's what led to the underflow.

FWIW, here's my DTS (for 3.8):

https://github.com/JetForMe/podtique/blob/v1/bbb/cape/Podtique1/BB-BONE-AUDI-03-00A0.dts

I would love to get this to work in 4.1.x
> --
> For more options, visit http://beagleboard.org/discuss
> ---
> You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.


--
Rick Mann
rm...@latencyzero.com


William Hermans

unread,
Oct 18, 2015, 11:41:37 PM10/18/15
to beagl...@googlegroups.com
"buffer underflow", heh sounds a bit like an oxy- moron, . . .

Shadi Abdu-Rahman

unread,
Oct 19, 2015, 2:06:05 AM10/19/15
to BeagleBoard
I’m using the v4.1.3-bone15 linux kernel with debian-8.1-minimal-armhf-2015-06-09.

So yeah, it seems something broke between 3.8 and 4.1. I did look at the relevant McAsp registers and they all looked properly setup from what I could see.

I'm not sure what could be wrong. Looking a the relevant code is like trying to find a needle in a haystack. Could be anything (dma engine, etc)

Kind Regards,
Shadi


Den måndag 19 oktober 2015 kl. 03:58:12 UTC+2 skrev Rick M:
My DTS (for both types of sound card) call for a 12MHz McASP master clock, but in 4.x kernels, I would actually see a 24MHz signal come off the master clock, and I think that's what led to the underflow.

I think there's more to it. My configuration is feeding McASP with an external clock from the codec board (24.576 MHz). I've verified that the internal BBB master clock is disabled by my code and that the external clock signal doesn't get doubled or anything.

Kind Regards,
Shadi

Hen Rik

unread,
Oct 19, 2015, 9:39:24 AM10/19/15
to beagl...@googlegroups.com
Today, I tried to migrate my ASoC machine driver to 3.8 kernel.
But now I'm facing with new problems.
For example, there is no option for mcasp interface in bb.org_defconfig.
So, when I compiled the kernel and modules, I didn't find the mcasp kernel module and omap spi kernel module.
If I try to load my machine driver with cape_manager I'll get this error:

[ 3225.697192] bone-capemgr bone_capemgr.9: part_number 'BBB-AUDIOCARD', version 'N/A'
[ 3225.697372] bone-capemgr bone_capemgr.9: slot #5: generic override
[ 3225.697418] bone-capemgr bone_capemgr.9: bone: Using override eeprom data at slot 5
[ 3225.697463] bone-capemgr bone_capemgr.9: slot #5: 'Override Board Name,00A0,Override Manuf,BBB-AUDIOCARD'
[ 3225.697731] bone-capemgr bone_capemgr.9: slot #5: Requesting part number/version based 'BBB-AUDIOCARD-00A0.dtbo
[ 3225.697779] bone-capemgr bone_capemgr.9: slot #5: Requesting firmware 'BBB-AUDIOCARD-00A0.dtbo' for board-name 'Override Board Name', version '00A0'
[ 3225.705153] bone-capemgr bone_capemgr.9: slot #5: dtbo 'BBB-AUDIOCARD-00A0.dtbo' loaded; converting to live tree
[ 3225.705842] bone-capemgr bone_capemgr.9: slot #5: #4 overlays
[ 3225.713279] omap2_mcspi 48030000.spi: could not find pctldev for node /ocp/interrupt-controller@48200000, deferring probe
[ 3225.713334] omap2_mcspi 48030000.spi: pins are not configured from the driver
[ 3225.769575] edma-dma-engine edma-dma-engine.0: allocated channel for 0:17
[ 3225.769729] edma-dma-engine edma-dma-engine.0: allocated channel for 0:16
[ 3225.777262] davinci-mcasp 48038000.mcasp: could not find pctldev for node /ocp/i2c@44e0b000/tps@24/regulators/regulator@1, deferring probe
[ 3225.777319] davinci-mcasp 48038000.mcasp: pins are not configured from the driver
[ 3225.782724] bone-capemgr bone_capemgr.9: slot #5: Applied #4 overlays.
[ 3225.938159] snd-rpi-audiocard sound.11: davinci_audiocard_probe called.
[ 3225.938386] snd-rpi-audiocard sound.11: ASoC: CODEC (null) not registered
[ 3225.947378] snd-rpi-audiocard sound.11: snd_soc_register_card() failed: -517
[ 3225.954968] snd-rpi-audiocard sound.11: davinci_audiocard_probe finished.
[ 3225.956007] platform sound.11: Driver snd-rpi-audiocard requests probe deferral

As you can see at 3225.713279 and 3225.777262, there is no mcasp interface nor spi interface available.
Does anybody has successfully compiled the mcasp0 module, like in 4.1 kernel?
Moreover, do you use the offical Beaglebone repo from Github? (https://github.com/beagleboard/linux)

Thanks!


--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to a topic in the Google Groups "BeagleBoard" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/beagleboard/Yg19ivBxJAw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to beagleboard...@googlegroups.com.

bglaz...@gmail.com

unread,
Dec 17, 2015, 3:40:00 PM12/17/15
to BeagleBoard
Hi Shadi,
Just curious, did you make any progress on this front? I am working on a similar project so I'd be curious if you discovered anything more.
Thanks,
Bruce
Reply all
Reply to author
Forward
0 new messages