• WANTED: Happy members who like to discuss audio and other topics related to our interest. Desire to learn and share knowledge of science required. There are many reviews of audio hardware and expert members to help answer your questions. Click here to have your audio equipment measured for free!

Using miniDSP 2 x 4 HD's usb port as output.

OP
phoenixdogfan

phoenixdogfan

Major Contributor
Forum Donor
Joined
Nov 6, 2018
Messages
3,335
Likes
5,233
Location
Nashville
So can anyone document the successful usage of the 2 X 4 HD as follows: Streamer===>miniDSP Toslink input===>miniDSP PEQ===>miniDSP digital Xover===>4 channel output (LR + 2 subs) via miniDSP micro USB output====>USB input Windows PC====>4 discrete channels input into JRIVER via WDM driver===>Dirac Live DL 3 on DL Studio===>4 channels discrete output (LR + 2 LR subs) via USB (Direct, Wasapi or Asio)===>USB input Multi channel DAC (Octo and or Motu)?

And how do you do it?
 

mattf

Member
Joined
Feb 26, 2021
Messages
13
Likes
7
That's really a rather specific and complex chain. I'm not sure you'll find anyone who's done precisely that, but I suppose if there is someone, they're likely to be on here ;-)

If you're committed to using a PC as a big part of the source, why not eliminate most of the chain, and just have this:

PC ===> Octo

Any PC would have the horsepower to do streaming, crossover, EQ, and I'm not sure about how Dirac works, but in terms of CPU, it should be fine.

Most of the pieces of your chain stay in the digital domain, so there isn't much benefit to using external boxes ("quality" of sound) doesn't enter into it 'till we get to the DAC, unless something is REALLY wrong with the PC. So you could save a lot of money and complexity by just having a powerful software chain. Eliminating potential jitter from all of those interconnects (like Toslink) would be another benefit to keeping it all in software. Computers don't lose bits when shuffling them around. You could have a perfect chain right up to the DAC.

HOW that might work is out of my experience; I haven't used Windows in 20 years.

This may sound weird but I think where things like the MiniDSP really shine is that they're a black box computer. They do one thing, do it well, do it after a 2-second boot, and don't crash. You can stick them behind your shelf, and they'll just do their thing forever. But if you start doing stuff in a computer, then you may as well just use the computer. I myself am working through a similar process... I'm using a MiniDSP2x4HD effectively as a pre-amp/DAC, hooked to a raspberry pi, which acts as the streamer. But streaming takes about 5% of one of the Pi's 4 CPUs. And it's plenty powerful enough to do the DSP functions that the MiniDSP has. So I'm thinking of removing that box and doing it all in the Pi. I'll have to buy DACs, of course, and an ADC if I want to keep using my turntable, but that's just money :)

You might have to be a computer nerd in addition to an audio nerd to pull all this off, even on JRiver. I'm not sure.
 

mattf

Member
Joined
Feb 26, 2021
Messages
13
Likes
7
Another interesting solution might be to look into Allo's Piano DAC 2.1. It won't give you room correction, but it sounds good and does crossover. I've got one with the Kali reclocker and their small pc board that I used for a long time; it sounds great. I'm looking to sell it now that I've got the MiniDSP based setup if anyone is interested.

Maybe Roon has room correction integration? I know it has some EQ features. Running this thing as a Roon endpoint might be perfect; keep the need to be a Linux expert out of it and just have it be a dumb Roon endpoint.
 
OP
phoenixdogfan

phoenixdogfan

Major Contributor
Forum Donor
Joined
Nov 6, 2018
Messages
3,335
Likes
5,233
Location
Nashville
That's really a rather specific and complex chain. I'm not sure you'll find anyone who's done precisely that, but I suppose if there is someone, they're likely to be on here ;-)

If you're committed to using a PC as a big part of the source, why not eliminate most of the chain, and just have this:

PC ===> Octo

Any PC would have the horsepower to do streaming, crossover, EQ, and I'm not sure about how Dirac works, but in terms of CPU, it should be fine.

Most of the pieces of your chain stay in the digital domain, so there isn't much benefit to using external boxes ("quality" of sound) doesn't enter into it 'till we get to the DAC, unless something is REALLY wrong with the PC. So you could save a lot of money and complexity by just having a powerful software chain. Eliminating potential jitter from all of those interconnects (like Toslink) would be another benefit to keeping it all in software. Computers don't lose bits when shuffling them around. You could have a perfect chain right up to the DAC.

HOW that might work is out of my experience; I haven't used Windows in 20 years.

This may sound weird but I think where things like the MiniDSP really shine is that they're a black box computer. They do one thing, do it well, do it after a 2-second boot, and don't crash. You can stick them behind your shelf, and they'll just do their thing forever. But if you start doing stuff in a computer, then you may as well just use the computer. I myself am working through a similar process... I'm using a MiniDSP2x4HD effectively as a pre-amp/DAC, hooked to a raspberry pi, which acts as the streamer. But streaming takes about 5% of one of the Pi's 4 CPUs. And it's plenty powerful enough to do the DSP functions that the MiniDSP has. So I'm thinking of removing that box and doing it all in the Pi. I'll have to buy DACs, of course, and an ADC if I want to keep using my turntable, but that's just money :)

