Uploaded image for project: ' AGL Development'
  1. AGL Development
  2. SPEC-2770

Pipewire: Buffer Underrun when playing to MOST ALSA Soundcard

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Major Major
    • None
    • master
    • None
    • m3ulcb, Microchip INICnet Slim Board Family, Amplifier
    • Renesas M3

      Playing to MOST soundcard "ep016ch" currently results in constant buffer under-runs. Sound is crackling/choppy and does not recover.

      Here the journal log when executing "gst-launch-1.0 audiotestsrc ! pwaudiosink":

      Aug 09 07:32:54 m3ulcb pipewire[3999]: Hardware PCM card 2 'Microchip MOST:2' device 0 subdevice 0
      Aug 09 07:32:54 m3ulcb pipewire[3999]: Its setup is:
      Aug 09 07:32:54 m3ulcb pipewire[3999]: stream : PLAYBACK
      Aug 09 07:32:54 m3ulcb pipewire[3999]: access : MMAP_INTERLEAVED
      Aug 09 07:32:54 m3ulcb pipewire[3999]: format : S16_LE
      Aug 09 07:32:54 m3ulcb pipewire[3999]: subformat : STD
      Aug 09 07:32:54 m3ulcb pipewire[3999]: channels : 6
      Aug 09 07:32:54 m3ulcb pipewire[3999]: rate : 48000
      Aug 09 07:32:54 m3ulcb pipewire[3999]: exact rate : 48000 (48000/1)
      Aug 09 07:32:54 m3ulcb pipewire[3999]: msbits : 16
      Aug 09 07:32:54 m3ulcb pipewire[3999]: buffer_size : 1344
      Aug 09 07:32:54 m3ulcb pipewire[3999]: period_size : 84
      Aug 09 07:32:54 m3ulcb pipewire[3999]: period_time : 1750
      Aug 09 07:32:54 m3ulcb pipewire[3999]: tstamp_mode : ENABLE
      Aug 09 07:32:54 m3ulcb pipewire[3999]: tstamp_type : MONOTONIC
      Aug 09 07:32:54 m3ulcb pipewire[3999]: period_step : 1
      Aug 09 07:32:54 m3ulcb pipewire[3999]: avail_min : 84
      Aug 09 07:32:54 m3ulcb pipewire[3999]: period_event : 0
      Aug 09 07:32:54 m3ulcb pipewire[3999]: start_threshold : 9223372036854775807
      Aug 09 07:32:54 m3ulcb pipewire[3999]: stop_threshold : 1344
      Aug 09 07:32:54 m3ulcb pipewire[3999]: silence_threshold: 0
      Aug 09 07:32:54 m3ulcb pipewire[3999]: silence_size : 0
      Aug 09 07:32:54 m3ulcb pipewire[3999]: boundary : 6052837899185946624
      Aug 09 07:32:54 m3ulcb pipewire[3999]: appl_ptr : 0
      Aug 09 07:32:54 m3ulcb pipewire[3999]: hw_ptr : 0
      Aug 09 07:32:54 m3ulcb pipewire[3999]: [E][000000268.861595][alsa-utils.c:544 alsa_recover()] 0xaaaab938e8b0: xrun of 12421 usec 596 0.000000
      Aug 09 07:32:54 m3ulcb pipewire[3999]: [E][000000268.929796][alsa-utils.c:544 alsa_recover()] 0xaaaab938e8b0: xrun of 10076 usec 483 0.000000
      Aug 09 07:32:54 m3ulcb pipewire[3999]: [E][000000268.997693][alsa-utils.c:544 alsa_recover()] 0xaaaab938e8b0: xrun of 6224 usec 298 0.000000

       

      The issue relaxes if you modify /usr/bin/unicens-config.sh to provide larger/more buffers.
      Modify the follwing lines...

      echo 128 > /sys/devices/virtual/most/mostcore/devices/mdev2/ep01/set_number_of_buffers 2>/dev/null
      echo 6048 > /sys/devices/virtual/most/mostcore/devices/mdev2/ep01/set_buffer_size 2>/dev/null

      within this section...

      ##########################################
      # interface: mdev2
      #aim: sound
      #name: ep01-6ch.6x16
      echo tx > /sys/devices/virtual/most/mostcore/devices/mdev2/ep01/set_direction 2>/dev/null
      echo sync > /sys/devices/virtual/most/mostcore/devices/mdev2/ep01/set_datatype 2>/dev/null
      echo 16 > /sys/devices/virtual/most/mostcore/devices/mdev2/ep01/set_number_of_buffers 2>/dev/null
      echo 1008 > /sys/devices/virtual/most/mostcore/devices/mdev2/ep01/set_buffer_size 2>/dev/null
      echo 12 > /sys/devices/virtual/most/mostcore/devices/mdev2/ep01/set_subbuffer_size 2>/dev/null
      echo 42 > /sys/devices/virtual/most/mostcore/devices/mdev2/ep01/set_packets_per_xact 2>/dev/nullecho mdev2:ep01:ep01-6ch.6x16 > /sys/devices/virtual/most/mostcore/aims/sound/add_link 2>/dev/null

       

      However, there is still 2 seconds of disturbance after starting to play audio.
      Speaker-test on ALSA works fine.

       

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            gkiagia Georgios Kiagiadakis
            tjahnke Tobias Jahnke
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: