• Disclaimer: This Vendor's Forum is a paid-for commercial area. Unlike the rest of diyAudio, the Vendor has complete control of what may or may not be posted in this forum. If you wish to discuss technical matters outside the bounds of what is permitted by the Vendor, please use the non-commercial areas of diyAudio to do so.

LADSPA filters for digital crossovers on the BBB

Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.
Member
Joined 2007
Paid Member
...forgot to include:
Code:
root@botic:/# mpc play
Track4.aif
[paused]  #1/3   0:00/5:03 (0%)
volume:100%   repeat: off   random: off   single: off   consume: off
ERROR: Failed to open audio output
root@botic:/# cat /proc/asound/Botic/pcm0p/sub0/hw_params
closed
root@botic:/# cat /proc/asound/Botic/pcm0p/sub0/sw_params
closed
 
Member
Joined 2007
Paid Member
I had an 88.2/24 wav immediately available - will try to find a 44.1/16 file and load it...

Code:
root@botic:/# aplay -v --dump-hw-params -D default /data/crazylove.wav
Playing WAVE '/data/crazylove.wav' : Signed 24 bit Little Endian in 3bytes, Rate 88200 Hz, Stereo
HW Params of device "default":
--------------------
ACCESS:  MMAP_INTERLEAVED MMAP_NONINTERLEAVED MMAP_COMPLEX RW_INTERLEAVED RW_NONINTERLEAVED
FORMAT:  S8 U8 S16_LE S16_BE U16_LE U16_BE S24_LE S24_BE U24_LE U24_BE S32_LE S32_BE U32_LE U32_BE FLOAT_LE MU_LAW A_LAW IMA_ADPCM S24_3LE S24_3BE U24_3LE U24_3BE S20_3LE S20_3BE U20_3LE U20_3BE S18_3LE S18_3BE U18_3LE U18_3BE
SUBFORMAT:  STD
SAMPLE_BITS: [4 32]
FRAME_BITS: [4 320000]
CHANNELS: [1 10000]
RATE: [4000 4294967295]
PERIOD_TIME: (0 1024000]
PERIOD_SIZE: (0 4294967295]
PERIOD_BYTES: (0 4294967295]
PERIODS: (0 4294967295]
BUFFER_TIME: [1 4294967295]
BUFFER_SIZE: [1 4294967295]
BUFFER_BYTES: [1 4294967295]
TICK_TIME: ALL
--------------------
aplay: set_params:1297: Unable to install hw params:
ACCESS:  RW_INTERLEAVED
FORMAT:  S24_3LE
SUBFORMAT:  STD
SAMPLE_BITS: 24
FRAME_BITS: 48
CHANNELS: 2
RATE: 88200
PERIOD_TIME: (11609 11610)
PERIOD_SIZE: NONE
PERIOD_BYTES: (6138 6144)
PERIODS: NONE
BUFFER_TIME: (46439 46440)
BUFFER_SIZE: 4096
BUFFER_BYTES: 24576
TICK_TIME: 0
 
Member
Joined 2007
Paid Member
...and a 44.1/16 run...
Code:
root@botic:/data# aplay -v --dump-hw-params -D default /data/bacteriuria.wav
Playing WAVE '/data/bacteriuria.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Mono
HW Params of device "default":
--------------------
ACCESS:  MMAP_INTERLEAVED MMAP_NONINTERLEAVED MMAP_COMPLEX RW_INTERLEAVED RW_NONINTERLEAVED
FORMAT:  S8 U8 S16_LE S16_BE U16_LE U16_BE S24_LE S24_BE U24_LE U24_BE S32_LE S32_BE U32_LE U32_BE FLOAT_LE MU_LAW A_LAW IMA_ADPCM S24_3LE S24_3BE U24_3LE U24_3BE S20_3LE S20_3BE U20_3LE U20_3BE S18_3LE S18_3BE U18_3LE U18_3BE
SUBFORMAT:  STD
SAMPLE_BITS: [4 32]
FRAME_BITS: [4 320000]
CHANNELS: [1 10000]
RATE: [4000 4294967295]
PERIOD_TIME: (0 1024000]
PERIOD_SIZE: (0 4294967295]
PERIOD_BYTES: (0 4294967295]
PERIODS: (0 4294967295]
BUFFER_TIME: [1 4294967295]
BUFFER_SIZE: [1 4294967295]
BUFFER_BYTES: [1 4294967295]
TICK_TIME: ALL
--------------------
aplay: set_params:1297: Unable to install hw params:
ACCESS:  RW_INTERLEAVED
FORMAT:  S16_LE
SUBFORMAT:  STD
SAMPLE_BITS: 16
FRAME_BITS: 16
CHANNELS: 1
RATE: 44100
PERIOD_TIME: (23219 23220)
PERIOD_SIZE: NONE
PERIOD_BYTES: (2046 2048)
PERIODS: NONE
BUFFER_TIME: (92879 92880)
BUFFER_SIZE: 4096
BUFFER_BYTES: 8192
TICK_TIME: 0
 