You might have to be a computer nerd in addition to an audio nerd to pull all this off, even on JRiver. I'm not sure.
I'm exploring this option as well. The only problem with the PC is my fourth genration I7 HP Envy sounds like a Pratt & Whitney when asked to do some of the more complex stuff. I also have an I3 from Dell, and I'm wondering if I can run Desktop Netflix, Qobuz, JRiver, Dirac Live Studio,, DMG Audio EQuilibrium, Defophonica or Ekio software Xover, and Asio for all without having the whole PC introduce 30 seconds of latency.

As far as I'm concerned PC's are my number one preference, but latency and processor fan noise are the enemies that have to be defeated to make that option work for all my use cases.
 
Last edited:

mdsimon2

Major Contributor
Forum Donor
Joined
Oct 20, 2020
Messages
2,513
Likes
3,366
Location
Detroit, MI
I've had this thread in the back of my mind for a while now and as I recently started playing with a RPi 4 and CamillaDSP I thought it would be good to see if I could get this to work.

Long story short, you can absolutely use a DDRC-24 with a RPi and CamillaDSP to implement Dirac processing and then route the Dirac modified signal to another (ideally higher performance) USB DAC.

All you need to do is specify the DDRC-24 as your capture device and your other USB DAC as the playback device in your CamillaDSP .yml file. TOSLINK and analog inputs work perfectly and any processing in the DDRC-24 is applied to your output signal. Latency seems pretty good, maybe a slight delay but I think that is more the inherent delay in the DDRC-24 than anything else. I do not think the DDRC-24 USB input will work because that would involve a more complicated signal path (i.e. RPi usb out -> DDRC-24 -> CamillaDSP capture -> CamillaDSP playback). As you can imagine measured performance in this configuration is just as good as your USB DAC.

The only thing that I can't quite figure out is how you would run Dirac measurements in this case as the DDRC-24 is connected to the RPi which obviously does not run miniDSP / Dirac software. The best that I can come up with is to run the configuration using the DDRC-24 connected to a Mac or PC and then switch to the high performance DAC after the configuration is done. This would seem to work well for applications only requiring a max of 4 output channels (2.1 or 2.2 setups for example) but I cannot think of how this would work with more output channels. Would definitely welcome any suggestions as to how you can make this work with more channels, for example a DDRC-24 implementing stereo Dirac correction applied to 3 way active speakers + subs with x-over / peq handled in CamillaDSP and an 8 channel USB DAC.

Michael
 

mdsimon2

Major Contributor
Forum Donor
Joined
Oct 20, 2020
Messages
2,513
Likes
3,366
Location
Detroit, MI
The only thing that I can't quite figure out is how you would run Dirac measurements in this case as the DDRC-24 is connected to the RPi which obviously does not run miniDSP / Dirac software. The best that I can come up with is to run the configuration using the DDRC-24 connected to a Mac or PC and then switch to the high performance DAC after the configuration is done. This would seem to work well for applications only requiring a max of 4 output channels (2.1 or 2.2 setups for example) but I cannot think of how this would work with more output channels. Would definitely welcome any suggestions as to how you can make this work with more channels, for example a DDRC-24 implementing stereo Dirac correction applied to 3 way active speakers + subs with x-over / peq handled in CamillaDSP and an 8 channel USB DAC.

Michael

Thought a bit more about how to setup Dirac on the DDRC-24 when using more than 4 output channels, I think you should be able to do this pretty easily if you are using a pro audio interface with analog inputs. For example you could use a DDRC-24 + RPi 4 + MOTU Ultralite Mk5 to make something similar to a miniDSP SHD but with 10 output channels instead of 4. Here is how I would do it.

1) Connect Mk5 to RPi via USB
2) Setup CamillaDSP configuration on RPi using 2 analog inputs and up to 10 analog outputs of the Mk5 (I am assuming you would implement all processing outside of Dirac in the RPi / CamillaDSP)
3) Setup simple routing matrix in DDRC-24 (L -> out 1, R -> out 2), connect DDRC-24 analog outputs 1 / 2 to analog inputs of Mk5
4) Run Dirac configuration with DDRC-24 connected to Mac / PC
5) Once you are happy with your Dirac configuration disconnect DDRC-24 from PC and connect DDRC-24 to RPi via USB
6) Change your CamillaDSP configuration so DDRC-24 is used as capture device instead of Mk5 analog inputs
7) Enjoy substantially improved analog performance over the DDRC-24 with 10 channels of balanced output :)

You could also do a similar setup with a USB DAC without an ADC (like an Okto dac8 pro) if you added a cheap but decent performance ADC (maybe a Focusrite Scarlett 2i2). Setup would be the same as above, you would use the ADC when configuring Dirac and then remove it from signal chain in your final implementation.

Can anyone think of a better way to do this?

Michael
 
Last edited:

kukocz

Active Member
Forum Donor
Joined
Nov 19, 2018
Messages
166
Likes
155
Location
PL
The only thing that I can't quite figure out is how you would run Dirac measurements in this case as the DDRC-24 is connected to the RPi which obviously does not run miniDSP / Dirac software.
Michael
Try to install minidsp-rs on RPi and enable server to be visible over the network. For sure, the standalone DDRC plugin works fine (you need to specify IP address of the minidsp server).
You can also turn on advertising to the official miniDPS mobile app (documentation: Daemon - minidsp-rs).
I don't know if this will collide with camilladsp but it's worth to try ;)

EDIT:/
Just realized that minidsp-rs exposes only control functionality over the network. Dirac configuration probably won't work as it needs access to audio interface. You can try to implement VirtualHere USB (it's free for one USB port virtualization) used in MiniDSP preamp project. Then you can connect remotely to the minidsp (raspberry will be acting USB host and your PC as client) but then it will cut the access to the minidsp for camiladsp while active.
 
Last edited:

mdsimon2

Major Contributor
Forum Donor
Joined
Oct 20, 2020
Messages
2,513
Likes
3,366
Location
Detroit, MI
Try to install minidsp-rs on RPi and enable server to be visible over the network. For sure, the standalone DDRC plugin works fine (you need to specify IP address of the minidsp server).
You can also turn on advertising to the official miniDPS mobile app (documentation: Daemon - minidsp-rs).
I don't know if this will collide with camilladsp but it's worth to try ;)

EDIT:/
Just realized that minidsp-rs exposes only control functionality over the network. Dirac configuration probably won't work as it needs access to audio interface. You can try to implement VirtualHere USB (it's free for one USB port virtualization) used in MiniDSP preamp project. Then you can connect remotely to the minidsp (raspberry will be acting USB host and your PC as client) but then it will cut the access to the minidsp for camiladsp while active.

Good suggestions, I will need to give minidsp-rs and VirtualHere USB a look. Although if VirtualHere USB cuts access for CamillaDSP I don't see how Dirac configuration will work. Either way just being able to use the general miniDSP software remotely would be great.

MIchael
 

kukocz

Active Member
Forum Donor
Joined
Nov 19, 2018
Messages
166
Likes
155
Location
PL
@mdsimon2 are you using 2x4 HD converted to DDRC-24?
I've checked mine DDRC-24 with DiracLive and although I can see linie input in windows mixer - I can't get any audio from it. Tried to capture sound with audacity with no luck. Any suggestions how to solve this?
 

mdsimon2

Major Contributor
Forum Donor
Joined
Oct 20, 2020
Messages
2,513
Likes
3,366
Location
Detroit, MI
@mdsimon2 are you using 2x4 HD converted to DDRC-24?
I've checked mine DDRC-24 with DiracLive and although I can see linie input in windows mixer - I can't get any audio from it. Tried to capture sound with audacity with no luck. Any suggestions how to solve this?

Yes, it has been converted to a DDRC-24. I am not very familiar with Windows but you need some way to use the DDRC-24 as a capture device and then route that to another playback device.

Prior to using CamillaDSP on the RPi I was able to use the DDRC-24 as an input device on Mac. For example with REW I could run a frequency sweep through the TOSLINK input and record the Dirac processed signal by specifying the DDRC-24 as the capture device.

What CamillaDSP allows is routing of the DDRC-24 capture signal to another output device. I've posted my simple CamillaDSP .yml configuration below, I imagine you should be to get CamillaDSP running on Windows and do the same thing.

Code:
---
devices:
  samplerate: 48000
  chunksize: 2048                                                                    
  enable_rate_adjust: true
  capture:
    type: Alsa
    channels: 4
    device: "hw:DDRC24"
    format: S32LE
  playback:
    type: Alsa
    channels: 4
    device: "hw:M4"
    format: S32LE

mixers:
  2to4chan:
    channels:
      in: 4
      out: 4
    mapping:
      - dest: 0
        sources:
          - channel: 0
            gain: 0
            inverted: false
      - dest: 1
        sources:
          - channel: 1
            gain: 0
            inverted: false
      - dest: 2
        sources:
          - channel: 0
            gain: 0
            inverted: false
      - dest: 3
        sources:
          - channel: 1
            gain: 0
            inverted: false
pipeline:
  - type: Mixer
    name: 2to4chan

Also posting results of cat /proc/asound/DDRC24/stream0 showing how the DDRC-24 presents itself as a capture and playback device in ALSA.

Code:
michael3@raspberrypi3:~$ cat /proc/asound/DDRC24/stream0
miniDSP DDRC-24 at usb-0000:01:00.0-1.4.4, high speed : USB Audio

Playback:
  Status: Stop
  Interface 1
    Altset 1
    Format: S32_LE
    Channels: 2
    Endpoint: 0x01 (1 OUT) (ASYNC)
    Rates: 44100, 48000, 88200, 96000, 176400, 192000
    Data packet interval: 125 us
    Bits: 24
    Channel map: FL FR
    Sync Endpoint: 0x81 (1 IN)
    Sync EP Interface: 1
    Sync EP Altset: 1
    Implicit Feedback Mode: No
  Interface 1
    Altset 2
    Format: S16_LE
    Channels: 2
    Endpoint: 0x01 (1 OUT) (ASYNC)
    Rates: 44100, 48000, 88200, 96000, 176400, 192000
    Data packet interval: 125 us
    Bits: 16
    Channel map: FL FR
    Sync Endpoint: 0x81 (1 IN)
    Sync EP Interface: 1
    Sync EP Altset: 2
    Implicit Feedback Mode: No

Capture:
  Status: Stop
  Interface 2
    Altset 1
    Format: S32_LE
    Channels: 4
    Endpoint: 0x82 (2 IN) (ASYNC)
    Rates: 44100, 48000, 88200, 96000, 176400, 192000
    Data packet interval: 125 us
    Bits: 24
    Channel map: FL FR FC LFE

Hope this helps.

Michael
 
Last edited:

kukocz

