RaspberryPi + Pocketsphinx + ps3eye Error: Failed to open audio device - audio

just installed pocketsphinx on my raspberry pi. Think i'm going crazy but not sure if I'm providing the correct device.
Whenever I run:
src/programs/pocketsphinx_continuous -adcdev plughw:1,0 -nfft 2048
-samprate 48000
I get the following:
root#scarlettpi:/usr/install/pocketsphinx-0.8#
src/programs/pocketsphinx_continuous -adcdev plughw:1,0 -nfft 2048
-samprate 48000 INFO: cmd_ln.c(691): Parsing command line: /usr/install/pocketsphinx-0.8/src/programs/.libs/lt-pocketsphinx_continuous
\ -adcdev plughw:1,0 \ -nfft 2048 \ -samprate 48000
Current configuration: [NAME] [DEFLT] [VALUE]
-adcdev plughw:1,0
-agc none none
-agcthresh 2.0 2.000000e+00
-alpha 0.97 9.700000e-01
-argfile
-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
-bghist no no
-ceplen 13 13
-cmn current current
-cmninit 8.0 8.0
-compallsen no no
-debug 0
-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
-infile
-input_endian little little
-jsgf
-kdmaxbbi -1 -1
-kdmaxdepth 0 0
-kdtree
-latsize 5000 5000
-lda
-ldadim 0 0
-lextreedump 0 0
-lifter 0 0
-lm
-lmctl
-lmname default default
-logbase 1.0001 1.000100e+00
-logfn
-logspec no no
-lowerf 133.33334 1.333333e+02
-lpbeam 1e-40 1.000000e-40
-lponlybeam 7e-29 7.000000e-29
-lw 6.5 6.500000e+00
-maxhmmpf -1 -1
-maxnewoov 20 20
-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 2048
-nfilt 40 40
-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-5 1.000000e-05
-pl_window 0 0
-rawlogdir
-remove_dc no no
-round_filters yes yes
-samprate 16000 4.800000e+04
-seed -1 -1
-sendump
-senlogdir
-senmgau
-silprob 0.005 5.000000e-03
-smoothspec no no
-svspec
-time no no
-tmat
-tmatfloor 0.0001 1.000000e-04
-topn 4 4
-topn_beam 0 0
-toprule
-transform legacy legacy
-unit_area yes yes
-upperf 6855.4976 6.855498e+03
-usewdphones no no
-uw 1.0 1.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: cmd_ln.c(691): Parsing command line: \ -nfilt 20 \ -lowerf 1 \
-upperf 4000 \ -wlen 0.025 \ -transform dct \ -round_filters no \
-remove_dc yes \ -svspec 0-12/13-25/26-38 \ -feat 1s_c_d_dd \ -agc
none \ -cmn current \ -cmninit 56,-3,1 \ -varnorm no
Current configuration: [NAME] [DEFLT] [VALUE]
-agc none none
-agcthresh 2.0 2.000000e+00
-alpha 0.97 9.700000e-01
-ceplen 13 13
-cmn current current
-cmninit 8.0 56,-3,1
-dither no no
-doublebw no no
-feat 1s_c_d_dd 1s_c_d_dd
-frate 100 100
-input_endian little little
-lda
-ldadim 0 0
-lifter 0 0
-logspec no no
-lowerf 133.33334 1.000000e+00
-ncep 13 13
-nfft 512 2048
-nfilt 40 20
-remove_dc no yes
-round_filters yes no
-samprate 16000 4.800000e+04
-seed -1 -1
-smoothspec no no
-svspec 0-12/13-25/26-38
-transform legacy dct
-unit_area yes yes
-upperf 6855.4976 4.000000e+03
-varnorm no no
-verbose no no
-warp_params
-warp_type inverse_linear inverse_linear
-wlen 0.025625 2.500000e-02
INFO: acmod.c(246): Parsed model-specific feature parameters from
/usr/local/share/pocketsphinx/model/hmm/en_US/hub4wsj_sc_8k/feat.params
INFO: feat.c(713): Initializing feature stream to type: '1s_c_d_dd',
ceplen=13, CMN='current', VARNORM='no', AGC='none' INFO: cmn.c(142):
mean[0]= 12.00, mean[1..12]= 0.0 INFO: acmod.c(167): Using subvector
specification 0-12/13-25/26-38 INFO: mdef.c(517): Reading model
definition:
/usr/local/share/pocketsphinx/model/hmm/en_US/hub4wsj_sc_8k/mdef INFO:
mdef.c(528): Found byte-order mark BMDF, assuming this is a binary
mdef file INFO: bin_mdef.c(336): Reading binary model definition:
/usr/local/share/pocketsphinx/model/hmm/en_US/hub4wsj_sc_8k/mdef INFO:
bin_mdef.c(513): 50 CI-phone, 143047 CD-phone, 3 emitstate/phone, 150
CI-sen, 5150 Sen, 27135 Sen-Seq INFO: tmat.c(205): Reading HMM
transition probability matrices:
/usr/local/share/pocketsphinx/model/hmm/en_US/hub4wsj_sc_8k/transition_matrices
INFO: acmod.c(121): Attempting to use SCHMM computation module INFO:
ms_gauden.c(198): Reading mixture gaussian parameter:
/usr/local/share/pocketsphinx/model/hmm/en_US/hub4wsj_sc_8k/means
INFO: ms_gauden.c(292): 1 codebook, 3 feature, size: INFO:
ms_gauden.c(294): 256x13 INFO: ms_gauden.c(294): 256x13 INFO:
ms_gauden.c(294): 256x13 INFO: ms_gauden.c(198): Reading mixture
gaussian parameter:
/usr/local/share/pocketsphinx/model/hmm/en_US/hub4wsj_sc_8k/variances
INFO: ms_gauden.c(292): 1 codebook, 3 feature, size: INFO:
ms_gauden.c(294): 256x13 INFO: ms_gauden.c(294): 256x13 INFO:
ms_gauden.c(294): 256x13 INFO: ms_gauden.c(354): 0 variance values
floored INFO: s2_semi_mgau.c(903): Loading senones from dump file
/usr/local/share/pocketsphinx/model/hmm/en_US/hub4wsj_sc_8k/sendump
INFO: s2_semi_mgau.c(927): BEGIN FILE FORMAT DESCRIPTION INFO:
s2_semi_mgau.c(1022): Using memory-mapped I/O for senones INFO:
s2_semi_mgau.c(1296): Maximum top-N: 4 Top-N beams: 0 0 0 INFO:
dict.c(317): Allocating 137543 * 20 bytes (2686 KiB) for word entries
INFO: dict.c(332): Reading main dictionary:
/usr/local/share/pocketsphinx/model/lm/en_US/cmu07a.dic INFO:
dict.c(211): Allocated 1010 KiB for strings, 1664 KiB for phones INFO:
dict.c(335): 133436 words read INFO: dict.c(341): Reading filler
dictionary:
/usr/local/share/pocketsphinx/model/hmm/en_US/hub4wsj_sc_8k/noisedict
INFO: dict.c(211): Allocated 0 KiB for strings, 0 KiB for phones INFO:
dict.c(344): 11 words read INFO: dict2pid.c(396): Building PID tables
for dictionary INFO: dict2pid.c(404): Allocating 50^3 * 2 bytes (244
KiB) for word-initial triphones INFO: dict2pid.c(131): Allocated 30200
bytes (29 KiB) for word-final triphones INFO: dict2pid.c(195):
Allocated 30200 bytes (29 KiB) for single-phone word triphones INFO:
ngram_model_arpa.c(77): No \data\ mark in LM file INFO:
ngram_model_dmp.c(142): Will use memory-mapped I/O for LM file INFO:
ngram_model_dmp.c(196): ngrams 1=5001, 2=436879, 3=418286 INFO:
ngram_model_dmp.c(242): 5001 = LM.unigrams(+trailer) read INFO:
ngram_model_dmp.c(288): 436879 = LM.bigrams(+trailer) read INFO:
ngram_model_dmp.c(314): 418286 = LM.trigrams read INFO:
ngram_model_dmp.c(339): 37293 = LM.prob2 entries read INFO:
ngram_model_dmp.c(359): 14370 = LM.bo_wt2 entries read INFO:
ngram_model_dmp.c(379): 36094 = LM.prob3 entries read INFO:
ngram_model_dmp.c(407): 854 = LM.tseg_base entries read INFO:
ngram_model_dmp.c(463): 5001 = ascii word strings read INFO:
ngram_search_fwdtree.c(99): 788 unique initial diphones INFO:
ngram_search_fwdtree.c(147): 0 root, 0 non-root channels, 60
single-phone words INFO: ngram_search_fwdtree.c(186): Creating search
tree INFO: ngram_search_fwdtree.c(191): before: 0 root, 0 non-root
channels, 60 single-phone words INFO: ngram_search_fwdtree.c(326):
after: max nonroot chan increased to 13428 INFO:
ngram_search_fwdtree.c(338): after: 457 root, 13300 non-root channels,
26 single-phone words INFO: ngram_search_fwdflat.c(156): fwdflat:
min_ef_width = 4, max_sf_win = 25 INFO: continuous.c(371):
/usr/install/pocketsphinx-0.8/src/programs/.libs/lt-pocketsphinx_continuous
COMPILED ON: Jul 21 2013, AT: 14:34:06
Mixer load failed: Invalid argument FATAL_ERROR: "continuous.c", line
246: Failed to open audio device
I'm using a ps3eye currently. If i do a simple:
arecord -D plughw:1,0 -d 5 -q -f cd -t wav ~/test.wav
Everything works fine ( Verified this by hooking up Raspberrypi to TV via HDMI and running aplay ~/test.wav )
What am I doing wrong guys?
Information you might need ( based on other posts i've seen ):
root#scarlettpi:/usr/install/pocketsphinx-0.8# 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
root#scarlettpi:/usr/install/pocketsphinx-0.8#
root#scarlettpi:/usr/install/pocketsphinx-0.8# aplay -L
null
Discard all samples (playback) or generate zero samples (capture)
pulse
PulseAudio Sound Server
sysdefault:CARD=ALSA
bcm2835 ALSA, bcm2835 ALSA
Default Audio Device
root#scarlettpi:/usr/install/pocketsphinx-0.8#
root#scarlettpi:/usr/install/pocketsphinx-0.8# dpkg -l | grep "alsa"
ii alsa-base 1.0.25+3~deb7u1 all ALSA driver configuration files
ii alsa-firmware-loaders 1.0.25-2 armhf ALSA software loaders for specific hardware
ii alsa-oss 1.0.25-1 armhf ALSA wrapper for OSS applications
ii alsa-tools 1.0.25-2 armhf Console based ALSA utilities for specific hardware
ii alsa-utils 1.0.25-4 armhf Utilities for configuring and using ALSA
ii alsaplayer-alsa 0.99.80-5.1 armhf PCM player designed for ALSA (ALSA output module)
ii alsaplayer-common 0.99.80-5.1 armhf PCM player designed for ALSA (common files)
ii alsaplayer-gtk 0.99.80-5.1 armhf PCM player designed for ALSA (GTK+ version)
ii gstreamer0.10-alsa:armhf 0.10.36-1.1 armhf GStreamer plugin for ALSA
ii libsox-fmt-alsa 14.4.0-3 armhf SoX alsa format I/O library
root#scarlettpi:/usr/install/pocketsphinx-0.8#
root#scarlettpi:/usr/install/pocketsphinx-0.8# dpkg -l | grep pulseaudio
ii gstreamer0.10-pulseaudio:armhf 0.10.31-3+nmu1 armhf GStreamer plugin for PulseAudio
root#scarlettpi:/usr/install/pocketsphinx-0.8#
Also in terms of installing pocket sphinx I did the following:
# uninstall pulse audio if its already installed
apt-get remove pulseaudio -y
aptitude purge pulseaudio -y
# sphinxbase install
apt-get install bison -y
cd /usr/install
wget http://downloads.sourceforge.net/project/cmusphinx/sphinxbase/0.8/sphinxbase-0.8.tar.gz
tar -xvf sphinxbase-0.8.tar.gz
cd sphinxbase-0.8
./configure
make
make install
cd -
# pocketsphinx installwget http://sourceforge.net/projects/cmusphinx/files/pocketsphinx/0.8/pocketsphinx-0.8.tar.gz
tar -xvf pocketsphinx-0.8.tar.gz
cd pocketsphinx-0.8
./configure
make
make install
Any ideas or advice in the right direction would be extremely helpful.
Thanks,
Malcolm Jones
EDIT:
Forgot to include this information as well:
root#scarlettpi:/usr/install/pocketsphinx-0.8# arecord -L
null
Discard all samples (playback) or generate zero samples (capture)
pulse
PulseAudio Sound Server
sysdefault:CARD=CameraB409241
USB Camera-B4.09.24.1, USB Audio
Default Audio Device
front:CARD=CameraB409241,DEV=0
USB Camera-B4.09.24.1, USB Audio
Front speakers
surround40:CARD=CameraB409241,DEV=0
USB Camera-B4.09.24.1, USB Audio
4.0 Surround output to Front and Rear speakers
surround41:CARD=CameraB409241,DEV=0
USB Camera-B4.09.24.1, USB Audio
4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=CameraB409241,DEV=0
USB Camera-B4.09.24.1, USB Audio
5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=CameraB409241,DEV=0
USB Camera-B4.09.24.1, USB Audio
5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=CameraB409241,DEV=0
USB Camera-B4.09.24.1, USB Audio
7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=CameraB409241,DEV=0
USB Camera-B4.09.24.1, USB Audio
IEC958 (S/PDIF) Digital Audio Output
root#scarlettpi:/usr/install/pocketsphinx-0.8#

Took me a while, with with some help from a couple sources ( they will be listed in my answer ) and some helpful hints from nikolay-shmyrev, I finally came up with an answer that worked for me.
Key assumptions:
running these commands as the pi user ( previously I was running them as root, which was incorrect )
I'm using continuous recognition and I was ONLY looking for the ability to "wake-up" my raspberry pi. Upon waking it up, I have other plans on how it should interact.
My setup:
Canakit RaspberryPi
HDMI cable to my Toshiba TV
usb wifi dongle
Playstation 3 Eye for speech recognition
Moving forward. I ran the following commands on my RaspberryPi to get PulseAudio + pocketsphinx working together w/ my Playstation 3 Eye. ( If you see any places for improvement please let me know )
Install pulse audio / development packages
sudo apt-get install gstreamer0.10-pulseaudio libao4 libasound2-plugins libgconfmm-2.6-1c2 libglademm-2.4-1c2a libpulse-dev libpulse-mainloop-glib0 libpulse-mainloop-glib0-dbg libpulse0 libpulse0-dbg libsox-fmt-pulse paman paprefs pavucontrol pavumeter pulseaudio pulseaudio-dbg pulseaudio-esound-compat pulseaudio-esound-compat-dbg pulseaudio-module-bluetooth pulseaudio-module-gconf pulseaudio-module-jack pulseaudio-module-lirc pulseaudio-module-lirc-dbg pulseaudio-module-x11 pulseaudio-module-zeroconf pulseaudio-module-zeroconf-dbg pulseaudio-utils oss-compat -y
Setting up ALSA
Per instructions from http://forums.debian.net/viewtopic.php?f=16&t=12497
sudo \cp -pf /etc/asound.conf /etc/asound.conf.ORIG
echo 'pcm.pulse {
type pulse
}
ctl.pulse {
type pulse
}
pcm.!default {
type pulse
}
ctl.!default {
type pulse
}' | sudo tee /etc/asound.conf
Make sure your camera device loads on boot
_DEVICE_LOAD_ON_START=$(grep "snd.bcm2835" /etc/modules | wc -l)
if [[ "${_DEVICE_LOAD_ON_START}" = "0" ]]; then
sudo \cp -pf /etc/modules /etc/modules.ORIG
echo "snd-bcm2835" | tee -a /etc/modules
fi
# Disallow module loading after startup. This is a security feature since it disallows additional module loading during runtime and on user request.
_DISALLOW_MODULE_LOADING=$(grep "DISALLOW_MODULE_LOADING=1" /etc/default/pulseaudio | wc -l)
if [[ "${_DISALLOW_MODULE_LOADING}" = "0" ]]; then
sudo \cp -pf /etc/default/pulseaudio /etc/default/pulseaudio.ORIG
sudo sed -i "s,DISALLOW_MODULE_LOADING=1,DISALLOW_MODULE_LOADING=0,g" /etc/default/pulseaudio
fi
Set up the PulseAudio daemon for network connections
# allow other clients on the network to connect to pulseaudio daemon ( only add auth-anonymous=1 if you know EVERY machine on your LAN ... this could be a security risk otherwise )
sudo \cp -fvp /etc/pulse/system.pa /etc/pulse/system.pa.ORIG
echo "
# ScarlettPi ADDED THIS
load-module module-native-protocol-tcp auth-ip-acl=127.0.0.1;192.168.0.0/24 auth-anonymous=1
load-module module-zeroconf-publish" | sudo tee -a /etc/pulse/system.pa
echo "
# ScarlettPi added this
#load-module module-native-protocol-tcp
#load-module module-zeroconf-publish
load-module module-native-protocol-tcp auth-ip-acl=127.0.0.1;192.168.0.0/24 auth-anonymous=1
load-module module-zeroconf-publish" | sudo tee -a /etc/pulse/default.pa
# check to make sure it looks okay
cat /etc/pulse/default.pa
Change default sound driver from alsa to pulseaudio
sudo \cp -fvp /etc/libao.conf /etc/libao.conf.ORIG
sudo sed -i "s,default_driver=alsa,default_driver=pulse,g" /etc/libao.conf
# daemon settings according to Pi-Musicbox ( https://github.com/woutervanwijk/Pi-MusicBox )
sudo \cp -fvp /etc/pulse/daemon.conf /etc/pulse/daemon.conf.ORIG
echo "
# ScarlettPi added this
high-priority = yes
nice-level = 5
exit-idle-time = -1
resample-method = src-sinc-medium-quality
default-sample-format = s16le
default-sample-rate = 48000
default-sample-channels = 2" | sudo tee -a /etc/pulse/daemon.conf
Add pi user to the pulse access group
sudo adduser pi pulse-access
# shut down the machine to make sure all the settings we just made are loaded correctly
sudo shutdown -r now
Make sure to add /usr/local/lib to library path
export LD_LIBRARY_PATH=/usr/local/lib
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
# also add these to your .bashrc so they get set once you login
echo "
# scarlettPi added this
export LD_LIBRARY_PATH=/usr/local/lib
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig" | tee -a ~/.bashrc
Install base PocketSphinx
# install python dev packages
sudo apt-get install python2.7-dev -y
# sphinxbase install ( required to install pocketsphinx )
sudo apt-get install bison -y
cd ~pi/
wget http://downloads.sourceforge.net/project/cmusphinx/sphinxbase/0.8/sphinxbase-0.8.tar.gz
tar -xvf sphinxbase-0.8.tar.gz
cd sphinxbase-0.8
./configure
make
sudo make install
cd -
# pocketsphinx install
# set this: LD_LIBRARY_PATH=/path/to/pocketsphinxlibs /usr/local/bin/pocketsphinx_continuous
# http://www.voxforge.org/home/forums/message-boards/speech-recognition-engines/howto-use-pocketsphinx
wget http://sourceforge.net/projects/cmusphinx/files/pocketsphinx/0.8/pocketsphinx-0.8.tar.gz
tar -xvf pocketsphinx-0.8.tar.gz
cd pocketsphinx-0.8
./configure
make
sudo make install
cd -
# install sphinxtrain
wget http://sourceforge.net/projects/cmusphinx/files/sphinxtrain/1.0.8/sphinxtrain-1.0.8.tar.gz
tar -xvf sphinxtrain-1.0.8
cd sphinxtrain-1.0.8
./configure
make
sudo make install
cd -
Check if pulse daemon is running
ps aux | grep pulse
# If it isn't, start it up yourself ( need to figure out the best way to make this run on boot...init.d script maybe? )
/usr/bin/pulseaudio --start --log-target=syslog --system=false
Finally, run Sphinx
IMPORTANT NOTE
YOU HAVE TO BE USER PI AND THE PULSEAUDIO SERVER NEEDS TO BE RUNNING
Assumimg existing corpus file, .jsgf file, .dic, and .lm files (using lmtool)
cd ~pi/pocketsphinx-0.8
pocketsphinx_continuous -lm /home/pi/scarlettPi/config/speech/lm/scarlett.lm -dict /home/pi/scarlettPi/config/speech/dict/scarlett.dic -hmm /home/pi/scarlettPi/config/speech/model/hmm/en_US/hub4wsj_sc_8k -silprob 0.1 -wip 1e-4 -bestpath 0
References:
Advice on how to calibrate pocketsphinx correctly
How to get pocketsphinx to recognize new words via a corpus
BEST/Simplest explanation of how Java Speech Grammar Format works
I plan on adding more details behind why I used certain setting, configurations in a blog post i'm writing on my home automation project, but figured, i'd share what i've done thus far incase someone else was stuck like me and would like to move forward with what they're working on. Hope this helps someone. Thanks for the advice guys.