Very good. Aplay will make our life much easier. Until aplay works, it makes no sense to struggle with other players.

Is your asound.conf still the same as the one posted at the beginning of this thread? Again, I want to make sure we have current configs.

Are you really sure squeezelite has used your "default" device with ladpsa? If yes, we will play with the input params which can be specified by aplay.

I would like to see a log from working setup. According to Squeezelite troubleshooting - Page 2 : running squeezelite with -d all=debug -f ~/squeezelite.log Please post the log of working squeezelite, if we can see some useful info. Hopefully it will provide information similar to MPD. Thanks.
 
Member
Joined 2007
Paid Member
With squeezelite I typically use '-o default' though I have tested and the filters work with just 'squeezelite' and no output specified.

Code:
squeezelite -o default -d all=debug -f /root/squeezelite.log
[18:50:37.607626] stream_init:290 init stream
[18:50:37.608361] stream_init:291 streambuf size: 2097152
[18:50:37.615361] output_init_alsa:817 init output
[18:50:37.615475] output_init_alsa:846 requested alsa_buffer: 40 alsa_period: 4 format: any mmap: 1
[18:50:37.615531] output_init_common:346 outputbuf size: 3528000
[18:50:37.615745] output_init_common:370 idle timeout: 0
[18:50:37.654224] output_init_common:410 supported rates: 384000 352800 192000 176400 96000 88200 48000 44100 32000 24000 22500 16000 12000 11025 8000
[18:50:37.672931] output_init_alsa:862 memory locked
[18:50:37.673753] output_thread:638 open output device: default
[18:50:37.673875] alsa_open:355 opening device at: 44100
[18:50:37.692430] alsa_open:406 opened device default using format: S32_LE sample rate: 44100 mmap: 1
[18:50:37.699346] alsa_open:485 buffer: 40 period: 4 -> buffer size: 1764 period size: 441
[18:50:37.729639] output_init_alsa:885 set output sched fifo rt: 45
[18:50:37.729855] decode_init:129 init decode, include codecs:  exclude codecs:
[18:50:37.730454] register_dsd:624 using dsd to decode dsf,dff
[18:50:37.865047] load_ff:621 loaded libavcodec.so.55 (55.34.1)
[18:50:37.865270] load_ff:638 loaded libavformat.so.55 (55.12.0)
[18:50:37.865344] load_ff:652 loaded libavutil.so.53 (53.3.0)
[18:50:37.879054] register_ff:731 using ffmpeg to decode alc
[18:50:37.891745] register_ff:715 using ffmpeg to decode wma,wmap,wmal
[18:50:37.893123] load_faad:610 loaded libfaad.so.2
[18:50:37.893268] register_faad:640 using faad to decode aac
[18:50:37.894213] load_vorbis:300 loaded libvorbisfile.so.3
[18:50:37.894312] register_vorbis:329 using vorbis to decode ogg
[18:50:37.896187] load_flac:258 loaded libFLAC.so.8
[18:50:37.896295] register_flac:286 using flac to decode flc
[18:50:37.896336] register_pcm:384 using pcm to decode aif,pcm
[18:50:37.897033] load_mad:383 loaded libmad.so.0
[18:50:37.897115] register_mad:412 using mad to decode mp3
[18:50:37.897895] discover_server:756 sending discovery
[18:50:37.898685] discover_server:767 got response from: 10.0.1.19:3483
[18:50:37.898883] slimproto:848 connecting to 10.0.1.19:3483
[18:50:37.900935] slimproto:881 connected
[18:50:37.901091] sendHELO:124 mac: 6c:ec:eb:67:6f:9f
[18:50:37.901144] sendHELO:126 cap: Model=squeezelite,AccuratePlayPoints=1,HasDigitalOut=1,HasPolarityInversion=1,Firmware=v1.8,ModelName=SqueezeLite,MaxSampleRate=384000,dsf,dff,alc,wma,wmap,wmal,aac,ogg,flc,aif,pcm,mp3
[18:50:37.924883] process:494 strm
[18:50:37.925060] process_strm:256 strm command q
[18:50:37.925110] decode_flush:190 decode flush
[18:50:37.925148] output_flush:423 flush output buffer
[18:50:37.925193] sendSTAT:171 STAT: STMf
[18:50:37.925400] process:494 strm
[18:50:37.925464] process_strm:256 strm command q
[18:50:37.925597] decode_flush:190 decode flush
[18:50:37.925644] output_flush:423 flush output buffer
[18:50:37.925686] sendSTAT:171 STAT: STMf
[18:50:37.925807] process:494 setd
[18:50:37.925871] process:494 setd
[18:50:37.925926] process:494 aude
[18:50:37.926019] process_aude:395 enable spdif: 1 dac: 1
[18:50:37.926089] process:494 audg
[18:50:37.926130] process_audg:413 audg gainL: 49408 gainR: 49408 adjust: 1
[18:50:37.926171] set_volume:246 setting internal gain left: 49408 right: 49408
[18:50:38.281540] process:494 strm
[18:50:38.281747] process_strm:256 strm command t
[18:50:38.281801] sendSTAT:171 STAT: STMt
[18:50:43.279159] process:494 strm
[18:50:43.279379] process_strm:256 strm command t
[18:50:43.279437] sendSTAT:171 STAT: STMt
[18:50:48.277856] process:494 strm
[18:50:48.278074] process_strm:256 strm command t
[18:50:48.278132] sendSTAT:171 STAT: STMt
[18:50:53.281293] process:494 strm
[18:50:53.281503] process_strm:256 strm command t
[18:50:53.281559] sendSTAT:171 STAT: STMt
[18:50:56.328064] slimproto_stop:919 slimproto stop
[18:50:56.428589] decode_close:175 close decode
[18:50:56.522421] stream_close:322 close stream
[18:50:56.623680] output_close_alsa:890 close output
 