Active Member
Forum Donor
Joined
Nov 19, 2018
Messages
166
Likes
155
Location
PL
Thank you for configuration.
Good news are that eventually, I was able to redirect audio stream to the PC after drivers reinstallation.
Next step was to use camilladsp for windows to redirect stream to another DAC. No luck with that as windows version uses WASAPI what seems to be not supported by DDRC-24 (aiso only).

I'm also trying to get it working through camilladsp with moodeaudio but it didn't work through the built-in configuration panel.
FInally I was able to run it manually using command camilladsp config.yml

I had to play around a little bit and finally here is the working config:
Code:
devices:
  samplerate: 48000
  chunksize: 2048
  enable_rate_adjust: true
  capture:
    type: Alsa
    channels: 2
    device: "plughw:CARD=DDRC24"
    format: S32LE
  playback:
    type: Alsa
    channels: 2
    device: "plughw:CARD=LAQXD1"
    format: S32LE

mixers:
  minidsp2DAC:
    channels:
      in: 2
      out: 2
    mapping:
      - dest: 0
        sources:
          - channel: 0
            gain: 0
            inverted: false
      - dest: 1
        sources:
          - channel: 1
            gain: 0
            inverted: false
pipeline:
  - type: Mixer
    name: minidsp2DAC

Next step is to install camilladsp instance on fresh raspbian and test it.
 

mdsimon2

Major Contributor
Forum Donor
Joined
Oct 20, 2020
Messages
2,513
Likes
3,366
Location
Detroit, MI
Thank you for configuration.
Good news are that eventually, I was able to redirect audio stream to the PC after drivers reinstallation.
Next step was to use camilladsp for windows to redirect stream to another DAC. No luck with that as windows version uses WASAPI what seems to be not supported by DDRC-24 (aiso only).

I'm also trying to get it working through camilladsp with moodeaudio but it didn't work through the built-in configuration panel.
FInally I was able to run it manually using command camilladsp config.yml

I had to play around a little bit and finally here is the working config:
Code:
devices:
  samplerate: 48000
  chunksize: 2048
  enable_rate_adjust: true
  capture:
    type: Alsa
    channels: 2
    device: "plughw:CARD=DDRC24"
    format: S32LE
  playback:
    type: Alsa
    channels: 2
    device: "plughw:CARD=LAQXD1"
    format: S32LE

mixers:
  minidsp2DAC:
    channels:
      in: 2
      out: 2
    mapping:
      - dest: 0
        sources:
          - channel: 0
            gain: 0
            inverted: false
      - dest: 1
        sources:
          - channel: 1
            gain: 0
            inverted: false
pipeline:
  - type: Mixer
    name: minidsp2DAC

Next step is to install camilladsp instance on fresh raspbian and test it.

Nice! Glad you got it to work. You do not want to use "plughw" when defining your device as it will allow ALSA resampling which is very low quality, see posts 33 and 34 of thread below for more information.

https://www.audiosciencereview.com/...ce-motu-m4-phenomal-dsp-streamer.24493/page-2

Do you need to use "plughw" to get it to work with Moode? I would have assumed it would be fine with just "hw"as the DDRC will ASRC the TOSLINK/analog inputs to 48 kHz and I assume the LAQXD1 will have no issues running at 48 kHz.

Michael
 

kukocz

Active Member
Forum Donor
Joined
Nov 19, 2018
Messages
166
Likes
155
Location
PL
Nice! Glad you got it to work. You do not want to use "plughw" when defining your device as it will allow ALSA resampling which is very low quality, see posts 33 and 34 of thread below for more information.

https://www.audiosciencereview.com/...ce-motu-m4-phenomal-dsp-streamer.24493/page-2

Do you need to use "plughw" to get it to work with Moode? I would have assumed it would be fine with just "hw"as the DDRC will ASRC the TOSLINK/analog inputs to 48 kHz and I assume the LAQXD1 will have no issues running at 48 kHz.

Michael
plughw is the only way I can make it working. When I use hw: then I'm getting the following error:
Jul 22 15:20:11.576 ERRO Capture error: ALSA function 'snd_pcm_hw_params_set_channels' failed with error 'EINVAL: Invalid argument', module: camilladsp
Jul 22 15:17:14.836 ERRO Message channel error: receiving on a closed channel, module: camillalib::processing

Full listing:
Code:
Jul 22 15:20:11.566 DEBG Read config file Some("minidsp2DAC.yml"), module: camilladsp
Jul 22 15:20:11.568 DEBG Config is valid, module: camilladsp
Jul 22 15:20:11.568 DEBG Wait for config, module: camilladsp
Jul 22 15:20:11.569 DEBG Config ready, module: camilladsp
Jul 22 15:20:11.569 DEBG Using channels [true, true], module: camilladsp
Jul 22 15:20:11.570 DEBG Buffer frames 4096, module: camillalib::alsadevice
Jul 22 15:20:11.570 DEBG Build new pipeline, module: camillalib::filters
Jul 22 15:20:11.570 DEBG build filters, waiting to start processing loop, module: camillalib::processing
Jul 22 15:20:11.576 ERRO Capture error: ALSA function 'snd_pcm_hw_params_set_channels' failed with error 'EINVAL: Invalid argument', module: camilladsp
Jul 22 15:20:11.577 DEBG Error while starting, release barrier, module: camilladsp
Jul 22 15:20:11.627 DEBG Opening audio device "hw:CARD=LAQXD1" with parameters: HwParams { channels: Ok(2), rate: "Ok(48000) Hz", format: Ok(S32LE), access: Ok(RWInterleaved), period_size: "Ok(512) frames", buffer_size: "Ok(4096) frames" }, SwParams(avail_min: Ok(512) frames, start_threshold: Ok(1536) frames, stop_threshold: Ok(4096) frames), module: camillalib::alsadevice
Jul 22 15:20:11.629 DEBG Audio device "hw:CARD=LAQXD1" successfully opened, module: camillalib::alsadevice
Jul 22 15:20:11.630 DEBG Starting playback loop, module: camillalib::alsadevice
Jul 22 15:20:11.631 DEBG Wait for playback thread to exit.., module: camilladsp
Jul 22 15:20:11.632 ERRO Message channel error: receiving on a closed channel, module: camillalib::processing
Jul 22 15:20:11.678 DEBG Restarting with new config, module: camilladsp
Jul 22 15:20:11.680 DEBG Wait for config, module: camilladsp
Jul 22 15:20:11.681 DEBG No config and not in wait mode, exiting!, module: camilladsp