apt-get remove pulseaudio -y
aptitude purge pulseaudio -y
If you don't know how to configure alsa, you should better use pulseaudio, moreover, it's configured on your system. You should better compile sphinxbase with pulseaudio support. For more information read the FAQ:
http://cmusphinx.sourceforge.net/wiki/faq#qfailed_to_open_audio_device_dev_dsp_no_such_file_or_directory
Mixer load failed: Invalid argument
This is a key message, it says that your alsa configuration doesn't support level mixer. If you don't know how to add mixer in alsa configuration, use pulseaudio
./configure --enable-fixed
This is a bad idea too which will reduce both speed and accuracy on your device. Your processor has FPU, so you shouldn't use fixed point mode.

i had the same problem of failing to open audio device.
http://cmusphinx.sourceforge.net/wiki/faq#qfailed_to_open_audio_device_dev_dsp_no_such_file_or_directory
I fix it buy installing libpulse-dev package then reinstall sphinxbase , pocketsphinx.

Related

How to fix No sound on Ubuntu 18.04? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 months ago.
Improve this question
1) I've been using Ubuntu 18.04 with Windows 10 dual boot for some months now. Today suddenly my sound stopped working on Ubunutu. Activities -> Sound menu shows only "Dummy Output". All fine on Windows though.
2) Output of lsmod is:
rohit#rohitUb18043LTS:~$ lsmod | grep snd_
snd_seq_midi 20480 0
snd_seq_midi_event 16384 1 snd_seq_midi
snd_seq 69632 2 snd_seq_midi,snd_seq_midi_event
snd_rawmidi 36864 1 snd_seq_midi
snd_seq_device 16384 3 snd_seq,snd_seq_midi,snd_rawmidi
snd_soc_dmic 16384 0
snd_hda_codec_realtek 118784 0
snd_hda_codec_generic 81920 1 snd_hda_codec_realtek
ledtrig_audio 16384 2 snd_hda_codec_generic,snd_hda_codec_realtek
snd_soc_hdac_hdmi 32768 0
snd_sof_intel_hda_common 73728 1 sof_pci_dev
snd_soc_hdac_hda 24576 1 snd_sof_intel_hda_common
snd_sof_intel_hda 20480 1 snd_sof_intel_hda_common
snd_sof_intel_byt 24576 1 sof_pci_dev
snd_sof_intel_ipc 20480 1 snd_sof_intel_byt
snd_sof 98304 4 snd_sof_intel_hda_common,snd_sof_intel_byt,snd_sof_intel_ipc,sof_pci_dev
snd_sof_xtensa_dsp 16384 1 sof_pci_dev
snd_hda_ext_core 28672 4 snd_sof_intel_hda_common,snd_soc_hdac_hdmi,snd_soc_hdac_hda,snd_sof_intel_hda
snd_soc_acpi_intel_match 32768 2 snd_sof_intel_hda_common,sof_pci_dev
snd_soc_acpi 16384 2 snd_soc_acpi_intel_match,sof_pci_dev
snd_soc_core 237568 5 snd_sof,snd_sof_intel_hda_common,snd_soc_hdac_hdmi,snd_soc_hdac_hda,snd_soc_dmic
snd_compress 24576 1 snd_soc_core
ac97_bus 16384 1 snd_soc_core
snd_pcm_dmaengine 16384 1 snd_soc_core
snd_hda_codec_hdmi 57344 1
snd_hda_intel 53248 2
snd_intel_nhlt 20480 1 snd_hda_intel
snd_hda_codec 131072 5 snd_hda_codec_generic,snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec_realtek,snd_soc_hdac_hda
snd_hda_core 90112 10 snd_hda_codec_generic,snd_hda_codec_hdmi,snd_hda_intel,snd_hda_ext_core,snd_hda_codec,snd_hda_codec_realtek,snd_sof_intel_hda_common,snd_soc_hdac_hdmi,snd_soc_hdac_hda,snd_sof_intel_hda
snd_hwdep 20480 1 snd_hda_codec
snd_pcm 102400 10 snd_hda_codec_hdmi,snd_hda_intel,snd_hda_ext_core,snd_hda_codec,snd_sof,snd_sof_intel_hda_common,snd_soc_hdac_hdmi,snd_soc_core,snd_hda_core,snd_pcm_dmaengine
snd_timer 36864 2 snd_seq,snd_pcm
snd 86016 17 snd_hda_codec_generic,snd_seq,snd_seq_device,snd_hda_codec_hdmi,snd_hwdep,snd_hda_intel,snd_hda_codec,snd_hda_codec_realtek,snd_timer,snd_compress,snd_soc_core,snd_pcm,snd_rawmidi
rohit#rohitUb18043LTS:~$
3) I installed all updates from Software updater but no luck.
4) No change by using: sudo alsa force-reload
5) Looking around, found this thread: https://askubuntu.com/questions/1059619/sound-card-shown-as-dummy-output-in-ubuntu-18-04 . User says found the "active profile was off" and links to a solution on this forum (https://forums.linuxmint.com/viewtopic.php?t=268499). I am pasting the output of the four commands as per that link:
rohit#rohitUb18043LTS:~$ sudo fuser -v /dev/snd/*
[sudo] password for rohit:
USER PID ACCESS COMMAND
/dev/snd/controlC0: gdm 1505 F.... pulseaudio
rohit 1878 F.... pulseaudio
rohit#rohitUb18043LTS:~$ pacmd list-cards
1 card(s) available.
index: 0
name: <alsa_card.pci-0000_01_00.1>
driver: <module-alsa-card.c>
owner module: 7
properties:
alsa.card = "0"
alsa.card_name = "HDA NVidia"
alsa.long_card_name = "HDA NVidia at 0xb4000000 irq 17"
alsa.driver_name = "snd_hda_intel"
device.bus_path = "pci-0000:01:00.1"
sysfs.path = "/devices/pci0000:00/0000:00:01.0/0000:01:00.1/sound/card0"
device.bus = "pci"
device.vendor.id = "10de"
device.vendor.name = "NVIDIA Corporation"
device.product.id = "0fb9"
device.product.name = "GP107GL High Definition Audio Controller"
device.string = "0"
device.description = "GP107GL High Definition Audio Controller"
module-udev-detect.discovered = "1"
device.icon_name = "audio-card-pci"
profiles:
output:hdmi-stereo: Digital Stereo (HDMI) Output (priority 5400, available: no)
output:hdmi-surround: Digital Surround 5.1 (HDMI) Output (priority 300, available: no)
output:hdmi-surround71: Digital Surround 7.1 (HDMI) Output (priority 300, available: no)
off: Off (priority 0, available: unknown)
active profile: <off>
ports:
hdmi-output-0: HDMI / DisplayPort (priority 5900, latency offset 0 usec, available: no)
properties:
device.icon_name = "video-display"
rohit#rohitUb18043LTS:~$ pacmd list-sinks
1 sink(s) available.
* index: 0
name: <auto_null>
driver: <module-null-sink.c>
flags: DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
state: SUSPENDED
suspend cause: IDLE
priority: 1000
volume: front-left: 65536 / 100% / 0,00 dB, front-right: 65536 / 100% / 0,00 dB
balance 0,00
base volume: 65536 / 100% / 0,00 dB
volume steps: 65537
muted: no
current latency: 0,00 ms
max request: 344 KiB
max rewind: 344 KiB
monitor source: 0
sample spec: s16le 2ch 44100Hz
channel map: front-left,front-right
Stereo
used by: 0
linked by: 0
configured latency: 0,00 ms; range is 0,50 .. 2000,00 ms
module: 15
properties:
device.description = "Dummy Output"
device.class = "abstract"
device.icon_name = "audio-card"
rohit#rohitUb18043LTS:~$ pacmd list-sink-inputs
0 sink input(s) available.
rohit#rohitUb18043LTS:~$
6) I tried the suggested command but it says "No such profile".
rohit#rohitUb18043LTS:~$ pacmd set-card-profile alsa_card.pci-0000_01_00.1 output:analog-stereo+input:analog-stereo
No such profile: output:analog-stereo+input:analog-stereo
rohit#rohitUb18043LTS:~$
Please help - how do I proceed?
Similar issue with "Dummy Sound" on Ubuntu 18.04 also with a NVIDIA card. This solved it for me:
Edit /etc/modprobe.d/alsa-base.conf as root and add options snd-hda-intel dmic_detect=0
Edit /etc/modprobe.d/blacklist.conf as root and add blacklist snd_soc_skl at the end of the file.
After making these changes, reboot your system.
More details (and credits): https://www.linuxuprising.com/2018/06/fix-no-sound-dummy-output-issue-in.html
I had the same problem, and tried the solution given by #maartenor without success.
Eventually I got the sound back by upgrading linux kernel to the last HWE stack, for me it was 4.15.0-106-generic to 5.3.0-59-generic.
The command to do this :
$ sudo apt install linux-generic-hwe-18.04
Edit the file /etc/modprobe.d/alsa-base.conf and add the following lines:
options snd-hda-intel dmic_detect=0
options snd-hda-intel model=laptop-amic enable=yes
The first line is to enable the speaker, the second for the internal microphone.
Good luck!
Got this answer from Reddit. Worked like a charm for me!
Link : https://www.reddit.com/r/linuxmint/comments/fltlrl/no_sound_on_acer_swift_3_with_kernel_53/
Try this..
Open your terminal
sudo apt update && sudo apt install alsamixer
run alsamixer in your terminal.
press arrow right til you go to sound option (if headphone go to HEADPHONES bar).
press M to unmute.
press up/down to adjust the volume.
press Esc to exit alsamixer.
Following steps worked very reliably. It does not fix the audio-losing-after-suspend issue permanently, but instantly as a command to run after back from suspend.
Use lspci to get the audio card location (0000:00:1f.3). On my machine,
$ lspci
00:1f.0 ISA bridge: Intel Corporation H110 ...
00:1f.2 Memory controller: Intel ...
00:1f.3 Audio device: Intel Corporation 100 Series/C230 Series Chipset ...
00:1f.4 SMBus: Intel Corporation 100 Series/C230 Series Chipset ...
Then, (make sure the directories below exist)
$ echo 1 | sudo tee /sys/bus/pci/devices/0000:00:1f.3/remove
$ echo 1 | sudo tee /sys/bus/pci/rescan
I believe the audio driver/hardware is stuck. So we remove the device driver, and rescan the PCI bus to get audio back.
i found answer above not work on my computer, and i solve this problem by accidient , this is script i use , most same as answer above, but at last, u need mute then unmute auidio. sleep a short moment after command is necessary here if you put script in sh file then excute it , use sh -c is for file redirection for root
REST=0.5
#make sure Audio always actived
sudo sh -c 'echo 1 >/sys/bus/pci/rescan'
sleep $REST
DEVICE_ID=$(lspci -D | grep Audio | awk '{print $1}')
sleep $REST
sudo sh -c 'echo 1 >/sys/bus/pci/devices/0000:00:1f.3/remove'
sleep $REST
sudo sh -c 'echo 1 >/sys/bus/pci/rescan'
sleep $REST
#mute then unmute to restart audio
amixer -D pulse sset Master mute
sleep $REST
amixer -D pulse sset Master unmute