Member
Joined 2007
Paid Member
Just a reminder that 'aplay' did previously use the alsa filters correctly... ;) Now it just dumps this same error, though 'speaker-test' still works correctly.

For now:
Code:
root@botic:/data# aplay -v [B]--mmap[/B] heaven.wav
Playing WAVE 'heaven.wav' : Signed 24 bit Little Endian in 3bytes, Rate 88200 Hz, Stereo
aplay: set_params:1297: Unable to install hw params:
ACCESS:  MMAP_INTERLEAVED
FORMAT:  S24_3LE
SUBFORMAT:  STD
SAMPLE_BITS: 24
FRAME_BITS: 48
CHANNELS: 2
RATE: 88200
PERIOD_TIME: (11609 11610)
PERIOD_SIZE: NONE
PERIOD_BYTES: (6138 6144)
PERIODS: NONE
BUFFER_TIME: (46439 46440)
BUFFER_SIZE: 4096
BUFFER_BYTES: 24576
TICK_TIME: 0
 
Member
Joined 2007
Paid Member
Actually, let's make it exactly the same as squeezelite:

Code:
aplay -v --mmap --buffer-size=1764 --period-size=441 --format=S32_LE your-441.wav

Sorry - missed this due to system delay...

YES, this plays through the filters. (awesome debug output!) The last three plugs listed are not in the asound.conf - not sure where they are coming from... capture defaults?

Code:
root@botic:/# aplay -v --mmap --buffer-size=1764 --period-size=441 --format=S16_LE /data/bacteriuria.wav
Playing WAVE '/data/bacteriuria.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Mono
Plug PCM: Route conversion PCM (sformat=S16_LE)
  Transformation table:
    0 <- 0
    1 <- 0
    2 <- 0
    3 <- 0
