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

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

Related

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?

tinkerboard android - /sys/class/thermal/thermal_zone1/temp: No such file or directory

I am using a tinkerboard with an android + chroot linux. When I try to read temperature by the following command:
cat /sys/class/thermal/thermal_zone1/temp
I get the following error :
cat: /sys/class/thermal/thermal_zone1/temp: No such file or directory
If I run the tinkerboard directly with a linux distribution rather than android I am able to read the temperature by the above command.
The tinkerboard uses the RK3288 cpu which has a TS-ADC temperature sensor.
Any suggestions?
lsmod - linux:
Module Size Used by
fuse 94208 3
snd_soc_hdmi_codec 16384 1
mali_kbase 335872 0
dw_hdmi_i2s_audio 16384 0
rk_crypto 24576 0
dw_wdt 16384 0
syscon_reboot_mode 16384 0
reboot_mode 16384 1 syscon_reboot_mode
r8723bs 544768 0
zram 20480 5
ip_tables 20480 0
autofs4 28672 0
lsmod - android ( linux chroot ):
Module Size Used by
After some research by my colleague:
The kernel was missing the required drivers. Fortunately the newest updates to the kernel included the thermal sensor. It now works.

Re-scan LUN on Linux

We have expend existing LUN size on EMC Storage and now i want to re-scan on Host side but i don't know how to figure out SCSI ID of that specific LUN. I am new to storage.. This is what i am doing but don't know whether it is a right way or not
Pseudo name=emcpowerj
CLARiiON ID=APM00112500570 [Oracle_Cluster]
Logical device ID=200601602E002900B6BCA114C9F8E011 [LUN01]
state=alive; policy=CLAROpt; priority=0; queued-IOs=0;
Owner: default=SP A, current=SP A Array failover mode: 1
==============================================================================
--------------- Host --------------- - Stor - -- I/O Path -- -- Stats ---
### HW Path I/O Paths Interf. Mode State Q-IOs Errors
==============================================================================
2 qla2xxx sdaj SP A1 active alive 0 1
2 qla2xxx sdaw SP B1 active alive 0 4
1 qla2xxx sdj SP A0 active alive 0 1
1 qla2xxx sdw SP B0 active alive 0 4
Here i am running find command on sdX device to find out SCSI ID to i can do echo 1 > /sys/bus/scsi/drivers/X:X:X:X/rescan to do re-scan LUN
$ find /sys/devices -name "*block*" | grep -e "sdaj" -e "sdaw" -e "sdj" -e "sdw"
/sys/devices/pci0000:00/0000:00:09.0/0000:05:00.1/host2/rport-2:0-1/target2:0:1/**2:0:1:8**/block:sdaw
/sys/devices/pci0000:00/0000:00:09.0/0000:05:00.1/host2/rport-2:0-0/target2:0:0/**2:0:0:8**/block:sdaj
/sys/devices/pci0000:00/0000:00:09.0/0000:05:00.0/host1/rport-1:0-1/target1:0:1/**1:0:1:8**/block:sdw
/sys/devices/pci0000:00/0000:00:09.0/0000:05:00.0/host1/rport-1:0-0/target1:0:0/**1:0:0:8**/block:sdj
or there is a alternative or other way to scan LUN?
I like to use the "lsscsi" program, which is probably available for your distribution.
% lsscsi
[0:0:0:0] cd/dvd NECVMWar VMware IDE CDR00 1.00 /dev/sr0
[2:0:0:0] disk VMware, VMware Virtual S 1.0 /dev/sda
[2:0:1:0] disk VMware, VMware Virtual S 1.0 /dev/sdb
As for rescanning the bus, that's pretty much it.

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

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.

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