Pulseaudio set/check default source

So the question is,
How can I set the default source?
How can I list the current default source?
Details
I have 4 sound input sources on my linux device. Here is the result of pactl list sources:
1 alsa_input.pci-0000_00_1b.0.analog-stereo module-alsa-card.c s16le 2ch 44100Hz SUSPENDED
2 alsa_input.usb-Generic_Rmoncam_HD_720P_200901010001-02.analog-stereo module-alsa-card.c s16le 2ch 48000Hz SUSPENDED
3 alsa_input.usb-Generic_Rmoncam_HD_720P_200901010001-02.analog-stereo.2 module-alsa-card.c s16le 2ch 48000Hz SUSPENDED
5 alsa_output.pci-0000_00_1b.0.hdmi-stereo.monitor module-alsa-card.c s16le 2ch 44100Hz SUSPENDED
I tried to set the source 1 alsa_input.pci-0000_00_1b.0.analog-stereo as my default source by several ways:
1.change /etc/pulse/client.conf, add following lines:
default-sink = alsa_output.pci-0000_00_1b.0.hdmi-stereo
default-source = alsa_input.pci-0000_00_1b.0.analog-stereo
2.change /etc/pulse/default.pa, add following lines:
### Make some devices default
set-default-source alsa_input.pci-0000_00_1b.0.analog-stereo
After configuration complete, I tried pulseaudio -D and reboot the device, but the config take no effect. I don't know how to list the current default source and sink, so I use following command to verify:
$> pactl load-module module-loopback latency_msec=500
$> pactl list sources short | grep RUNNING
3 alsa_input.usb-Generic_Rmoncam_HD_720P_200901010001-02.analog-stereo.2 module-alsa-card.c s16le 2ch 48000Hz RUNNING
The pactl still use my usb camera's microphone as its default source.
System Info
Linux kernel:
Linux D2-A109 4.15.0-55-generic #60-Ubuntu SMP Tue Jul 2 18:22:20 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
PulseAudio version:
$> pulseaudio --version
11.1
Any advice is welcome!
Finally..I find it's just caused by the microphone "unplugged"... And the way to set the default source is correct.
And I find the answer of Q2."How can I list the current default source?":
$> pacmd list-sources | grep -e 'index:' -e device.string -e 'name:' -e 'available'
* index: 1
name: <alsa_input.pci-0000_00_1b.0.analog-stereo>
device.string = "front:0"
analog-input-front-mic: Front Microphone (priority 8500, latency offset 0 usec, available: no)
analog-input-rear-mic: Rear Microphone (priority 8200, latency offset 0 usec, available: yes)
analog-input-linein: Line In (priority 8100, latency offset 0 usec, available: no)
index: 2
name: <alsa_input.usb-Generic_Rmoncam_HD_720P_200901010001-02.analog-stereo>
device.string = "plug:front:1"
analog-input-mic: Microphone (priority 8700, latency offset 0 usec, available: unknown)
index: 3
name: <alsa_input.usb-Generic_Rmoncam_HD_720P_200901010001-02.analog-stereo.2>
device.string = "plug:front:2"
analog-input-mic: Microphone (priority 8700, latency offset 0 usec, available: unknown)
index: 7
name: <alsa_output.pci-0000_00_1b.0.hdmi-stereo.monitor>
device.string = "0"
Corresponding to PulseAudio wiki, The * in front of the index indicates the current default input.
To avoid someone being stupit as me, we can determine if the microphone(source) is plugged, by checking 'available' in the printing result of sources.
How can I list the current default source?
With pulseaudio 15.0 you can now just run pactl get-default-source to get the device string without resorting to running sed/awk/grep etc on the output.