Its setup is:
  stream       : PLAYBACK
  access       : MMAP_INTERLEAVED
  format       : S16_LE
  subformat    : STD
  channels     : 1
  rate         : 44100
  exact rate   : 44100 (44100/1)
  msbits       : 16
  buffer_size  : 1764
  period_size  : 441
  period_time  : 10000
  tstamp_mode  : NONE
  period_step  : 1
  avail_min    : 441
  period_event : 0
  start_threshold  : 1764
  stop_threshold   : 1764
  silence_threshold: 0
  silence_size : 0
  boundary     : 924844032
Slave: Linear Integer <-> Linear Float conversion PCM (FLOAT_LE)
Its setup is:
  stream       : PLAYBACK
  access       : MMAP_INTERLEAVED
  format       : S16_LE
  subformat    : STD
  channels     : 4
  rate         : 44100
  exact rate   : 44100 (44100/1)
  msbits       : 16
  buffer_size  : 1764
  period_size  : 441
  period_time  : 10000
  tstamp_mode  : NONE
  period_step  : 1
  avail_min    : 441
  period_event : 0
  start_threshold  : 1764
  stop_threshold   : 1764
  silence_threshold: 0
  silence_size : 0
  boundary     : 924844032
Slave: LADSPA PCM
  Playback:
    Policy: none
    Filename: /usr/local/lib/ladspa/RTlr4lowpass.so
    Plugin Name: RT LR4 lowpass
    Plugin Label: RTlr4lowpass
    Plugin Unique ID: 9020
    Instances:
      Depth: 0
         InChannels: 0
         InPorts: 1 "Input"
         OutChannels: 1
         OutPorts: 2 "Output"
    Audio input port bindings:
      0 -> 1
    Control input port initial values:
      0 "Frequency (Hz)" = 150.00000000
    Audio output port bindings:
      0 -> NONE
      1 -> 2
    Policy: none
    Filename: /usr/local/lib/ladspa/RTlr4hipass.so
    Plugin Name: RT LR4 highpass
    Plugin Label: RTlr4hipass
    Plugin Unique ID: 9021
    Instances:
      Depth: 1
         InChannels: 0
         InPorts: 1 "Input"
         OutChannels: 0
         OutPorts: 2 "Output"
    Audio input port bindings:
      0 -> 1
    Control input port initial values:
      0 "Frequency (Hz)" = 150.00000000
    Audio output port bindings:
      0 -> 2
    Policy: none
    Filename: /usr/local/lib/ladspa/RTlr4lowpass.so
    Plugin Name: RT LR4 lowpass
    Plugin Label: RTlr4lowpass
    Plugin Unique ID: 9020
    Instances:
      Depth: 2
         InChannels: 1
         InPorts: 1 "Input"
         OutChannels: 3
         OutPorts: 2 "Output"
    Audio input port bindings:
      0 -> NONE
      1 -> 1
    Control input port initial values:
      0 "Frequency (Hz)" = 150.00000000
    Audio output port bindings:
      0 -> NONE
      1 -> NONE
      2 -> NONE
      3 -> 2
    Policy: none
    Filename: /usr/local/lib/ladspa/RTlr4hipass.so
    Plugin Name: RT LR4 highpass
    Plugin Label: RTlr4hipass
    Plugin Unique ID: 9021
    Instances:
      Depth: 3
         InChannels: 1
         InPorts: 1 "Input"
         OutChannels: 2
         OutPorts: 2 "Output"
    Audio input port bindings:
      0 -> NONE
      1 -> 1
    Control input port initial values:
      0 "Frequency (Hz)" = 150.00000000
    Audio output port bindings:
      0 -> NONE
      1 -> NONE
      2 -> 2
  Capture:
Its setup is:
  stream       : PLAYBACK
  access       : MMAP_NONINTERLEAVED
  format       : FLOAT_LE
  subformat    : STD
  channels     : 4
  rate         : 44100
  exact rate   : 44100 (44100/1)
  msbits       : 32
  buffer_size  : 1764
  period_size  : 441
  period_time  : 10000
  tstamp_mode  : NONE
  period_step  : 1
  avail_min    : 441
  period_event : 0
  start_threshold  : 1764
  stop_threshold   : 1764
  silence_threshold: 0
  silence_size : 0
  boundary     : 924844032