Any suggestions where should I start looking for?

And last but not least: I can't run camilldsp with Pi Zero W as it requires arm v7 cpu (Pi Zero is arm v6). Fortunately I had spare Pi3B+ and i't working fine :)


EDIT:

It looks like it is somehow a mismatch with parameters. I haven't figured it out yet.
Details of both interfaces:

Code:
$aplay -v -D hw:LAQXD1 /dev/zero --dump-hw-params
Playing raw data '/dev/zero' : Unsigned 8 bit, Rate 8000 Hz, Mono
HW Params of device "hw:LAQXD1":
--------------------
ACCESS:  MMAP_INTERLEAVED RW_INTERLEAVED
FORMAT:  S32_LE SPECIAL DSD_U32_BE
SUBFORMAT:  STD
SAMPLE_BITS: 32
FRAME_BITS: 64
CHANNELS: 2
RATE: [44100 768000]
PERIOD_TIME: [125 1486078)
PERIOD_SIZE: [8 65536]
PERIOD_BYTES: [64 524288]
PERIODS: [2 1024]
BUFFER_TIME: (20 2972155)
BUFFER_SIZE: [16 131072]
BUFFER_BYTES: [128 1048576]
TICK_TIME: ALL
--------------------
aplay: set_params:1339: Sample format non available
Available formats:
- S32_LE
- SPECIAL
- DSD_U32_BE


Code:
$arecord -D hw:DDRC24 /dev/null --dump-hw-params
Recording WAVE '/dev/null' : Unsigned 8 bit, Rate 8000 Hz, Mono
HW Params of device "hw:DDRC24":
--------------------
ACCESS:  MMAP_INTERLEAVED RW_INTERLEAVED
FORMAT:  S32_LE
SUBFORMAT:  STD
SAMPLE_BITS: 32
FRAME_BITS: 128
CHANNELS: 4
RATE: [44100 192000]
PERIOD_TIME: [125 743039)
PERIOD_SIZE: [6 32768]
PERIOD_BYTES: [96 524288]
PERIODS: [2 1024]
BUFFER_TIME: (62 1486078)
BUFFER_SIZE: [12 65536]
BUFFER_BYTES: [192 1048576]
TICK_TIME: ALL
--------------------
arecord: set_params:1339: Sample format non available
Available formats:
- S32_LE

Edit2:
I partially isolated the issue. Now I know it’s related to DDRC-24 config as I can set LAQXD1 in hw mode…
 
Last edited:

mdsimon2

Major Contributor
Forum Donor
Joined
Oct 20, 2020
Messages
2,513
Likes
3,366
Location
Detroit, MI
Hmm...I don't see anything obvious but maybe there are a few things to check. When I look at my CamillaDSP startup it shows my other DAC (MOTU M4) as opening first and then the DDRC-24 opening second. Not sure why there is a difference in order.

Code:
ul 22 16:31:42.948 DEBG Read config file Some("/home/michael3/ddrc.yml"), module: camilladsp
Jul 22 16:31:42.949 DEBG Config is valid, module: camilladsp
Jul 22 16:31:42.949 DEBG Wait for config, module: camilladsp
Jul 22 16:31:42.950 DEBG Config ready, module: camilladsp
Jul 22 16:31:42.950 DEBG Using channels [true, true, false, false], module: camilladsp
Jul 22 16:31:42.950 DEBG Buffer frames 4096, module: camillalib::alsadevice
Jul 22 16:31:42.951 DEBG Build new pipeline, module: camillalib::filters
Jul 22 16:31:42.951 DEBG build filters, waiting to start processing loop, module: camillalib::processing
Jul 22 16:31:42.956 DEBG Opening audio device "hw:M4" with parameters: HwParams { channels: Ok(4), rate: "Ok(48000) Hz", format: Ok(S32LE), access: Ok(RWInterleaved), period_size: "Ok(512) frames", buffer_size: "Ok(4096) frames" }, SwParams(avail_min: Ok(512) frames, start_threshold: Ok(1536) frames, stop_threshold: Ok(4096) frames), module: camillalib::alsadevice
Jul 22 16:31:42.956 DEBG Audio device "hw:M4" successfully opened, module: camillalib::alsadevice
Jul 22 16:31:42.957 DEBG Playback thread ready to start, module: camilladsp
Jul 22 16:31:42.976 DEBG Opening audio device "hw:DDRC24" with parameters: HwParams { channels: Ok(4), rate: "Ok(48000) Hz", format: Ok(S32LE), access: Ok(RWInterleaved), period_size: "Ok(1024) frames", buffer_size: "Ok(8192) frames" }, SwParams(avail_min: Ok(1024) frames, start_threshold: Ok(0) frames, stop_threshold: Ok(8192) frames), module: camillalib::alsadevice
Jul 22 16:31:42.976 DEBG Audio device "hw:DDRC24" successfully opened, module: camillalib::alsadevice
Jul 22 16:31:42.977 DEBG Capture thread ready to start, module: camilladsp
Jul 22 16:31:42.977 DEBG Both capture and playback ready, release barrier, module: camilladsp
Jul 22 16:31:42.978 DEBG Starting playback loop, module: camillalib::alsadevice
Jul 22 16:31:42.979 DEBG Starting captureloop, module: camillalib::alsadevice
Jul 22 16:31:42.979 DEBG Starting capture, module: camillalib::alsadevice
Jul 22 16:31:43.022 INFO Starting playback from Prepared state, module: camillalib::alsadevice