Debian 9 Dummy Output after resume from suspend (snd_hda_intel codec)

I have an external monitor that I plug-in my Dell laptop after turn it on. The sound works before and after plug it in the Laptop, So the headphone works too, plugin it in and out too. The problem is when I resume Debian after suspend. The sound has gone, and some times when increasing and decreasing volume one of the three options appears in the screen: Headphone unplugged, HDMI output (or something like), or Dummy Output.
I will show now what happens when Dummy Output is displayed and some outputs of commands.
$ lspci | grep Audio
Output:
00:1f.3 Audio device: Intel Corporation Sunrise Point-LP HD Audio (rev 21)
$ lsmod | grep hda
Output:
snd_hda_ext_core 28672 1 snd_soc_skl
snd_hda_intel 36864 0
snd_hda_codec 135168 1 snd_hda_intel
snd_hda_core 90112 4 snd_hda_intel,snd_hda_codec,snd_hda_ext_core,snd_soc_skl
snd_hwdep 16384 1 snd_hda_codec
snd_pcm 110592 6 snd_hda_intel,snd_hda_codec,snd_hda_ext_core,snd_hda_core,snd_soc_skl,snd_soc_core
snd 86016 7 snd_compress,snd_hda_intel,snd_hwdep,snd_hda_codec,snd_timer,snd_soc_core,snd_pcm
$ sudo dmesg | grep snd
Output (when rebooting):
[ 13.341580] snd_hda_intel 0000:00:1f.3: bound 0000:00:02.0 (ops i915_audio_component_bind_ops [i915])
[ 13.461226] snd_hda_intel 0000:00:1f.3: CORB reset timeout#1, CORBRP = 0
[ 13.462799] snd_hda_intel 0000:00:1f.3: no codecs found!
$ sudo alsactl init
Output:
alsactl: init:1757: No soundcards found...
Complete Alsa Information script:
https://alsa-project.org/db/?f=ff03c7d8dac369fc1211822de963b337c132420c
So it looks like the sound card is there but alsa does not recognize it.
Many forums/sites recommend to blacklist snd_hda_codec_hdmi (that would be the case when the problem is with connecting/desconnecting HDMI for the external monitor), and also put a line:
options snd-hda-intel model=generic
in a file, e.g., /etc/modprobe.d/alsa-base-blacklist.conf.
But it didn't work.
Other sites suggest to disable and enable sound in BIOS. Didn't work.
Can anyone help me solve this forever issue?