Slave: LADSPA PCM
  Playback:
    Policy: none
    Filename: /usr/lib/ladspa/delay.so
    Plugin Name: Simple Delay Line
    Plugin Label: delay_5s
    Plugin Unique ID: 1043
    Instances:
      Depth: 0
         InChannels: 1
         InPorts: 2 "Input"
         OutChannels: 1
         OutPorts: 3 "Output"
    Audio input port bindings:
      0 -> NONE
      1 -> 2
    Control input port initial values:
      0 "Delay (Seconds)" = 0.00120000
      1 "Dry/Wet Balance" = 1.00000000
    Audio output port bindings:
      0 -> NONE
      1 -> 3
    Policy: none
    Filename: /usr/lib/ladspa/delay.so
    Plugin Name: Simple Delay Line
    Plugin Label: delay_5s
    Plugin Unique ID: 1043
    Instances:
      Depth: 1
         InChannels: 3
         InPorts: 2 "Input"
         OutChannels: 3
         OutPorts: 3 "Output"
    Audio input port bindings:
      0 -> NONE
      1 -> NONE
      2 -> NONE
      3 -> 2
    Control input port initial values:
      0 "Delay (Seconds)" = 0.00120000
      1 "Dry/Wet Balance" = 1.00000000
    Audio output port bindings:
      0 -> NONE
      1 -> NONE
      2 -> NONE
      3 -> 3
    Policy: none
    Filename: /usr/lib/ladspa/delay.so
    Plugin Name: Simple Delay Line
    Plugin Label: delay_5s
    Plugin Unique ID: 1043
    Instances:
      Depth: 2
         InChannels: 0
         InPorts: 2 "Input"
         OutChannels: 0
         OutPorts: 3 "Output"
    Audio input port bindings:
      0 -> 2
    Control input port initial values:
      0 "Delay (Seconds)" = 0.00000000
      1 "Dry/Wet Balance" = 0.00000000
    Audio output port bindings:
      0 -> 3
    Policy: none
    Filename: /usr/lib/ladspa/delay.so
    Plugin Name: Simple Delay Line
    Plugin Label: delay_5s
    Plugin Unique ID: 1043
    Instances:
      Depth: 3
         InChannels: 2
         InPorts: 2 "Input"
         OutChannels: 2
         OutPorts: 3 "Output"
    Audio input port bindings:
      0 -> NONE
      1 -> NONE
      2 -> 2
    Control input port initial values:
      0 "Delay (Seconds)" = 0.00000000
      1 "Dry/Wet Balance" = 0.00000000
    Audio output port bindings:
      0 -> NONE
      1 -> NONE
      2 -> 3
  Capture:
Its setup is:
  stream       : PLAYBACK
  access       : MMAP_NONINTERLEAVED
  format       : FLOAT_LE
  subformat    : STD
  channels     : 4
  rate         : 44100
  exact rate   : 44100 (44100/1)
  msbits       : 32
  buffer_size  : 1764
  period_size  : 441
  period_time  : 10000
  tstamp_mode  : NONE
  period_step  : 1
  avail_min    : 441
  period_event : 0
  start_threshold  : 1764
  stop_threshold   : 1764
  silence_threshold: 0
  silence_size : 0
  boundary     : 924844032
Slave: Plug PCM: Linear Integer <-> Linear Float conversion PCM (S32_LE)
Its setup is:
  stream       : PLAYBACK
  access       : MMAP_NONINTERLEAVED
  format       : FLOAT_LE
  subformat    : STD
  channels     : 4
  rate         : 44100
  exact rate   : 44100 (44100/1)
  msbits       : 32
  buffer_size  : 1764
  period_size  : 441
  period_time  : 10000
  tstamp_mode  : NONE
  period_step  : 1
  avail_min    : 441
  period_event : 0
  start_threshold  : 1764
  stop_threshold   : 1764
  silence_threshold: 0
  silence_size : 0
  boundary     : 924844032
Slave: Rate conversion PCM (88200, sformat=S32_LE)
Converter: linear-interpolation
Protocol version: 10002
Its setup is:
  stream       : PLAYBACK
  access       : MMAP_INTERLEAVED
  format       : S32_LE
  subformat    : STD
  channels     : 4
  rate         : 44100
  exact rate   : 44100 (44100/1)
  msbits       : 32
  buffer_size  : 1764
  period_size  : 441
  period_time  : 10000
  tstamp_mode  : NONE
  period_step  : 1
  avail_min    : 441
  period_event : 0
  start_threshold  : 1764
  stop_threshold   : 1764
  silence_threshold: 0
  silence_size : 0
  boundary     : 924844032