I have experienced issues if I did not specify the full amount of channels available to a device in both devices and the mixer, you might try setting this to 4 for the DDRC-24 (you do not need to map all the channels in the mixer so you can leave the rest of the config as is).

Michael
 

kukocz

Active Member
Forum Donor
Joined
Nov 19, 2018
Messages
166
Likes
155
Location
PL
I have experienced issues if I did not specify the full amount of channels available to a device in both devices and the mixer, you might try setting this to 4 for the DDRC-24 (you do not need to map all the channels in the mixer so you can leave the rest of the config as is).

Michael
Changing settings for 4 channels only in capture section doesn't work:

Jul 22 19:37:21.162 ERRO Mixer 'minidsp2DAC' has wrong number of input channels. Expected 4, found 2., module: camilladsp

Then I figured out that declaration of 4 channels is also needed in mixer (but without mapping):

Code:
devices:
  samplerate: 48000
  chunksize: 8192
  enable_rate_adjust: true
  queuelimit: 4
  capture:
    type: Alsa
    channels: 4
    device: "hw:CARD=DDRC24"
    format: S32LE
  playback:
    type: Alsa
    channels: 2
    device: "hw:CARD=LAQXD1"
    format: S32LE
mixers:
  minidsp2DAC:
    channels:
      in: 4
      out: 2
    mapping:
      - dest: 0
        sources:
          - channel: 0
            gain: 0
            inverted: false
      - dest: 1
        sources:
          - channel: 1
            gain: 0
            inverted: false
pipeline:
  - type: Mixer
    name: minidsp2DAC
Conclusion is that you need always read 4 channels from DDRC-24 in hw mode (but why I can read only 2 channels in plughw mode? :rolleyes:)

Everything is working now but I experiencing another issue - audio glitches in random period of time. Chunksize doesn't matter so I need to think what else can be tuned :)
 

mdsimon2

Major Contributor
Forum Donor
Joined
Oct 20, 2020
Messages
2,513
Likes
3,366
Location
Detroit, MI
Changing settings for 4 channels only in capture section doesn't work:

Jul 22 19:37:21.162 ERRO Mixer 'minidsp2DAC' has wrong number of input channels. Expected 4, found 2., module: camilladsp

Then I figured out that declaration of 4 channels is also needed in mixer (but without mapping):

Code:
devices:
  samplerate: 48000
  chunksize: 8192
  enable_rate_adjust: true
  queuelimit: 4
  capture:
    type: Alsa
    channels: 4
    device: "hw:CARD=DDRC24"
    format: S32LE
  playback:
    type: Alsa
    channels: 2
    device: "hw:CARD=LAQXD1"
    format: S32LE
mixers:
  minidsp2DAC:
    channels:
      in: 4
      out: 2
    mapping:
      - dest: 0
        sources:
          - channel: 0
            gain: 0
            inverted: false
      - dest: 1
        sources:
          - channel: 1
            gain: 0
            inverted: false
pipeline:
  - type: Mixer
    name: minidsp2DAC
Conclusion is that you need always read 4 channels from DDRC-24 in hw mode (but why I can read only 2 channels in plughw mode? :rolleyes:)

Everything is working now but I experiencing another issue - audio glitches in random period of time. Chunksize doesn't matter so I need to think what else can be tuned :)

I do not have a satisfactory explanation for it but when I first tried using Raspberry Pi OS (Raspian) I also had random audio glitches. When I switched to Ubuntu Server 21.04 I no longer had any issues.

Michael
 

kukocz

Active Member
Forum Donor
Joined
Nov 19, 2018
Messages
166
Likes
155
Location
PL
I do not have a satisfactory explanation for it but when I first tried using Raspberry Pi OS (Raspian) I also had random audio glitches. When I switched to Ubuntu Server 21.04 I no longer had any issues.

Michael
It's a way to go...
For now I've updated RPi firmware (rpi-update) and surprisingly it's working much better. Will see for how long :)

Anyway, OLED display + volume control + DiracLive correction re-routed through USB to another DAC = DDRC Studio (like SHD Studio) :).

Now, we need to figure out how to simplify DL calibration process in this configuration...
 

mdsimon2

Major Contributor
Forum Donor
Joined
Oct 20, 2020
Messages
2,513
Likes
3,366
Location
Detroit, MI
@kukocz I finally got around to setting up minidsp-rs, works great so far. I also just hooked up a simple 4x20 LCD to the Pi.

