I wanted to edit my previous post, but the system says its tooooo long?

Anyways, i split it into 2 new posts:

Hi everybody,

i am just playing a bit with piCorePlayer to prepare a multiroom
environment.

Right now i am using a LogiLink USB Sound Box 7.1 (LOGILINK UA0099).

The matching asound.conf i found somewhere here in the forum or
somewhere else on the internet, can't really remember...
Whoever created it, thanks for the hard work!

I did some minimal changes to get the input streamer work and handle the
order of sounddevices getting mixed with alsa
sometimes (in the original config the card was identified by id not the
name: card 1 for example). This was leading to
onboard sound devices changing the ids of the cards from time to time
after reboots (Big thanks to Paul for the hint).


Code:
--------------------
    /etc/asound.conf:
  
  #########################################################################
  ##   Channel splitting your UA0099 USB sound card to get up to four
  ##   independent stereo outputs (...and more )
  #########################################################################
  ##        stereofront       = the FRONT labeled green jack
  ##        stereosurround    = the SURROUND labeled black jack
  ##        stereocenter      = the CENTER / BASS labeled yellow jack
  ##        stereoback        = the BACK labeled black jack
  ##        stereoall         = all stereo outputs
  ##
  ##        for up to eight mono output channels use:
  ##
  ##        monofrontl        = the FRONT labeled green jack - tip
  ##        monofrontr        = the FRONT labeled green jack - ring
  ##        monosurroundl     = the SUROUND labeled black jack - tip
  ##        monosurroundr     = the SUROUND labeled black jack - ring
  ##        monocenterl       = the CENTER / BASS labeled yellow jack - tip
  ##        monocenterr       = the CENTER / BASS labeled yellow jack - ring
  ##        monobackl         = the BACK labeled black jack - tip
  ##        monobackr         = the BACK labeled black jack - ring
  ##
  ##        you can also use the line input as streamer input:
  ##
  ##        pcpinput          =  the LINE-IN labeled blue jack
  #########################################################################
  
  #########################################################################
  ## labels and colors could be different for differnt vendors or
  ## versions of the device (Logilink, Sewell, Sweex, ...)
  #########################################################################
  
  pcm.logilink {            # alias for our sound card
  type hw               # must be hw in our case
  card ICUSBAUDIO7D     # check your correct card number by typing
  device 0              # 'aplay -l' in your terminal
  }                         # for esxampe the 1st usb card on the Raspi shows as
  # card 2: ICUSBAUDIO7D [ICUSBAUDIO7D], device 0: USB Audio [USB Audio]
  # because the card order is not fixed its better to use
  # the names of the devices instead of the numbers
  
  ctl.logilink {
  type hw
  card ICUSBAUDIO7D
  device 0
  }
  
  pcm.dmixer {
  type dmix
  ipc_key 1024             # must be unique number on your system
  ipc_perm 0666            # neccesary for normal user to have access
  slave.pcm "logilink"
  slave {
  period_time 0
  period_size 1024
  buffer_size 4096
  rate 44100
  channels 8
  }
  bindings {
  0 0
  1 1
  2 2
  3 3
  4 4
  5 5
  6 6
  7 7
  }
  
  }
  
  pcm.!default {
  type plug
  slave.pcm "dmixer"
  }
  
  pcm.stereofront {
  type plug
  slave {
  pcm "dmixer"
  channels 8
  }
  ttable.0.0 1
  ttable.1.1 1
  }
  
  pcm.stereocenter {
  type plug
  slave {
  pcm "dmixer"
  channels 8
  }
  ttable.0.2 1
  ttable.1.3 1
  }
  
  pcm.stereoback {
  type plug
  slave {
  pcm "dmixer"
  channels 8
  }
  ttable.0.4 1
  ttable.1.5 1
  }
  
  pcm.stereosurround {
  type plug
  slave {
  pcm "dmixer"
  channels 8
  }
  ttable.0.6 1
  ttable.1.7 1
  }
  
  pcm.stereoall {
  type plug
  slave {
  pcm "dmixer"
  channels 8
  }
  ttable.0.0 1    # input left and right to all 4 l+r outputs
  ttable.1.1 1
  ttable.0.2 1
  ttable.1.3 1
  ttable.0.4 1
  ttable.1.5 1
  ttable.0.6 1
  ttable.1.7 1
  }
  pcm.monofrontl {
  type route
  slave {
  pcm "dmixer"
  channels 8
  }
  ttable.0.0 1 # in-channel 0, out-channel 0, 100% volume
  ttable.1.0 1 # in-channel 1, out-channel 0, 100% volume
  }
  
  pcm.monofrontr {
  type route
  slave {
  pcm "dmixer"
  channels 8
  }
  ttable.0.1 1
  ttable.1.1 1
  }
  
  pcm.monocenterl {
  type route
  slave {
  pcm "dmixer"
  channels 8
  }
  ttable.0.2 1
  ttable.1.2 1
  }
  
  pcm.monocenterr {
  type route
  slave {
  pcm "dmixer"
  channels 8
  }
  ttable.0.3 1
  ttable.1.3 1
  }
  
  pcm.monobackl {
  type route
  slave {
  pcm "dmixer"
  channels 8
  }
  ttable.0.4 1
  ttable.1.4 1
  }
  
  pcm.monobackr {
  type route
  slave {
  pcm "dmixer"
  channels 8
  }
  ttable.0.5 1
  ttable.1.5 1
  }
  
  pcm.monosurroundl {
  type route
  slave {
  pcm "dmixer"
  channels 8
  }
  ttable.0.6 1
  ttable.1.6 1
  }
  
  pcm.monosurroundr {
  type route
  slave {
  pcm "dmixer"
  channels 8
  }
  ttable.0.7 1
  ttable.1.7 1
  }
  
  pcm.pcpinput {
  type plug
  slave.pcm "hw:CARD=ICUSBAUDIO7D,DEV=0"
  }