Slave: Hardware PCM card 0 'Botic' device 0 subdevice 0
Its setup is:
  stream       : PLAYBACK
  access       : MMAP_INTERLEAVED
  format       : S32_LE
  subformat    : STD
  channels     : 4
  rate         : 88200
  exact rate   : 88200 (88200/1)
  msbits       : 32
  buffer_size  : 3528
  period_size  : 882
  period_time  : 10000
  tstamp_mode  : NONE
  period_step  : 1
  avail_min    : 882
  period_event : 0
  start_threshold  : 3528
  stop_threshold   : 3528
  silence_threshold: 0
  silence_size : 0
  boundary     : 1849688064
  appl_ptr     : 0
  hw_ptr       : 0
mmap_area[0] = 0x1fc0f10,0,16 (16)
 
Member
Joined 2007
Paid Member
Things do not happen by accidence. Did you by any chance change the alsa chain setting? What is your output card? Does it really have 4 channels? Can it be perhaps switched to a different configuration?
Sorry, no idea what might have changed the behavior of aplay. Yes to 4 channels - the 'card' is the Twisted Pear reclocking system: Hermes and Cronus. [That is why I started this thread in the Twisted Pear area of the commercial sector...]
 
Perfect, we are getting somewhere.

The end of the chain is conversion to 88.2kHz which is the current rate of your soundcard. It has to be switched somehow, alsamixer?

The conversion is performed by the plug plugin defined in the speaker device. IMO it works correctly.

Now the question is whether the chain works only for a specific combination of buffer/period times.

Once the params are confirmed to work in aplay, they are simple to convert into corresponding params of mpd config
 
Member
Joined 2007
Paid Member
One thing I find and I know that others have found is that error conditions persist beyond a simple re-boot. Now, when a reboot seems needed, I always do it twice.

I'm not concerned about aplay for now, especially if we can get mpd.conf working. I imagine a fresh build from the Botic image should restore it.

Remember that the report of sample rate can be misleading in - for example - the command: cat /proc/asound/Botic/pcm0p/sub0/hw_params With 2 channels it matches the music's sample rate but with the crossover active and 4 channel output, the hw_params report 2X the input sample rate.
 
One thing I find and I know that others have found is that error conditions persist beyond a simple re-boot. Now, when a reboot seems needed, I always do it twice.

Probably something BBB/this DAC specific.

I'm not concerned about aplay for now, especially if we can get mpd.conf working. I imagine a fresh build from the Botic image should restore it.

Aplay is great for finding proper working parameters. Transforming them to mpd.conf is trivial.


Remember that the report of sample rate can be misleading in - for example - the command: cat /proc/asound/Botic/pcm0p/sub0/hw_params With 2 channels it matches the music's sample rate but with the crossover active and 4 channel output, the hw_params report 2X the input sample rate.

IMO that does not make it incorrect. The chain really needs the final conversion to 88.2kHz. Without it you would hear pitch-shifted sound. A soundcard must report correct current samplerate to the upper layers. Perhaps for 2 channels your card runs at 44100 and for 4channels at 88200. Unusual but fair, it reports correctly what it does so that the upper layers (the last plug plugin) can adjust.

BTW the linear interpolation reported for the last plug is extremely low quality :)
 
Last edited:
Member
Joined 2007
Paid Member
OK, I have tried a different few formats and sample rates with aplay, and they all work with alsa filters using mmap, buffer = 1764, and period = 441. For example:
aplay -v -c2 --mmap --buffer-size=1764 --period-size=441 --format=S32_LE -r 96000 lucia.wav

So, I tried this for mpd.conf

Code:
audio_output {
        type            "alsa"
        name            "Botic"
        device          "default"
        use_mmap        "yes"
        buffer_time     "1764"
        period_time     "441"
#       dsd_usb         "no"
#       dsd_native      "yes"
#       dsd_native_type "3"
        priority        "FIFO:32"
        mixer_type      "software"
#       mixer_device    "default"       # optional
#       mixer_control   "PCM"           # optional
#       mixer_index     "0"             # optional
}