Do you happen to already have a program to route the current volume setting to an external display? I am not much a programmer (dumb mechanical engineer) so was hoping you had something as starting point, other wise it may take me a while :).

Michael
 

mdsimon2

Major Contributor
Forum Donor
Joined
Oct 20, 2020
Messages
2,513
Likes
3,366
Location
Detroit, MI
@kukocz I finally got around to setting up minidsp-rs, works great so far. I also just hooked up a simple 4x20 LCD to the Pi.

Do you happen to already have a program to route the current volume setting to an external display? I am not much a programmer (dumb mechanical engineer) so was hoping you had something as starting point, other wise it may take me a while :).

Michael

Ended up finding some good code to start with. From playing around with an Arduino I had 4x20 LCD wired up as shown in the link below.

https://www.arduino.cc/en/Tutorial/LibraryExamples/HelloWorld

I then used the guide linked below to identify the necessary pins on the RPi (note I left the configuration as is from the arduino example) and used example code as a baseline.

https://www.raspberrypi-spy.co.uk/2012/08/20x4-lcd-module-control-using-python/

The final code looked like this:

Code:
#!/usr/bin/python
#--------------------------------------
#    ___  ___  _ ____
#   / _ \/ _ \(_) __/__  __ __
#  / , _/ ___/ /\ \/ _ \/ // /
# /_/|_/_/  /_/___/ .__/\_, /
#                /_/   /___/
#
#  lcd_16x2.py
#  20x4 LCD Test Script with
#  backlight control and text justification
#
# Author : Matt Hawkins
# Date   : 06/04/2015
#
# https://www.raspberrypi-spy.co.uk/
#
#--------------------------------------

# The wiring for the LCD is as follows:
# 1 : GND
# 2 : 5V
# 3 : Contrast (0-5V)*
# 4 : RS (Register Select)
# 5 : R/W (Read Write)       - GROUND THIS PIN
# 6 : Enable or Strobe
# 7 : Data Bit 0             - NOT USED
# 8 : Data Bit 1             - NOT USED
# 9 : Data Bit 2             - NOT USED
# 10: Data Bit 3             - NOT USED
# 11: Data Bit 4
# 12: Data Bit 5
# 13: Data Bit 6
# 14: Data Bit 7
# 15: LCD Backlight +5V**
# 16: LCD Backlight GND

#import
import RPi.GPIO as GPIO
import time
import subprocess

# Define GPIO to LCD mapping
LCD_RS = 7
LCD_E  = 8
LCD_D4 = 25
LCD_D5 = 24
LCD_D6 = 23
LCD_D7 = 18
LED_ON = 15

# Define some device constants
LCD_WIDTH = 20    # Maximum characters per line
LCD_CHR = True
LCD_CMD = False

LCD_LINE_1 = 0x80 # LCD RAM address for the 1st line
LCD_LINE_2 = 0xC0 # LCD RAM address for the 2nd line
LCD_LINE_3 = 0x94 # LCD RAM address for the 3rd line
LCD_LINE_4 = 0xD4 # LCD RAM address for the 4th line

# Timing constants
E_PULSE = 0.0005
E_DELAY = 0.0005

def main():
  # Main program block

  GPIO.setmode(GPIO.BCM)       # Use BCM GPIO numbers
  GPIO.setup(LCD_E, GPIO.OUT)  # E
  GPIO.setup(LCD_RS, GPIO.OUT) # RS
  GPIO.setup(LCD_D4, GPIO.OUT) # DB4
  GPIO.setup(LCD_D5, GPIO.OUT) # DB5
  GPIO.setup(LCD_D6, GPIO.OUT) # DB6
  GPIO.setup(LCD_D7, GPIO.OUT) # DB7
  GPIO.setup(LED_ON, GPIO.OUT) # Backlight enable


  # Initialise display
  lcd_init()

  # Toggle backlight on-off-on
  lcd_backlight(True)
  time.sleep(0.5)
  lcd_backlight(False)
  time.sleep(0.5)
  lcd_backlight(True)
  time.sleep(0.5)

  while True:
     
    output = subprocess.check_output('minidsp', shell=True);

    output_str=str(output,'utf-8')
     
    volume=output_str.split('volume: Gain(')
    volume2=volume[1].split(')')
   
    source=output_str.split('source: ')
    source2=source[1].split(',')
   
    config=output_str.split('preset: ')
    config2=config[1].split(',')
   
    dirac=output_str.split('dirac: ')
    dirac2=dirac[1].split(' }')
   
    mute=output_str.split('mute: ')
    mute2=mute[1].split(',')
   
    config2adj = int(config2[0])+1
    config2[0]=str(config2adj)
   
    if dirac2[0]=="false":
        dirac2[0]="Off"
    else:
        dirac2[0]="On"
       
    if mute2[0]=="false":
        mute2[0]="Off"
    else:
        mute2[0]="On"
   
    lcd_string("Volume: " + volume2[0] + " dB",LCD_LINE_1,1)
    lcd_string("Source: " + source2[0] ,LCD_LINE_2,1)
    lcd_string("Config: " + config2[0],LCD_LINE_3,1)
    lcd_string("Dirac: " + dirac2[0] +" Mute: " + str(mute2[0]),LCD_LINE_4,1)