--------------------


I changed the sound settings and stored them:


Code:
--------------------
    sudo alsamixer
  
  with F6 choose the ICUSBAUDIO7D card and configure the levels
  change PCM Capture Source to Line (to get the input streamer working)
  
  sudo alsactl store
--------------------


Restore the sound settings after reboot and start the squeezelite
instances.


Code:
--------------------
    
  /opt/bootlocal.sh:
  
  sudo alsactl restore
  
  sudo /usr/local/bin/squeezelite -n "XX (front)" -o stereofront -a 80:::0: -m 
b8:27:eb:c1:09:21 -C 5 -z
  sudo /usr/local/bin/squeezelite -n "XX (surround)" -o stereosurround -a 
80:::0: -m b8:27:eb:c1:11:23 -C 5 -z
  sudo /usr/local/bin/squeezelite -n "XX (center)" -o stereocenter -a 80:::0: 
-m b8:27:eb:c1:13:25 -C 5 -z
  sudo /usr/local/bin/squeezelite -n "XX (back)" -o stereoback -a 80:::0: -m 
b8:27:eb:c1:15:27 -C 5 -z
  sudo /usr/local/bin/squeezelite -n "XX (all)" -o stereoall -a 80:::0: -m 
b8:27:eb:c1:17:29 -C 5 -z
--------------------


Prevent Squeezelite Autostart and activate Streamer Audio Input:


Code:
--------------------
    Tweaks -> Audio Tweaks -> Streamer for Audio Input - set to Yes
  Tweaks -> Audio Tweaks -> Squeezelite - Automatically start Squeezelite when 
pCP starts - set to No
--------------------


Manually set the streamer input (not possible via gui right now).


Code:
--------------------
    /usr/local/etc/pcp/pcp.cfg:
  
  STREAMER="yes"
  STREAMER_IN_DEVICE="pcpinput"
--------------------


To stream the input of the card add on the LMS some favorites:


Code:
--------------------
    http://ipofpicoreplayer:9100/S32_LE/44100/2/M (MP3 Format)
  http://ipofpicoreplayer:9100/S32_LE/44100/2/F (FLAC Format)
--------------------


Beware: sound qualitiy of the input is bad for me (maybe better use a
hifiberry
or something similiar for that purpose, though the quality of the other
outputs of
the card were good).

Every change that required a reboot was saved.


Code:
--------------------
    sudo filetool.sh -b
--------------------


This is what is working so far...

I want to expand the setup with a second similar card (don't have it
right now).
But then i am running again in the ordering problem, since i cannot
identify the
card by name any longer in that case.

I read a bit on the internet about alsa and you can set the order and
also handle
the multiple cards problem with settings in /etc/modprobe.d/alsa.conf
(or alsa-base-conf).

So i tried that by setting the device order manually:


Code:
--------------------
    /etc/modprobe.d/alsa.conf:
  
  options snd slots=snd_usb_audio,snd_bcm2835,snd_bcm2835
  
  #options snd_usb_audio index=0
  #options snd_bcm2835 index=1,2
--------------------


Added the file to the filetool and saved:


Code:
--------------------
    /opt/.filetool.lst:
  
  etc/modprobe.d/alsa.conf
  
--------------------


But neither the old index method nor the newer slots method worked.
Does the loading of the modules happen before the filetool backup
is written back?

With this method you can normally also address the problem with
multiple cards of the same type for example (vid and pid you get via
lsusb):


Code:
--------------------
    options snd-usb-audio index=1,2 vid=0x0ccd,0x0d8c pid=0x0028,0x000c
--------------------


UPDATE (Thanks to Paul again, i was able to solve the alsa issue):

To get a fix order of the Sound Devices i created an extension, which is
loaded before the
modules were loaded:


Code:
--------------------
    
  sudo su
  cd /tmp
  mkdir alsa-conf-order
  cd alsa-conf-order
  mkdir -p etc/modprobe.d
  cd /tmp/etc/modprobe.d
  vi alsa.conf
  
  alsa.conf:
  
  options snd slots=snd_usb_audio,snd_bcm2835,snd_bcm2835
  
  save the content (:wq)
  cd /tmp
  mksquashfs alsa-conf-order alsa-conf-order.tcz
  mv -v alsa-conf-order.tcz /etc/sysconfig/tcedir/optional
  cd /etc/sysconfig/tcedir
  echo alsa-conf-order.tcz >> onboot.lst
  pcp bu
  reboot
--------------------


------------------------------------------------------------------------
urknall's Profile: http://forums.slimdevices.com/member.php?userid=67774
View this thread: http://forums.slimdevices.com/showthread.php?t=114828

_______________________________________________
unix mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/unix

Reply via email to