Closed AZ-Cam-Op closed 7 years ago
whats the output of aplay -L ?
is there a device that alsa sees as the 5.1 upmix?
pi@raspberrypi:~ $ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA]
Subdevices: 8/8
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3
Subdevice #4: subdevice #4
Subdevice #5: subdevice #5
Subdevice #6: subdevice #6
Subdevice #7: subdevice #7
card 0: ALSA [bcm2835 ALSA], device 1: bcm2835 ALSA [bcm2835 IEC958/HDMI]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 2: Device_1 [USB Sound Device], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 2 is the 5.1/7.1 usb sound card that I have plugged in. I can only hear music from my iphone using shairport and alexa responses on the stereo channels. If I plug the speakers into any of the other ports (rear, center/bass, sides), I don't get anything at all. However as already stated if I play an mp3 with promoe or vlc I can change my speakers to the different outputs and still hear a left and a right channel. I can also open up chromium and stream something and do the same thing. I can also say that the only audio I now get comes from the usb sound card as it is set as my default card. If I plug the speakers into the pi at the 3.5mm output, I hear nothing at all. I can't test the HDMI right now as this monitor doesn't allow for sound but as long as the default is set to the USB sound card that is the only thing that should be working.
I should also add that I edited line 29 of the asoundrc file to say card 2 instead of card 0.
try the aplay -L with a capital L, that should give you the list of devices with their hardware names (i.e. plughw:1
One of those should represent the upmix, and then you should be able to just set that as the output in config.yaml
ok so stupid question will get the obvious answer probably. Where is the config file located? I checked the /opt folder and couldn't find it. I also did a file search for it and the only config.yaml that comes up is completely empty. I know the Alexa service wouldn't be working if there wasn't a working config file. also here is the output with -L.
pi@raspberrypi:~ $ aplay -L
null
Discard all samples (playback) or generate zero samples (capture)
pulse
PulseAudio Sound Server
dmix8
ch51dup
dmix6
microphone
2chplug
a2chplug
alt2ch
mono_playback
duplex
aduplex
monoduplex
mainvol
default
sysdefault:CARD=ALSA
bcm2835 ALSA, bcm2835 ALSA
Default Audio Device
dmix:CARD=ALSA,DEV=0
bcm2835 ALSA, bcm2835 ALSA
Direct sample mixing device
dmix:CARD=ALSA,DEV=1
bcm2835 ALSA, bcm2835 IEC958/HDMI
Direct sample mixing device
dsnoop:CARD=ALSA,DEV=0
bcm2835 ALSA, bcm2835 ALSA
Direct sample snooping device
dsnoop:CARD=ALSA,DEV=1
bcm2835 ALSA, bcm2835 IEC958/HDMI
Direct sample snooping device
hw:CARD=ALSA,DEV=0
bcm2835 ALSA, bcm2835 ALSA
Direct hardware device without any conversions
hw:CARD=ALSA,DEV=1
bcm2835 ALSA, bcm2835 IEC958/HDMI
Direct hardware device without any conversions
plughw:CARD=ALSA,DEV=0
bcm2835 ALSA, bcm2835 ALSA
Hardware device with all software conversions
plughw:CARD=ALSA,DEV=1
bcm2835 ALSA, bcm2835 IEC958/HDMI
Hardware device with all software conversions
sysdefault:CARD=Device_1
USB Sound Device, USB Audio
Default Audio Device
front:CARD=Device_1,DEV=0
USB Sound Device, USB Audio
Front speakers
surround21:CARD=Device_1,DEV=0
USB Sound Device, USB Audio
2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=Device_1,DEV=0
USB Sound Device, USB Audio
4.0 Surround output to Front and Rear speakers
surround41:CARD=Device_1,DEV=0
USB Sound Device, USB Audio
4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=Device_1,DEV=0
USB Sound Device, USB Audio
5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=Device_1,DEV=0
USB Sound Device, USB Audio
5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=Device_1,DEV=0
USB Sound Device, USB Audio
7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=Device_1,DEV=0
USB Sound Device, USB Audio
IEC958 (S/PDIF) Digital Audio Output
dmix:CARD=Device_1,DEV=0
USB Sound Device, USB Audio
Direct sample mixing device
dsnoop:CARD=Device_1,DEV=0
USB Sound Device, USB Audio
Direct sample snooping device
hw:CARD=Device_1,DEV=0
USB Sound Device, USB Audio
Direct hardware device without any conversions
plughw:CARD=Device_1,DEV=0
USB Sound Device, USB Audio
Hardware device with all software conversions
I assume I can just put in plughw:1
Thanks.
ok, cool - first the file is in /etc/opt/AlexaPi/config.yaml. and there is a good audio device debugging section in the wiki here: https://github.com/alexa-pi/AlexaPi/wiki/Audio-setup-&-debugging
Second, set the output device in the config to "surround51:CARD=Device_1,DEV=0"
if that doesn't work you may be able to use "ch51dup" - i passed right over that the first time
Sadly none of the option I have tried have worked and for some reason, I can't get the sound outputting from the other channels at all anymore. I have no idea how the config.yaml would have screwed with that. it doesn't even make sense to me.
do you have pulseaudio running? if so, you may need to run it as a service in system-wide mode and set the config to pulse (rather than alsa). see the section in the wiki for pulseaudio on the pi. the config.yaml is purely for AlexaPi sound input/output so it shouldn't stop audio otherwise, there's likely another problem there too.
I see that your original question is about shairplay-sync. That is unrelated to AlexaPi. You might be able to add something to /etc/shairport-sync.conf, but my recommendation would be to ask at the source, here.
I will do that. Still trying to get Alexa to work on all the speaker channels. I reverted back to a saved disk image I had before I made a bunch of changes. Haven't had a chance to test it yet.
Ok so now I think this is relevant. I got the PI3 back up and running. I have disabled the onboard sound card and only have my usb sound card. The usb sound card works just fine with promoe and vlc and creates the 5.1upmix. The alexapi service isn't liking something about the sound card setup and is quitting because it can't play any sound. Below are the three different ways of seeing the debugging info. Perhaps you can point me in the right direction.
pi@raspberrypi:~ $ sudo journalctl -u AlexaPi.service
-- Logs begin at Sun 2016-11-27 17:35:33 MST, end at Sun 2016-11-27 17:40:56 MST. --
Nov 27 17:35:36 raspberrypi systemd[1]: Starting Alexa client for all your devices...
Nov 27 17:35:36 raspberrypi systemd[1]: Started Alexa client for all your devices.
Nov 27 17:36:05 raspberrypi python[585]: Checking Internet Connection...
Nov 27 17:36:05 raspberrypi python[585]: Connection OK
Nov 27 17:36:08 raspberrypi pulseaudio[1014]: [pulseaudio] alsa-mixer.c: Volume element
Nov 27 17:36:08 raspberrypi pulseaudio[1014]: [pulseaudio] alsa-mixer.c: Volume element
Nov 27 17:36:08 raspberrypi pulseaudio[1014]: [pulseaudio] alsa-mixer.c: Volume element
Nov 27 17:36:08 raspberrypi pulseaudio[1014]: [pulseaudio] alsa-mixer.c: Volume element
Nov 27 17:36:08 raspberrypi pulseaudio[1014]: [pulseaudio] alsa-mixer.c: Volume element
Nov 27 17:36:09 raspberrypi pulseaudio[1014]: [pulseaudio] server-lookup.c: Unable to c
Nov 27 17:36:09 raspberrypi pulseaudio[1014]: [pulseaudio] main.c: Unable to contact D-
Nov 27 17:36:09 raspberrypi pulseaudio[1014]: [pulseaudio] bluez4-util.c: org.bluez.Man
Nov 27 17:36:09 raspberrypi python[585]: ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Un
Nov 27 17:36:09 raspberrypi python[585]: [02dd0f18] alsa audio output error: cannot ope
Nov 27 17:36:09 raspberrypi python[585]: [02dd0f18] core audio output error: Audio outp
Nov 27 17:36:09 raspberrypi python[585]: [02dd0f18] core audio output error: The audio
Nov 27 17:36:09 raspberrypi python[585]: No such file or directory.
Nov 27 17:36:09 raspberrypi python[585]: [02dd0f18] core audio output error: module not
Nov 27 17:36:09 raspberrypi python[585]: [73410fe0] core decoder error: failed to creat
Nov 27 17:36:11 raspberrypi python[585]: ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Un
Nov 27 17:36:11 raspberrypi python[585]: Traceback (most recent call last):
Nov 27 17:36:11 raspberrypi python[585]: File "/opt/AlexaPi/src/main.py", line 598, in
Nov 27 17:36:11 raspberrypi python[585]: loop()
Nov 27 17:36:11 raspberrypi python[585]: File "/opt/AlexaPi/src/main.py", line 509, in
Nov 27 17:36:11 raspberrypi python[585]: inp = alsaaudio.PCM(alsaaudio.PCM_CAPTURE, als
Nov 27 17:36:11 raspberrypi python[585]: alsaaudio.ALSAAudioError: No such file or dire
Nov 27 17:36:12 raspberrypi systemd[1]: AlexaPi.service: main process exited, code=exit
Nov 27 17:36:12 raspberrypi systemd[1]: Unit AlexaPi.service entered failed state.
lines 1-29/29 (END)
/opt/AlexaPi/src/main.py -d
INFO: pocketsphinx.c(152): Parsed model-specific feature parameters from /usr/local/lib/python2.7/dist-packages/pocketsphinx/model/en-us/feat.params
Current configuration:
[NAME] [DEFLT] [VALUE]
-agc none none
-agcthresh 2.0 2.000000e+00
-allphone
-allphone_ci no no
-alpha 0.97 9.700000e-01
-ascale 20.0 2.000000e+01
-aw 1 1
-backtrace no no
-beam 1e-48 1.000000e-48
-bestpath yes yes
-bestpathlw 9.5 9.500000e+00
-ceplen 13 13
-cmn live batch
-cmninit 40,3,-1 41.00,-5.29,-0.12,5.09,2.48,-4.07,-1.37,-1.78,-5.08,-2.05,-6.45,-1.42,1.17
-compallsen no no
-debug 0
-dict /usr/local/lib/python2.7/dist-packages/pocketsphinx/model/cmudict-en-us.dict
-dictcase no no
-dither no no
-doublebw no no
-ds 1 1
-fdict
-feat 1s_c_d_dd 1s_c_d_dd
-featparams
-fillprob 1e-8 1.000000e-08
-frate 100 100
-fsg
-fsgusealtpron yes yes
-fsgusefiller yes yes
-fwdflat yes yes
-fwdflatbeam 1e-64 1.000000e-64
-fwdflatefwid 4 4
-fwdflatlw 8.5 8.500000e+00
-fwdflatsfwin 25 25
-fwdflatwbeam 7e-29 7.000000e-29
-fwdtree yes yes
-hmm /usr/local/lib/python2.7/dist-packages/pocketsphinx/model/en-us
-input_endian little little
-jsgf
-keyphrase alexa
-kws
-kws_delay 10 10
-kws_plp 1e-1 1.000000e-01
-kws_threshold 1 1.000000e-05
-latsize 5000 5000
-lda
-ldadim 0 0
-lifter 0 22
-lm
-lmctl
-lmname
-logbase 1.0001 1.000100e+00
-logfn
-logspec no no
-lowerf 133.33334 1.300000e+02
-lpbeam 1e-40 1.000000e-40
-lponlybeam 7e-29 7.000000e-29
-lw 6.5 6.500000e+00
-maxhmmpf 30000 30000
-maxwpf -1 -1
-mdef
-mean
-mfclogdir
-min_endfr 0 0
-mixw
-mixwfloor 0.0000001 1.000000e-07
-mllr
-mmap yes yes
-ncep 13 13
-nfft 512 512
-nfilt 40 25
-nwpen 1.0 1.000000e+00
-pbeam 1e-48 1.000000e-48
-pip 1.0 1.000000e+00
-pl_beam 1e-10 1.000000e-10
-pl_pbeam 1e-10 1.000000e-10
-pl_pip 1.0 1.000000e+00
-pl_weight 3.0 3.000000e+00
-pl_window 5 5
-rawlogdir
-remove_dc no no
-remove_noise yes yes
-remove_silence yes yes
-round_filters yes yes
-samprate 16000 1.600000e+04
-seed -1 -1
-sendump
-senlogdir
-senmgau
-silprob 0.005 5.000000e-03
-smoothspec no no
-svspec 0-12/13-25/26-38
-tmat
-tmatfloor 0.0001 1.000000e-04
-topn 4 4
-topn_beam 0 0
-toprule
-transform legacy dct
-unit_area yes yes
-upperf 6855.4976 6.800000e+03
-uw 1.0 1.000000e+00
-vad_postspeech 50 50
-vad_prespeech 20 20
-vad_startspeech 10 10
-vad_threshold 2.0 2.000000e+00
-var
-varfloor 0.0001 1.000000e-04
-varnorm no no
-verbose no no
-warp_params
-warp_type inverse_linear inverse_linear
-wbeam 7e-29 7.000000e-29
-wip 0.65 6.500000e-01
-wlen 0.025625 2.562500e-02
INFO: feat.c(715): Initializing feature stream to type: '1s_c_d_dd', ceplen=13, CMN='batch', VARNORM='no', AGC='none'
INFO: acmod.c(166): Using subvector specification 0-12/13-25/26-38
INFO: mdef.c(518): Reading model definition: /usr/local/lib/python2.7/dist-packages/pocketsphinx/model/en-us/mdef
INFO: mdef.c(531): Found byte-order mark BMDF, assuming this is a binary mdef file
INFO: bin_mdef.c(336): Reading binary model definition: /usr/local/lib/python2.7/dist-packages/pocketsphinx/model/en-us/mdef
INFO: bin_mdef.c(516): 42 CI-phone, 137053 CD-phone, 3 emitstate/phone, 126 CI-sen, 5126 Sen, 29324 Sen-Seq
INFO: tmat.c(149): Reading HMM transition probability matrices: /usr/local/lib/python2.7/dist-packages/pocketsphinx/model/en-us/transition_matrices
INFO: acmod.c(117): Attempting to use PTM computation module
INFO: ms_gauden.c(127): Reading mixture gaussian parameter: /usr/local/lib/python2.7/dist-packages/pocketsphinx/model/en-us/means
INFO: ms_gauden.c(242): 42 codebook, 3 feature, size:
INFO: ms_gauden.c(244): 128x13
INFO: ms_gauden.c(244): 128x13
INFO: ms_gauden.c(244): 128x13
INFO: ms_gauden.c(127): Reading mixture gaussian parameter: /usr/local/lib/python2.7/dist-packages/pocketsphinx/model/en-us/variances
INFO: ms_gauden.c(242): 42 codebook, 3 feature, size:
INFO: ms_gauden.c(244): 128x13
INFO: ms_gauden.c(244): 128x13
INFO: ms_gauden.c(244): 128x13
INFO: ms_gauden.c(304): 222 variance values floored
INFO: ptm_mgau.c(476): Loading senones from dump file /usr/local/lib/python2.7/dist-packages/pocketsphinx/model/en-us/sendump
INFO: ptm_mgau.c(500): BEGIN FILE FORMAT DESCRIPTION
INFO: ptm_mgau.c(563): Rows: 128, Columns: 5126
INFO: ptm_mgau.c(595): Using memory-mapped I/O for senones
INFO: ptm_mgau.c(838): Maximum top-N: 4
INFO: phone_loop_search.c(114): State beam -225 Phone exit beam -225 Insertion penalty 0
INFO: dict.c(320): Allocating 138824 * 20 bytes (2711 KiB) for word entries
INFO: dict.c(333): Reading main dictionary: /usr/local/lib/python2.7/dist-packages/pocketsphinx/model/cmudict-en-us.dict
INFO: dict.c(213): Dictionary size 134723, allocated 1016 KiB for strings, 1679 KiB for phones
INFO: dict.c(336): 134723 words read
INFO: dict.c(358): Reading filler dictionary: /usr/local/lib/python2.7/dist-packages/pocketsphinx/model/en-us/noisedict
INFO: dict.c(213): Dictionary size 134728, allocated 0 KiB for strings, 0 KiB for phones
INFO: dict.c(361): 5 words read
INFO: dict2pid.c(396): Building PID tables for dictionary
INFO: dict2pid.c(406): Allocating 42^3 * 2 bytes (144 KiB) for word-initial triphones
INFO: dict2pid.c(132): Allocated 21336 bytes (20 KiB) for word-final triphones
INFO: dict2pid.c(196): Allocated 21336 bytes (20 KiB) for single-phone word triphones
INFO: kws_search.c(406): KWS(beam: -1080, plp: -23, default threshold -113, delay 10)
Checking Internet Connection...
Connection OK
Play_Audio Request for: /opt/AlexaPi/src/resources/hello.mp3
Player State: State.Opening
Player State: State.Playing
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM raspberrypi
[025b3280] alsa audio output error: cannot open ALSA device "raspberrypi": No such file or directory
[025b3280] core audio output error: Audio output failed
[025b3280] core audio output error: The audio device "raspberrypi" could not be used:
No such file or directory.
[025b3280] core audio output error: module not functional
[73411020] core decoder error: failed to create audio output
Player State: State.Ended
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM raspberrypi
Traceback (most recent call last):
File "/opt/AlexaPi/src/main.py", line 598, in <module>
loop()
File "/opt/AlexaPi/src/main.py", line 509, in loop
inp = alsaaudio.PCM(alsaaudio.PCM_CAPTURE, alsaaudio.PCM_NORMAL, config['sound']['input_device'])
alsaaudio.ALSAAudioError: No such file or directory [raspberrypi]
INFO: kws_search.c(448): TOTAL kws 0.00 CPU nan xRT
INFO: kws_search.c(451): TOTAL kws 0.00 wall nan xRT
upload=true&script=true&cardinfo=
!!################################
!!ALSA Information Script v 0.4.64
!!################################
!!Script ran on: Mon Nov 28 00:55:12 UTC 2016
!!Linux Distribution
!!------------------
ID_LIKE=debian
!!DMI Information
!!---------------
Manufacturer:
Product Name:
Product Version:
Firmware Version:
!!Kernel Information
!!------------------
Kernel release: 4.4.33-v7+
Operating System: GNU/Linux
Architecture: armv7l
Processor: unknown
SMP Enabled: Yes
!!ALSA Version
!!------------
Driver version: k4.4.33-v7+
Library version: 1.0.28
Utilities version: 1.0.28
!!Loaded ALSA modules
!!-------------------
snd_usb_audio
snd_usb_audio
!!Sound Servers on this system
!!----------------------------
Pulseaudio:
Installed - Yes (/usr/bin/pulseaudio)
Running - No
Jack:
Installed - Yes (/usr/bin/jackd)
Running - No
!!Soundcards recognised by ALSA
!!-----------------------------
0 [Device_1 ]: USB-Audio - USB Sound Device
USB Sound Device at usb-3f980000.usb-1.5, full speed
1 [Device ]: USB-Audio - USB PnP Sound Device
C-Media Electronics Inc. USB PnP Sound Device at usb-3f980000.usb-1.4, full spe
!!Modprobe options (Sound related)
!!--------------------------------
snd_pcsp: index=-2
snd_usb_audio: index=-2
snd_atiixp_modem: index=-2
snd_intel8x0m: index=-2
snd_via82xx_modem: index=-2
!!Loaded sound module options
!!---------------------------
!!Module: snd_usb_audio
autoclock : Y
device_setup : 0,0,0,0,0,0,0,0
enable : Y,Y,Y,Y,Y,Y,Y,Y
id : (null),(null),(null),(null),(null),(null),(null),(null)
ignore_ctl_error : N
index : -2,-1,-1,-1,-1,-1,-1,-1
pid : -1,-1,-1,-1,-1,-1,-1,-1
vid : -1,-1,-1,-1,-1,-1,-1,-1
!!Module: snd_usb_audio
autoclock : Y
device_setup : 0,0,0,0,0,0,0,0
enable : Y,Y,Y,Y,Y,Y,Y,Y
id : (null),(null),(null),(null),(null),(null),(null),(null)
ignore_ctl_error : N
index : -2,-1,-1,-1,-1,-1,-1,-1
pid : -1,-1,-1,-1,-1,-1,-1,-1
vid : -1,-1,-1,-1,-1,-1,-1,-1
!!USB Mixer information
!!---------------------
--startcollapse--
USB Mixer: usb_id=0x0d8c0102, ctrlif=0, ctlerr=0
Card: USB Sound Device at usb-3f980000.usb-1.5, full speed
Unit: 2
Control: name="PCM Capture Volume", index=0
Info: id=2, control=2, cmask=0x3, channels=2, type="S16"
Volume: min=-4096, max=2832, dBmin=-1600, dBmax=1106
Unit: 2
Control: name="PCM Capture Switch", index=0
Info: id=2, control=1, cmask=0x0, channels=1, type="INV_BOOLEAN"
Volume: min=0, max=1, dBmin=0, dBmax=0
Unit: 7
Control: name="PCM Capture Source", index=0
Info: id=7, control=0, cmask=0x0, channels=1, type="U8"
Volume: min=1, max=4, dBmin=0, dBmax=0
Unit: 8
Control: name="Mic Capture Volume", index=0
Info: id=8, control=2, cmask=0x3, channels=2, type="S16"
Volume: min=-4096, max=2832, dBmin=-1600, dBmax=1106
Unit: 8
Control: name="Mic Capture Switch", index=0
Info: id=8, control=1, cmask=0x0, channels=1, type="INV_BOOLEAN"
Volume: min=0, max=1, dBmin=0, dBmax=0
Unit: 9
Control: name="Mic Playback Volume", index=0
Info: id=9, control=2, cmask=0x3, channels=2, type="S16"
Volume: min=-6144, max=1921, dBmin=-2400, dBmax=750
Unit: 9
Control: name="Mic Playback Switch", index=0
Info: id=9, control=1, cmask=0x0, channels=1, type="INV_BOOLEAN"
Volume: min=0, max=1, dBmin=0, dBmax=0
Unit: 11
Control: name="Line Playback Volume", index=0
Info: id=11, control=2, cmask=0x3, channels=2, type="S16"
Volume: min=-6144, max=1921, dBmin=-2400, dBmax=750
Unit: 11
Control: name="Line Playback Switch", index=0
Info: id=11, control=1, cmask=0x0, channels=1, type="INV_BOOLEAN"
Volume: min=0, max=1, dBmin=0, dBmax=0
Unit: 13
Control: name="Speaker Playback Volume", index=0
Info: id=13, control=2, cmask=0xff, channels=8, type="S16"
Volume: min=-9456, max=0, dBmin=-3693, dBmax=0
Unit: 13
Control: name="Speaker Playback Switch", index=0
Info: id=13, control=1, cmask=0x0, channels=1, type="INV_BOOLEAN"
Volume: min=0, max=1, dBmin=0, dBmax=0
Unit: 15
Control: name="Line Capture Volume", index=0
Info: id=15, control=2, cmask=0x3, channels=2, type="S16"
Volume: min=-4096, max=2832, dBmin=-1600, dBmax=1106
Unit: 15
Control: name="Line Capture Switch", index=0
Info: id=15, control=1, cmask=0x0, channels=1, type="INV_BOOLEAN"
Volume: min=0, max=1, dBmin=0, dBmax=0
Unit: 16
Control: name="IEC958 In Capture Switch", index=0
Info: id=16, control=1, cmask=0x0, channels=1, type="INV_BOOLEAN"
Volume: min=0, max=1, dBmin=0, dBmax=0
USB Mixer: usb_id=0x0d8c013c, ctrlif=0, ctlerr=0
Card: C-Media Electronics Inc. USB PnP Sound Device at usb-3f980000.usb-1.4, full spe
Unit: 10
Control: name="Auto Gain Control", index=0
Info: id=10, control=7, cmask=0x0, channels=1, type="BOOLEAN"
Volume: min=0, max=1, dBmin=0, dBmax=0
Unit: 10
Control: name="Mic Capture Volume", index=0
Info: id=10, control=2, cmask=0x0, channels=1, type="S16"
Volume: min=0, max=6096, dBmin=0, dBmax=2381
Unit: 10
Control: name="Mic Capture Switch", index=0
Info: id=10, control=1, cmask=0x0, channels=1, type="INV_BOOLEAN"
Volume: min=0, max=1, dBmin=0, dBmax=0
--endcollapse--
!!ALSA Device nodes
!!-----------------
crw-rw----+ 1 root audio 116, 0 Nov 27 17:35 /dev/snd/controlC0
crw-rw----+ 1 root audio 116, 32 Nov 27 17:35 /dev/snd/controlC1
crw-rw----+ 1 root audio 116, 24 Nov 27 17:35 /dev/snd/pcmC0D0c
crw-rw----+ 1 root audio 116, 16 Nov 27 17:36 /dev/snd/pcmC0D0p
crw-rw----+ 1 root audio 116, 56 Nov 27 17:35 /dev/snd/pcmC1D0c
crw-rw----+ 1 root audio 116, 1 Nov 27 17:35 /dev/snd/seq
crw-rw----+ 1 root audio 116, 33 Nov 27 17:35 /dev/snd/timer
/dev/snd/by-id:
total 0
drwxr-xr-x 2 root root 80 Nov 27 17:35 .
drwxr-xr-x 4 root root 220 Nov 27 17:35 ..
lrwxrwxrwx 1 root root 12 Nov 27 17:35 usb-0d8c_USB_Sound_Device-00 -> ../controlC0
lrwxrwxrwx 1 root root 12 Nov 27 17:35 usb-C-Media_Electronics_Inc._USB_PnP_Sound_Device-00 -> ../controlC1
/dev/snd/by-path:
total 0
drwxr-xr-x 2 root root 80 Nov 27 17:35 .
drwxr-xr-x 4 root root 220 Nov 27 17:35 ..
lrwxrwxrwx 1 root root 12 Nov 27 17:35 platform-3f980000.usb-usb-0:1.4:1.0 -> ../controlC1
lrwxrwxrwx 1 root root 12 Nov 27 17:35 platform-3f980000.usb-usb-0:1.5:1.0 -> ../controlC0
!!ALSA configuration files
!!------------------------
!!User specific config file (~/.asoundrc)
# 2008-11-15
#
# This .asoundrc will allow the following:
#
# - upmix stereo files to 5.1 speakers.
# - playback real 5.1 sounds, on 5.1 speakers,
# - allow the playback of both stere(oupmixed) and surround(5.1) sources at the same time.
# - use the 6th and 7th channel (side speakers) as a separate soundcard, i.e. for headphones
# (This is called the "alternate" output throughout the file, device names prefixed with 'a')
# - play mono sources in stereo (like skype & ekiga) on the alterate output
#
# Make sure you have "8 Channels" and NOT "6 Channels" selected in alsamixer!
#
# Please try the following commands, to make sure everything is working as it should.
#
# To test stereo upmix : speaker-test -c2 -Ddefault -twav
# To test surround(5.1): speaker-test -c6 -Dplug:dmix6 -twav
# To test alternative output: speaker-test -c2 -Daduplex -twav
# To test mono upmix: speaker-test -c1 -Dmonoduplex -twav
#
#
# It may not work out of the box for all cards. If it doesnt work for you, read the comments throughout the file.
# The basis of this file was written by wishie of #alsa, and then modified with info from various sources by
# squisher.
#Define the soundcard to use
pcm.snd_card {
type hw
card 0
device 0
}
# 8 channel dmix - output whatever audio, to all 8 speakers
pcm.dmix8 {
type dmix
ipc_key 1024
ipc_key_add_uid false
ipc_perm 0660
slave {
pcm "snd_card"
rate 48000
channels 8
period_time 0
period_size 1024
buffer_time 0
buffer_size 5120
}
# Some cards, like the "nforce" variants require the following to be uncommented. It routes the audio to t he correct speakers.
bindings {
0 0
1 1
2 4
3 5
4 2
5 3
6 6
7 7
}
}
# upmixing - duplicate stereo data to all 6 channels
pcm.ch51dup {
type route
slave.pcm dmix8
slave.channels 8
ttable.0.0 1
ttable.1.1 1
ttable.0.2 1
ttable.1.3 1
ttable.0.4 0.5
ttable.1.4 0.5
ttable.0.5 0.5
ttable.1.5 0.5
}
# this creates a six channel soundcard
# and outputs to the eight channel one
# i.e. for usage in mplayer I had to define in ~/.mplayer/config:
# ao=alsa:device=dmix6
# channels=6
pcm.dmix6 {
type route
slave.pcm dmix8
slave.channels 8
ttable.0.0 1
ttable.1.1 1
ttable.2.2 1
ttable.3.3 1
ttable.4.4 1
ttable.5.5 1
}
# share the microphone, i.e. because virtualbox grabs it by default
pcm.microphone {
type dsnoop
ipc_key 1027
slave {
pcm "snd_card"
}
}
# rate conversion, needed i.e. for wine
pcm.2chplug {
type plug
slave.pcm "ch51dup"
}
pcm.a2chplug {
type plug
slave.pcm "dmix8"
}
# routes the channel for the alternative
# 2 channel output, which becomes the 7th and 8th channel
# on the real soundcard
pcm.alt2ch {
type route
slave.pcm "a2chplug"
slave.channels 8
ttable.0.6 1
ttable.1.7 1
}
# skype and ekiga are only mono, so route left channel to the right channel
# note: this gets routed to the alternative 2 channels
pcm.mono_playback {
type route
slave.pcm "a2chplug"
slave.channels 8
# Send Skype channel 0 to the L and R speakers at full volume
ttable.0.6 1
ttable.0.7 1
}
# 'full-duplex' device for use with aoss
pcm.duplex {
type asym
playback.pcm "2chplug"
capture.pcm "microphone"
}
pcm.aduplex {
type asym
playback.pcm "alt2ch"
capture.pcm "microphone"
}
pcm.monoduplex {
type asym
playback.pcm "mono_playback"
capture.pcm "microphone"
}
# for aoss
pcm.dsp0 "duplex"
ctl.mixer0 "duplex"
# softvol manages volume in alsa
# i.e. wine likes this
pcm.mainvol {
type softvol
slave.pcm "duplex"
control {
name "2ch-Upmix Master"
card 0
}
}
#pcm.!default "mainvol"
# set the default device according to the environment
# variable ALSA_DEFAULT_PCM and default to mainvol
pcm.!default {
@func refer
name { @func concat
strings [ "pcm."
{ @func getenv
vars [ ALSA_DEFAULT_PCM ]
default "mainvol"
}
]
}
}
# uncomment the following if you want to be able to control
# the mixer device through environment variables as well
#ctl.!default {
# @func refer
# name { @func concat
# strings [ "ctl."
# { @func getenv
# vars [ ALSA_DEFAULT_CTL
# ALSA_DEFAULT_PCM
# ]
# default "duplex"
# }
# ]
# }
#}
!!Aplay/Arecord output
!!--------------------
APLAY
**** List of PLAYBACK Hardware Devices ****
card 0: Device_1 [USB Sound Device], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0
ARECORD
**** List of CAPTURE Hardware Devices ****
card 0: Device_1 [USB Sound Device], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: Device [USB PnP Sound Device], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0
!!Amixer output
!!-------------
!!-------Mixer controls for card 0 [Device_1]
Card hw:0 'Device_1'/'USB Sound Device at usb-3f980000.usb-1.5, full speed'
Mixer name : 'USB Mixer'
Components : 'USB0d8c:0102'
Controls : 17
Simple ctrls : 7
Simple mixer control 'Speaker',0
Capabilities: pvolume pswitch pswitch-joined
Playback channels: Front Left - Front Right - Rear Left - Rear Right - Front Center - Woofer - Side Left - Side Right
Limits: Playback 0 - 197
Mono:
Front Left: Playback 190 [96%] [-1.32dB] [on]
Front Right: Playback 190 [96%] [-1.32dB] [on]
Rear Left: Playback 190 [96%] [-1.32dB] [on]
Rear Right: Playback 190 [96%] [-1.32dB] [on]
Front Center: Playback 191 [97%] [-1.13dB] [on]
Woofer: Playback 190 [96%] [-1.32dB] [on]
Side Left: Playback 191 [97%] [-1.13dB] [on]
Side Right: Playback 191 [97%] [-1.13dB] [on]
Simple mixer control 'PCM',0
Capabilities: cvolume cswitch cswitch-joined
Capture channels: Front Left - Front Right
Limits: Capture 0 - 6928
Front Left: Capture 6303 [91%] [8.61dB] [on]
Front Right: Capture 6303 [91%] [8.61dB] [on]
Simple mixer control 'PCM Capture Source',0
Capabilities: enum
Items: 'Mic' 'Line' 'IEC958 In' 'Mixer'
Item0: 'Mic'
Simple mixer control 'Line',0
Capabilities: pvolume cvolume pswitch pswitch-joined cswitch cswitch-joined
Playback channels: Front Left - Front Right
Capture channels: Front Left - Front Right
Limits: Playback 0 - 8065 Capture 0 - 6928
Front Left: Playback 7826 [97%] [6.56dB] [off] Capture 0 [0%] [-16.00dB] [off]
Front Right: Playback 7826 [97%] [6.56dB] [off] Capture 0 [0%] [-16.00dB] [off]
Simple mixer control 'Mic',0
Capabilities: pvolume cvolume pswitch pswitch-joined cswitch cswitch-joined
Playback channels: Front Left - Front Right
Capture channels: Front Left - Front Right
Limits: Playback 0 - 8065 Capture 0 - 6928
Front Left: Playback 7778 [96%] [6.37dB] [off] Capture 6308 [91%] [8.63dB] [on]
Front Right: Playback 7778 [96%] [6.37dB] [off] Capture 6308 [91%] [8.63dB] [on]
Simple mixer control 'IEC958 In',0
Capabilities: cswitch cswitch-joined
Capture channels: Mono
Mono: Capture [on]
Simple mixer control '2ch-Upmix Master',0
Capabilities: volume
Playback channels: Front Left - Front Right
Capture channels: Front Left - Front Right
Limits: 0 - 255
Front Left: 255 [100%]
Front Right: 255 [100%]
!!-------Mixer controls for card 1 [Device]
Card hw:1 'Device'/'C-Media Electronics Inc. USB PnP Sound Device at usb-3f980000.usb-1.4, full spe'
Mixer name : 'USB Mixer'
Components : 'USB0d8c:013c'
Controls : 4
Simple ctrls : 2
Simple mixer control 'Mic',0
Capabilities: cvolume cvolume-joined cswitch cswitch-joined
Capture channels: Mono
Limits: Capture 0 - 16
Mono: Capture 13 [81%] [19.34dB] [on]
Simple mixer control 'Auto Gain Control',0
Capabilities: pswitch pswitch-joined
Playback channels: Mono
Mono: Playback [on]
!!Alsactl output
!!--------------
--startcollapse--
state.Device_1 {
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
comment {
access read
type INTEGER
count 8
range '0 - 36'
}
}
control.2 {
iface PCM
name 'Capture Channel Map'
value.0 0
value.1 0
comment {
access read
type INTEGER
count 2
range '0 - 36'
}
}
control.3 {
iface MIXER
name 'Mic Playback Switch'
value false
comment {
access 'read write'
type BOOLEAN
count 1
}
}
control.4 {
iface MIXER
name 'Mic Playback Volume'
value.0 7778
value.1 7778
comment {
access 'read write'
type INTEGER
count 2
range '0 - 8065'
dbmin -2400
dbmax 750
dbvalue.0 637
dbvalue.1 637
}
}
control.5 {
iface MIXER
name 'Line Playback Switch'
value false
comment {
access 'read write'
type BOOLEAN
count 1
}
}
control.6 {
iface MIXER
name 'Line Playback Volume'
value.0 7826
value.1 7826
comment {
access 'read write'
type INTEGER
count 2
range '0 - 8065'
dbmin -2400
dbmax 750
dbvalue.0 656
dbvalue.1 656
}
}
control.7 {
iface MIXER
name 'Speaker Playback Switch'
value true
comment {
access 'read write'
type BOOLEAN
count 1
}
}
control.8 {
iface MIXER
name 'Speaker Playback Volume'
value.0 190
value.1 190
value.2 190
value.3 190
value.4 191
value.5 190
value.6 191
value.7 191
comment {
access 'read write'
type INTEGER
count 8
range '0 - 197'
dbmin -3693
dbmax 0
dbvalue.0 -132
dbvalue.1 -132
dbvalue.2 -132
dbvalue.3 -132
dbvalue.4 -113
dbvalue.5 -132
dbvalue.6 -113
dbvalue.7 -113
}
}
control.9 {
iface MIXER
name 'Mic Capture Switch'
value true
comment {
access 'read write'
type BOOLEAN
count 1
}
}
control.10 {
iface MIXER
name 'Mic Capture Volume'
value.0 6308
value.1 6308
comment {
access 'read write'
type INTEGER
count 2
range '0 - 6928'
dbmin -1600
dbmax 1106
dbvalue.0 863
dbvalue.1 863
}
}
control.11 {
iface MIXER
name 'Line Capture Switch'
value false
comment {
access 'read write'
type BOOLEAN
count 1
}
}
control.12 {
iface MIXER
name 'Line Capture Volume'
value.0 0
value.1 0
comment {
access 'read write'
type INTEGER
count 2
range '0 - 6928'
dbmin -1600
dbmax 1106
dbvalue.0 -1600
dbvalue.1 -1600
}
}
control.13 {
iface MIXER
name 'IEC958 In Capture Switch'
value true
comment {
access 'read write'
type BOOLEAN
count 1
}
}
control.14 {
iface MIXER
name 'PCM Capture Switch'
value true
comment {
access 'read write'
type BOOLEAN
count 1
}
}
control.15 {
iface MIXER
name 'PCM Capture Volume'
value.0 6303
value.1 6303
comment {
access 'read write'
type INTEGER
count 2
range '0 - 6928'
dbmin -1600
dbmax 1106
dbvalue.0 861
dbvalue.1 861
}
}
control.16 {
iface MIXER
name 'PCM Capture Source'
value Mic
comment {
access 'read write'
type ENUMERATED
count 1
item.0 Mic
item.1 Line
item.2 'IEC958 In'
item.3 Mixer
}
}
control.17 {
iface MIXER
name '2ch-Upmix Master'
value.0 255
value.1 255
comment {
access 'read write user'
type INTEGER
count 2
range '0 - 255'
tlv '00000001000000080000000000000014'
dbmin 0
dbmax 5100
dbvalue.0 5100
dbvalue.1 5100
}
}
}
state.Device {
control.1 {
iface PCM
name 'Capture Channel Map'
value 0
comment {
access read
type INTEGER
count 1
range '0 - 36'
}
}
control.2 {
iface MIXER
name 'Mic Capture Switch'
value true
comment {
access 'read write'
type BOOLEAN
count 1
}
}
control.3 {
iface MIXER
name 'Mic Capture Volume'
value 13
comment {
access 'read write'
type INTEGER
count 1
range '0 - 16'
dbmin 0
dbmax 2381
dbvalue.0 1934
}
}
control.4 {
iface MIXER
name 'Auto Gain Control'
value true
comment {
access 'read write'
type BOOLEAN
count 1
}
}
}
--endcollapse--
!!All Loaded Modules
!!------------------
Module
bnep
hci_uart
btbcm
bluetooth
snd_usb_audio
snd_hwdep
snd_usbmidi_lib
snd_rawmidi
brcmfmac
snd_seq_device
brcmutil
snd_pcm
snd_timer
snd
cfg80211
rfkill
bcm2835_gpiomem
i2c_bcm2708
bcm2835_wdt
evdev
uio_pdrv_genirq
uio
i2c_dev
fuse
ipv6
!!ALSA/HDA dmesg
!!--------------
[ 4.191882] usb 1-1.5: [2] FU [PCM Capture Volume] ch = 2, val = -4096/2832/1
[ 4.193710] usbcore: registered new interface driver snd-usb-audio
[ 4.231662] brcmfmac: brcmf_c_preinit_dcmds: Firmware version = wl0: May 27 2016 00:13:38 version 7.45.41.26 (r640327) FWID 01-df77e4a7
I am running your program on a raspberry pi 3 with the most up to date version of raspbian. I have found a way to upmix stereo files to 5.1 sound with some setting in the asoundrc file. It works great if I am playing an mp3 with promoe. Is there a way to get it working with shairport-sync?
The following link will take you to the asoundrc file settings.
https://de.mcbf.net/david/dotasoundrc/
please let me know if this is something that could be made possible. thanks.