def lcd_init():
  # Initialise display
  lcd_byte(0x33,LCD_CMD) # 110011 Initialise
  lcd_byte(0x32,LCD_CMD) # 110010 Initialise
  lcd_byte(0x06,LCD_CMD) # 000110 Cursor move direction
  lcd_byte(0x0C,LCD_CMD) # 001100 Display On,Cursor Off, Blink Off
  lcd_byte(0x28,LCD_CMD) # 101000 Data length, number of lines, font size
  lcd_byte(0x01,LCD_CMD) # 000001 Clear display
  time.sleep(E_DELAY)

def lcd_byte(bits, mode):
  # Send byte to data pins
  # bits = data
  # mode = True  for character
  #        False for command

  GPIO.output(LCD_RS, mode) # RS

  # High bits
  GPIO.output(LCD_D4, False)
  GPIO.output(LCD_D5, False)
  GPIO.output(LCD_D6, False)
  GPIO.output(LCD_D7, False)
  if bits&0x10==0x10:
    GPIO.output(LCD_D4, True)
  if bits&0x20==0x20:
    GPIO.output(LCD_D5, True)
  if bits&0x40==0x40:
    GPIO.output(LCD_D6, True)
  if bits&0x80==0x80:
    GPIO.output(LCD_D7, True)

  # Toggle 'Enable' pin
  lcd_toggle_enable()

  # Low bits
  GPIO.output(LCD_D4, False)
  GPIO.output(LCD_D5, False)
  GPIO.output(LCD_D6, False)
  GPIO.output(LCD_D7, False)
  if bits&0x01==0x01:
    GPIO.output(LCD_D4, True)
  if bits&0x02==0x02:
    GPIO.output(LCD_D5, True)
  if bits&0x04==0x04:
    GPIO.output(LCD_D6, True)
  if bits&0x08==0x08:
    GPIO.output(LCD_D7, True)

  # Toggle 'Enable' pin
  lcd_toggle_enable()

def lcd_toggle_enable():
  # Toggle enable
  time.sleep(E_DELAY)
  GPIO.output(LCD_E, True)
  time.sleep(E_PULSE)
  GPIO.output(LCD_E, False)
  time.sleep(E_DELAY)

def lcd_string(message,line,style):
  # Send string to display
  # style=1 Left justified
  # style=2 Centred
  # style=3 Right justified

  if style==1:
    message = message.ljust(LCD_WIDTH," ")
  elif style==2:
    message = message.center(LCD_WIDTH," ")
  elif style==3:
    message = message.rjust(LCD_WIDTH," ")

  lcd_byte(line, LCD_CMD)

  for i in range(LCD_WIDTH):
    lcd_byte(ord(message[i]),LCD_CHR)

def lcd_backlight(flag):
  # Toggle backlight on-off-on
  GPIO.output(LED_ON, flag)

if __name__ == '__main__':

  try:
    main()
  except KeyboardInterrupt:
    pass
  finally:
    lcd_byte(0x01, LCD_CMD)
    lcd_string("miniDSP",LCD_LINE_1,2)
    GPIO.cleanup()

And end result looks like this:

IMG_7212.jpeg


I am sure there are better ways to do this and I definitely want to make start / stop behavior more graceful but this was more of a proof of concept than anything else. I also have an OLED display that I have never used but should be more suited to a "fancier" display. Either way minidsp-rs is pretty awesome and makes integrating a display pretty darn simple.

Michael
 
OP
phoenixdogfan

phoenixdogfan

Major Contributor
Forum Donor
Joined
Nov 6, 2018
Messages
3,335
Likes
5,233
Location
Nashville
I have indeed figured out how to make my fourth generation i7 HP Envy work quietly.

It's explained here

https://www.google.com/search?q=how...rome&ie=UTF-8#kpvalbx=_0VsZYZbgEJS4tQbOqqwg13

Secondly I purchased a cooling pad from Amazon

https://www.amazon.com/AICHESON-Cooling-Notebook-MacBook-Computer/dp/B07CGMHP24/ref=sr_1_1_sspa?crid=3EXDCEUV4IUD7&dchild=1&keywords=pc+cooling+pad+laptop&qid=1629052134&sprefix=pc+cooling+,aps,333&sr=8-1-spons&psc=1&spLa=ZW5jcnlwdGVkUXVhbGlmaWVyPUEyOTdPTVFEREE0NkMwJmVuY3J5cHRlZElkPUEwNjU1MjUzUU5IWkk3VDMwTloxJmVuY3J5cHRlZEFkSWQ9QTA0ODAzODI1OEI3VUNaNUNZNkkmd2lkZ2V0TmFtZT1zcF9hdGYmYWN0aW9uPWNsaWNrUmVkaXJlY3QmZG9Ob3RMb2dDbGljaz10cnVl


Finally, I closed the door on my equipment cabinet.

After doing all that, the ambient noise level in my room is around 29 db, which is quiet enough as far as I'm concerned, and lap top cores temps stay around 55-65C.

I now have a variety of software options to implement eq, crossovers. There's J River (I own MC 28), Dephonica (which is a completely free electronic crossover with its own Asio sink driver), and Ekio (which requires Asio4all, and the virtual Asio cable) for $150.

I am currently experimenting with J River+ Dephonica. If that doesn't meet my needs, I will break down and buy Ekiio.

So, as far as I'm concerned, no reason to go back to miniDSP or spring for a NUC and the Akasa fanless case.

Total cost of the project so far has been $29. I already had the laptop and J River.
 
Top Bottom