Do you think it worked? :eek::eek::eek:


IT WORKED!!! :cheers:
Congratulations and THANKS! :cheers:

Now i guess the question is whether it is optimized, what about DSD, and also is it repeatable with a fresh distro of Botic? I will get CPU numbers right now and then I must do other things for the day...
 
Member
Joined 2007
Paid Member
Not fully optimized:

CPU w/ 44.1/16 = 35%
CPU w/ 96/32 = 48% - better than squeezelite

Problems at 88.2k:
Code:
root@botic:/data# mpc play 4
heaven.wav
[paused]  #4/4   0:00/4:33 (0%)
volume:100%   repeat: off   random: off   single: off   consume: off
ERROR: Failed to open audio output
and the log:
Code:
Jul 27 21:58 : client: process command "currentsong"
Jul 27 21:58 : decoder_thread: probing plugin sndfile
Jul 27 21:58 : decoder: audio_format=88200:32:2, seekable=true
Jul 27 21:58 : output: closed plugin=alsa name="Botic"
Jul 27 21:58 : alsa_output: opened default type=PLUG
Jul 27 21:58 : alsa_output: format=S32_LE (Signed 32 bit Little Endian)
Jul 27 21:58 : alsa_output: buffer: size=2..4096 time=22..46440
Jul 27 21:58 : alsa_output: period: size=0..2049 time=11..23220
Jul 27 21:58 : alsa_output: Failed to open "Botic" [alsa]: Error opening ALSA device "default" (snd_pcm_hw_params): Invalid argument
Jul 27 21:58 : output: Failed to open audio output
Jul 27 21:58 : player: problems opening audio device while playing "heaven.wav"
Jul 27 21:58 : client: command returned 0
Yet, this plays the track: aplay -v -c2 --mmap --buffer-size=1764 --period-size=441 --format=S32_LE -r 88200 heaven.wav
[Original track bit depth is 24, not 32]
adding format "*:32:2" to mpd.conf produces errors with all files
 
Last edited:
Member
Joined 2007
Paid Member
Provisional success playing available files: 44.1, 88.2 & 96 kHz...
I have no idea if these period and buffer times are best but they work for all three file types.

mpd.conf:
Code:
audio_output {
        type            "alsa"
        name            "Botic"
        device          "default"
        use_mmap        "yes"
        buffer_time     "2560"
        period_time     "640"
#       format          "*:32:2"
#       dsd_usb         "no"
#       dsd_native      "yes"
#       dsd_native_type "3"
        priority        "FIFO:32"
        mixer_type      "software"
#       mixer_device    "default"       # optional
#       mixer_control   "PCM"           # optional
#       mixer_index     "0"             # optional
}

BTW the linear interpolation reported for the last plug is extremely low quality :)

I wonder if this is a concern considering that sample rates are increased by a factor of two. That conversion was put there by alsa, you don't find it in asound.conf. I see that alsa also initiates an integer->float conversion that is not in asound.conf. Obviously it would be nice to keep every conversion as clean as possible (within reason).

Here are CPU demands playing via MPC (no client).
Code:
idle after playing at 44.1/16

 PID USER      PR  NI  VIRT  RES  SHR S  %CPU %MEM    TIME+  COMMAND                                                                                                                                                                                                 
 1254 root      20   0  2696 1756 1328 R   0.7  0.3   0:04.32 top                                                                                                                  
 1399 mpd       20   0 79248  74m  26m S   0.3 14.9   1:06.62 mpd                  

play 44.1/16

 1399 mpd       20   0 83472  78m  26m S  22.1 15.7   0:54.47 mpd                                                                                                                  
 1254 root      20   0  2696 1756 1328 R   0.7  0.3   0:03.93 top       

play 88.2/32

 1399 mpd       20   0 87572  82m  26m S  43.0 16.5   0:39.43 mpd                                                                                                                  
 1254 root      20   0  2696 1756 1328 R   0.7  0.3   0:03.70 top      

play 96/32

 1399 mpd       20   0 87572  82m  26m S  45.2 16.5   0:13.55 mpd                                                                                                                  
 1254 root      20   0  2696 1756 1328 R   0.7  0.3   0:03.36 top
 
Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.