Welcome, Guest
Username: Password: Remember me

NOTE: This is a "Community" forum. Please be mindful that community members are here to help as part of a community effort. We therefore appreciate your effort in keeping this forum a happy place!

If you have a specific issue (e.g. hardware, failure) and want help from our support team, please use our tech support portal (Support menu - > Contact Us).
Thanks a lot of your help in making a better community.
  • Page:
  • 1
  • 2

TOPIC: USBstreamer B + miniDSP 4x10 HD + Linux.

USBstreamer B + miniDSP 4x10 HD + Linux. 4 years 4 months ago #26362

  • rybu
  • rybu's Avatar
  • Offline
  • Senior Boarder
  • Posts: 45
  • Thank you received: 17
  • Karma: 2
Thanks, it appears I've found a way to avoid using your special firmware.

The channel mappings in Linux are easier to manipulate than I feared. The file /var/lib/alsa/asound.state has a large section dedicated to the usbstreamer:
state.USBStreamer {
control.1 {
    iface PCM
    name 'Playback Channel Map'
    value.0 0
    value.1 0
    value.2 0
    value.3 0
    value.4 0
    value.5 0
    value.6 0
    value.7 0
    value.8 0
    value.9 0
    comment {
        access read
        type INTEGER
        count 10
        range '0 - 36'
    }
}
control.2 {
    iface PCM
    name 'Capture Channel Map'
    value.0 0
    value.1 0
    value.2 0
    value.3 0
    value.4 0
    value.5 0
    value.6 0
    value.7 0
    value.8 0
    value.9 0
    comment {
        access read
        type INTEGER
        count 10
        range '0 - 36'
    }
}

(the above is only the beginning).

in the control.1 section (the audio output section) all you have to do is replace
    value.8 0
    value.9 0

with
  value.8 3
  value.9 4

If you google around you eventually find the ALSA source-code that has the enum specifying the channel layout in alsa. 3 and 4 are the left and right front speakers, respectively.

Once you re-load ALSA, you can play directly from MPlayer to ALSA with a command such as:
mplayer -ao alsa:device=hw=1.0 -format s32le blah.mp3

If you don't include the -format option, likely mplayer will choke as the input file is almost certainly not a 32-bit little-endian audio file.

For example, this *does* work perfectly.
speaker-test -c 10 -t sin -F S32_LE -D front:USBStreamer

But this is where I am currently stuck. In the above, mplayer does some kind of "rough cast" of the audio to 32-bit LE, and plays it. The sound appears a little shuffled, and there's frequency shifts and it's playing too fast.

I think if I understood the 4x10hd's unit's input format (it's 24-bit LE isn't it?) I should be able to write something to cast the data into 32-bit LE appropriately so that it plays the way it should. Isn't this supposed to be called S32_3LE? I've found some Linux sites that give it this name.

Anyhow, baby steps!

Here is the output of the alsa-cababilities script, the portion relevant to the usbstreamer:
 1) USB Audio Class Digital alsa audio output interface `hw:1,0'
 - device name       = USBStreamer                                                 
 - interface name    = USB Audio                                                   
 - usb audio class   = 2 - isochronous asynchronous                                
 - character device  = /dev/snd/pcmC1D0p                                           
 - encoding formats  = S32_LE                                                      
 - monitor file      = /proc/asound/card1/pcm0p/sub0/hw_params                     
 - stream file       = /proc/asound/card1/stream0          

Interestingly, the *deadbeef* software has no trouble playing to the usbstreamer. I give it hw:usbstreamer as the device name, and it seems to know what to do.
Last Edit: 4 years 4 months ago by rybu.
The administrator has disabled public write access.

USBstreamer B + miniDSP 4x10 HD + Linux. 4 years 4 months ago #26386

  • devteam
  • devteam's Avatar
  • Offline
  • Administrator
  • Posts: 8767
  • Thank you received: 1156
  • Karma: 165
@ rybu

Unfortunately our team litteraly knows nothing on Linux + Jack so that's why it's not under our listed support.. :-(
With this said, there are a lot of example of customers (do a search for Linux) having no issues under USBStreamer + Linux knowing it's ALSA complaint being a UAC2.0 so not 100% sure of these shuffled sound/frequency shift issues you're having here... Sounds almost like you're not playing at the correct frequency.. Maybe check the good thread here? www.minidsp.com/forum/usbstreamer/10128-...nnel-recording-linux
miniDSP, building a DSP community one board at a time.
The administrator has disabled public write access.

USBstreamer B + miniDSP 4x10 HD + Linux. 4 years 4 months ago #26395

  • rybu
  • rybu's Avatar
  • Offline
  • Senior Boarder
  • Posts: 45
  • Thank you received: 17
  • Karma: 2
Could you give me some information on my question that has nothing to do with Linux?

The operating system thinks the usbstreamer takes a 32-bit little-endian signal. But your product description says it takes a 24-bit signal.

I think this is broadly consistent with a convention I've seen for ?most? 24-bit audio systems. They tend to pad the 24-bit signal to a 32-bit signal, using zeros. Are the zeros on the left or right, if this is the case?
The administrator has disabled public write access.

USBstreamer B + miniDSP 4x10 HD + Linux. 4 years 4 months ago #26397

  • john.reekie
  • john.reekie's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 3775
  • Thank you received: 1587
  • Karma: 140
I'm pretty sure it shows up in Mac OS X as 24 bit - will check when I get home.
I am not miniDSP support.

"You must ask the right questions." - Dr. Alfred Lanning's hologram.
-> Have you read the User Manual??
-> Have you drawn and posted a diagram?
-> Have you posted a screenshot?
-> Have you posted your config file?
The administrator has disabled public write access.
The following user(s) said Thank You: rybu

USBstreamer B + miniDSP 4x10 HD + Linux. 4 years 4 months ago #26409

  • rybu
  • rybu's Avatar
  • Offline
  • Senior Boarder
  • Posts: 45
  • Thank you received: 17
  • Karma: 2
Okay, I got ALSA to work seamlessly with the usbstreamer + miniDSP 4x10HD.
pcm.usbSTR {
  type hw
  card USBStreamer
  device 0
}
pcm.usbREMAP {
  type plug
  slave.pcm usbSTR
  ttable.0.8 1
  ttable.1.9 1
}
pcm.!default {
  type plug
  slave.pcm usbREMAP
}
ctl.!default {
  type plug
  slave.pcm usbREMAP
}

The above is my /etc/asound.conf file. I'm using LUbuntu for my sound server. /etc/asound.conf did not exist, so I had to create it.

But with the above settings, mpd, mplayer, and pretty much everything works seamlessly with the usbstreamer. This asound.conf file makes the usbstreamer the default ALSA output. LUbuntu does not have Pulse, so it's one less thing to worry about.

At present I'm trying to get mpd to work with an Android client and I'm having some intermittent problems with that. But that should be easily resolved. I think my problem is basically solved.

Thanks for all the comments everyone. The two issues that took me the most time is realizing I had to create /etc/asound.conf, and determining the syntax to create the channel re-mapping appropriate for /etc/asound.conf.
The administrator has disabled public write access.

USBstreamer B + miniDSP 4x10 HD + Linux. 4 years 4 months ago #26426

  • devteam
  • devteam's Avatar
  • Offline
  • Administrator
  • Posts: 8767
  • Thank you received: 1156
  • Karma: 165
Great news and thanks a ton for sharing your Alsa config with the community. Hopefully it will help others. :-)
miniDSP, building a DSP community one board at a time.
The administrator has disabled public write access.

USBstreamer B + miniDSP 4x10 HD + Linux. 2 years 9 months ago #35412

  • rybu
  • rybu's Avatar
  • Offline
  • Senior Boarder
  • Posts: 45
  • Thank you received: 17
  • Karma: 2
After a recent system update my ALSA+MPD setup for the miniDSP+USBStreamer failed. It took some work but I've got it working again. I discovered the settings I described earlier in this thread were sub-optimal. The upgrade to a more modern ALSA made those settings functionally obsolete. Here are my current working settings:

/etc/asound.conf
pcm.!default {
  type plug
  slave.pcm {
    type hw
    card USBStreamer
    device 0
    }
  ttable {
   0.8 1
   1.9 1
  }
}

MPD /etc/mpd.conf
audio_output {
        type            "alsa"
        name            "USB Streamer - LX521.4"
}

At present this does not give MPD volume control. I will start a thread on that soon, hopefully we can sort out the device that gives ALSA (and MPD) control over the miniDSP volume knob.

I suppose I should add the above settings make the miniDSP the default ALSA device. That's why the mpd.conf audio_output section is so simple. If you wanted to make the miniDSP a non-default device you would have to specify the device in audio_output with more detail.
Last Edit: 2 years 9 months ago by rybu.
The administrator has disabled public write access.
The following user(s) said Thank You: devteam, neatlyfolded
  • Page:
  • 1
  • 2
Moderators: devteam