How do I configure JACK audio server to automatically use a specific card?

I'm running Ubuntu 12.04 studio on a HP Pavilion dm1 4200sg netbook. It's pretty much a fresh install. I try to start jackd server by running
jackd -R -d alsa
and it fails with output:
JACK server starting in realtime mode with priority 10
control device hw:0
control device hw:0
audio_reservation_init
Acquire audio card Audio0
creating alsa driver ... hw:0|hw:0|1024|2|48000|0|0|nomon|swmeter|-|32bit
control device hw:0
ALSA: Cannot open PCM device alsa_pcm for playback. Falling back to capture-only mode
Cannot initialize driver
JackServer::Open() failed with -1
Failed to open server
Running aplay -l gives the following output:
**** List of PLAYBACK Hardware Devices ****
card 0: Generic [HD-Audio Generic], device 3: HDMI 0 [HDMI 0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: SB [HDA ATI SB], device 0: STAC92xx Analog [STAC92xx Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
I find that by running
jackd -R -d alsa -d hw:1
jackd starts successfully. I would like to configure my machine so that hw:1 is the default option (i.e. to make the original 'jackd -R -d alsa' command work). Can anyone help me to do this?
I've tried editing ~/.asoundrc to be
pcm.!default {
type hw
card 1
}
ctl.!default {
type hw
card 1
}
but this doesn't seem to work. I'm well out of my comfort zone here and any help would be appreciated. Thanks!
I've found a workaround. It doesn't configure JACK server but alters the order the sound cards are listed.
I first entered into the terminal:
sudo lshw -c multimedia
which showed which modules the two cards were using. They were both using 'snd-hda-intel'.
I then entered into the terminal:
cat /proc/asound/card0/id
cat /proc/asound/card1/id
Which gave ids 'Generic' and 'SB' for cards 0 and 1, respectively.
I then added the following two lines to the end of the file '/etc/modprobe.d/alsa-base.conf'
options snd-hda-intel id=SB index=0
options snd-hda-intel id=Generic index=1
After rebooting the machine, card 'SB' was loaded into position 0 and
jackd -R -d alsa
correctly started.
First, in a terminal window, run this command:
cat /proc/asound/cards.
You’ll see output a bit like this:
0 [SB ]: HDA-Intel - HDA ATI SB
HDA ATI SB at 0xfcef8000 irq 16
1 [DSP ]: H-DSP - Hammerfall DSP
RME Hammerfall DSP + Digiface at 0xfcff0000, irq 20
2 [NVidia ]: HDA-Intel - HDA NVidia
HDA NVidia at 0xfe57c000 irq 32
The “name” of each soundcard is in square brackets.
With this information, you can now refer to a particular device as, for example hw:DSP now you can execute the command:
jackd -d alsa -d hw:DSP
And thats all, taken from:
http://www.jackaudio.org/faq/device_naming.html
EDIT: added code tags
First, open up alsa-base.conf:
sudo gedit /etc/modprobe.d/alsa-base.conf
Find the following line:
"options snd-hda-intel index=-2"
And change it to:
"#options snd-hda-intel index=-2"
Restart your machine and try again. You may have to set the proper sound device (alsa) for your programs.

AVR ISP MKII, avrdude, Ubuntu 11.10

So, I have had this working on Ubuntu before. But then I upgraded to 11.10. Now, no such luck.
Note: if you are still messing with getting this to work on eclipse, you might want to try this command line stuff... if it doesnt work here, its not going to work in eclipse.
I have this error:
avrdude: stk500v2_command(): command failed
avrdude: stk500v2_command(): unknown status 0xc9
avrdude: stk500v2_program_enable(): cannot get connection status
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.
I have tried with all different configurations.
ie: -B 1 ,10, 1000,
-F doesn't help becuase then you just get back 000000 or whatever as your serial.
Also, I should mention, clearly from the output below, you can see that it gets to the programmer and even to the target board and reads its voltage out.
You can also see the target chip reset. (ie: i have tested on a number of devices includeing a DB101 and you can see when it resets)
The full output is like this:
> avrdude -c avrispmkII -P usb -p m1281 -B 100 -v
avrdude: Version 5.10, compiled on Jun 29 2010 at 03:44:14
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2009 Joerg Wunsch
System wide configuration file is "/etc/avrdude.conf"
User configuration file is "/home/david/.avrduderc"
User configuration file does not exist or is not a regular file, skipping
Using Port : usb
Using Programmer : avrispmkII
Setting bit clk period : 100.0
avrdude: usbdev_open(): Found AVRISP mkII, serno: 000200037289
AVR Part : ATMEGA1281
Chip Erase delay : 9000 us
PAGEL : PD7
BS2 : PA0
RESET disposition : dedicated
RETRY pulse : SCK
serial program mode : yes
parallel program mode : yes
Timeout : 200
StabDelay : 100
CmdexeDelay : 25
SyncLoops : 32
ByteDelay : 0
PollIndex : 3
PollValue : 0x53
Memory Detail :
Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
eeprom 65 10 8 0 no 4096 8 0 9000 9000 0x00 0x00
flash 65 10 256 0 yes 131072 256 512 4500 4500 0x00 0x00
lfuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
hfuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
efuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
lock 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
calibration 0 0 0 0 no 1 0 0 0 0 0x00 0x00
signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00
Programmer Type : STK500V2
Description : Atmel AVR ISP mkII
Programmer Model: AVRISP mkII
Hardware Version: 1
Firmware Version Master : 1.13
Vtarget : 5.1 V
SCK period : 100.37 us
avrdude: stk500v2_command(): command failed
avrdude: stk500v2_command(): unknown status 0xc9
avrdude: stk500v2_program_enable(): cannot get connection status
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.
avrdude done. Thank you.
I already have the udev stuff set up:
ie:
cat /etc/udev/rules.d/60-avrisp.rules
SUBSYSTEM!="usb_device", ACTION!="add", GOTO="avrisp_end"
# Atmel Corp. JTAG ICE mkII
ATTR{idVendor}=="03eb", SYSFS{idProduct}=="2103", MODE="660", GROUP="dialout"
# Atmel Corp. AVRISP mkII
ATTR{idVendor}=="03eb", SYSFS{idProduct}=="2104", MODE="660", GROUP="dialout"
# Atmel Corp. Dragon
ATTR{idVendor}=="03eb", SYSFS{idProduct}=="2107", MODE="660", GROUP="dialout"
LABEL="avrisp_end"
The board AND the programmer work with AVR studio on another machine.
Apparently a lot of people have this issue on Linux. :(
Dont really want to have to dig up a winblows box.
I had a really hard time getting mine to work as well. In the end, I tripped over http://wiki.dataflow.ws/Electronix/AvrIsp2OnOSX and found that I had actually missed a package. After installing uisp
sudo apt-get install uisp
I ran
sudo avrdude -c avrispmkII -p m168 -P usb: -B 8 -v -U lock:w:0x3f:m -U lfuse:w:0xff:m -U hfuse:w:0xdf:m -U efuse:w:0x0:m
And got a nice pretty green LED.
Just for the record (same error message) and because I also spent some time fiddling with my AVR ISP MKII:
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.
It did work OK for me only after adjusting the timing using the -B parameter! Looks like even a current mini PC is just too fast.
Avrdude now works for me reliably under straight Debian 7. Also, it works under Windows 8 with WinAVR driver installed, then VirtualBox VM running a Debian 7 non-UI installation, after passing through the AVRISP to the VM in VirtualBox.
avrdude -c avrispmkII -P usb -p t13 -B 10 -v
...

Resources