Get multiple lines from terminal output - linux

I want to extract the ports for each device on the below:
index: 0
name: <alsa_output.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFi__hw_sofhdadsp_5__sink>
driver: <module-alsa-card.c>
flags: HARDWARE DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
state: SUSPENDED
suspend cause: IDLE
priority: 9037
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: 0 KiB
max rewind: 0 KiB
monitor source: 0
sample spec: s16le 2ch 48000Hz
channel map: front-left,front-right
Stereo
used by: 0
linked by: 0
configured latency: 0,00 ms; range is 0,50 .. 341,00 ms
card: 0 <alsa_card.pci-0000_00_1f.3-platform-skl_hda_dsp_generic>
module: 7
properties:
alsa.resolution_bits = "16"
device.api = "alsa"
device.class = "sound"
alsa.class = "generic"
alsa.subclass = "generic-mix"
alsa.name = ""
alsa.id = "HDMI3 (*)"
alsa.subdevice = "0"
alsa.subdevice_name = "subdevice #0"
alsa.device = "5"
alsa.card = "0"
alsa.card_name = "sof-hda-dsp"
alsa.long_card_name = "DellInc.-Inspiron5490--0YMVR1"
alsa.driver_name = "snd_soc_skl_hda_dsp"
device.bus_path = "pci-0000:00:1f.3-platform-skl_hda_dsp_generic"
sysfs.path = "/devices/pci0000:00/0000:00:1f.3/skl_hda_dsp_generic/sound/card0"
device.bus = "pci"
device.vendor.id = "8086"
device.vendor.name = "Intel Corporation"
device.product.id = "02c8"
device.string = "hw:sofhdadsp,5"
device.buffering.buffer_size = "65472"
device.buffering.fragment_size = "16320"
device.access_mode = "mmap+timer"
device.profile.name = "HiFi: hw:sofhdadsp,5: sink"
device.profile.description = "HDMI3/DP3 Output"
alsa.mixer_device = "hw:sofhdadsp"
device.description = "sof-hda-dsp HDMI3/DP3 Output"
module-udev-detect.discovered = "1"
device.icon_name = "audio-card-pci"
ports:
[Out] HDMI3: HDMI3/DP3 Output (priority 700, latency offset 0 usec, available: no)
properties:
active port: <[Out] HDMI3>
index: 1
name: <alsa_output.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFi__hw_sofhdadsp_4__sink>
driver: <module-alsa-card.c>
flags: HARDWARE DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
state: SUSPENDED
suspend cause: IDLE
priority: 9036
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: 0 KiB
max rewind: 0 KiB
monitor source: 1
sample spec: s16le 2ch 48000Hz
channel map: front-left,front-right
Stereo
used by: 0
linked by: 0
configured latency: 0,00 ms; range is 0,50 .. 341,00 ms
card: 0 <alsa_card.pci-0000_00_1f.3-platform-skl_hda_dsp_generic>
module: 7
properties:
alsa.resolution_bits = "16"
device.api = "alsa"
device.class = "sound"
alsa.class = "generic"
alsa.subclass = "generic-mix"
alsa.name = ""
alsa.id = "HDMI2 (*)"
alsa.subdevice = "0"
alsa.subdevice_name = "subdevice #0"
alsa.device = "4"
alsa.card = "0"
alsa.card_name = "sof-hda-dsp"
alsa.long_card_name = "DellInc.-Inspiron5490--0YMVR1"
alsa.driver_name = "snd_soc_skl_hda_dsp"
device.bus_path = "pci-0000:00:1f.3-platform-skl_hda_dsp_generic"
sysfs.path = "/devices/pci0000:00/0000:00:1f.3/skl_hda_dsp_generic/sound/card0"
device.bus = "pci"
device.vendor.id = "8086"
device.vendor.name = "Intel Corporation"
device.product.id = "02c8"
device.string = "hw:sofhdadsp,4"
device.buffering.buffer_size = "65472"
device.buffering.fragment_size = "16320"
device.access_mode = "mmap+timer"
device.profile.name = "HiFi: hw:sofhdadsp,4: sink"
device.profile.description = "HDMI2/DP2 Output"
alsa.mixer_device = "hw:sofhdadsp"
device.description = "sof-hda-dsp HDMI2/DP2 Output"
module-udev-detect.discovered = "1"
device.icon_name = "audio-card-pci"
ports:
[Out] HDMI2: HDMI2/DP2 Output (priority 600, latency offset 0 usec, available: no)
properties:
active port: <[Out] HDMI2>
index: 2
name: <alsa_output.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFi__hw_sofhdadsp_3__sink>
driver: <module-alsa-card.c>
flags: HARDWARE DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
state: SUSPENDED
suspend cause: IDLE
priority: 9035
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: 0 KiB
max rewind: 0 KiB
monitor source: 2
sample spec: s16le 2ch 48000Hz
channel map: front-left,front-right
Stereo
used by: 0
linked by: 0
configured latency: 0,00 ms; range is 0,50 .. 341,00 ms
card: 0 <alsa_card.pci-0000_00_1f.3-platform-skl_hda_dsp_generic>
module: 7
properties:
alsa.resolution_bits = "16"
device.api = "alsa"
device.class = "sound"
alsa.class = "generic"
alsa.subclass = "generic-mix"
alsa.name = ""
alsa.id = "HDMI1 (*)"
alsa.subdevice = "0"
alsa.subdevice_name = "subdevice #0"
alsa.device = "3"
alsa.card = "0"
alsa.card_name = "sof-hda-dsp"
alsa.long_card_name = "DellInc.-Inspiron5490--0YMVR1"
alsa.driver_name = "snd_soc_skl_hda_dsp"
device.bus_path = "pci-0000:00:1f.3-platform-skl_hda_dsp_generic"
sysfs.path = "/devices/pci0000:00/0000:00:1f.3/skl_hda_dsp_generic/sound/card0"
device.bus = "pci"
device.vendor.id = "8086"
device.vendor.name = "Intel Corporation"
device.product.id = "02c8"
device.string = "hw:sofhdadsp,3"
device.buffering.buffer_size = "65472"
device.buffering.fragment_size = "16320"
device.access_mode = "mmap+timer"
device.profile.name = "HiFi: hw:sofhdadsp,3: sink"
device.profile.description = "HDMI1/DP1 Output"
alsa.mixer_device = "hw:sofhdadsp"
device.description = "sof-hda-dsp HDMI1/DP1 Output"
module-udev-detect.discovered = "1"
device.icon_name = "audio-card-pci"
ports:
[Out] HDMI1: HDMI1/DP1 Output (priority 500, latency offset 0 usec, available: yes)
properties:
device.product.name = "2460G5"
active port: <[Out] HDMI1>
* index: 3
name: <alsa_output.pci-0000_00_1f.3-platform-skl_hda_dsp_generic.HiFi__hw_sofhdadsp__sink>
driver: <module-alsa-card.c>
flags: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
state: RUNNING
suspend cause: (none)
priority: 9032
volume: front-left: 56752 / 87% / -3,75 dB, front-right: 56752 / 87% / -3,75 dB
balance 0,00
base volume: 65536 / 100% / 0,00 dB
volume steps: 65537
muted: no
current latency: 19,83 ms
max request: 4 KiB
max rewind: 4 KiB
monitor source: 3
sample spec: s16le 2ch 48000Hz
channel map: front-left,front-right
Stereo
used by: 1
linked by: 1
configured latency: 23,22 ms; range is 0,50 .. 341,00 ms
card: 0 <alsa_card.pci-0000_00_1f.3-platform-skl_hda_dsp_generic>
module: 7
properties:
alsa.resolution_bits = "16"
device.api = "alsa"
device.class = "sound"
alsa.class = "generic"
alsa.subclass = "generic-mix"
alsa.name = ""
alsa.id = "HDA Analog (*)"
alsa.subdevice = "0"
alsa.subdevice_name = "subdevice #0"
alsa.device = "0"
alsa.card = "0"
alsa.card_name = "sof-hda-dsp"
alsa.long_card_name = "DellInc.-Inspiron5490--0YMVR1"
alsa.driver_name = "snd_soc_skl_hda_dsp"
device.bus_path = "pci-0000:00:1f.3-platform-skl_hda_dsp_generic"
sysfs.path = "/devices/pci0000:00/0000:00:1f.3/skl_hda_dsp_generic/sound/card0"
device.bus = "pci"
device.vendor.id = "8086"
device.vendor.name = "Intel Corporation"
device.product.id = "02c8"
device.string = "hw:sofhdadsp"
device.buffering.buffer_size = "65472"
device.buffering.fragment_size = "16320"
device.access_mode = "mmap+timer"
device.profile.name = "HiFi: hw:sofhdadsp: sink"
device.profile.description = "Speaker + Headphones"
alsa.mixer_device = "hw:sofhdadsp"
device.description = "sof-hda-dsp Speaker + Headphones"
module-udev-detect.discovered = "1"
device.icon_name = "audio-card-pci"
ports:
[Out] Speaker: Speaker (priority 100, latency offset 0 usec, available: unknown)
properties:
[Out] Headphones: Headphones (priority 200, latency offset 0 usec, available: yes)
properties:
active port: <[Out] Headphones>
I can get each device index with:
pacmd list-sinks | awk '/index:/ {print $0}
or with:
pacmd list-sinks | grep -e index
which results in:
index: 0
index: 1
index: 2
* index: 3
How can I go beyond that and compose commands to extract something like the lines bellow?
index: 0
ports:
[Out] HDMI3: HDMI3/DP3 Output (priority 700, latency offset 0 usec, available: no)
index: 1
ports:
[Out] HDMI2: HDMI2/DP2 Output (priority 600, latency offset 0 usec, available: no)
index: 2
ports:
[Out] HDMI1: HDMI1/DP1 Output (priority 500, latency offset 0 usec, available: yes)
* index: 3
ports:
[Out] Speaker: Speaker (priority 100, latency offset 0 usec, available: unknown)
[Out] Headphones: Headphones (priority 200, latency offset 0 usec, available: yes)

pacmd list-sinks | awk '/index/ { print } /active port:/ { pnt=0 } /ports:/ { print;pnt=1 } pnt==1 && /\[Out\]/ { print }'
Print the index line, then when we see "ports:", set a variable pnt to 1, print the line and skip to the next line. When pnt is equal to one and the line contains "[Out]", print the line. When we see "active port:" reset the pnt variable back to 0.

Related

How to simulate aging effect on back to back inverters in HSPICE

I am trying to simulate the effect of aging in the back-to-back inverters (SRAM PUF). I want to see the starting up of the back-to-back inverter's start-up voltage with transistor aging effect, wherein in one case the output initial from the 2 inverters is 1 0 and in another case, the output case will be 0 1.
How to do this in hspice. I know a little about the MOSRA test, but I am not sure how to use that to get the intended aging effect.
I have written a back-to-back inverter hspice netlist. but the output is always same with the simulation. How to flip the output with aging simulation. Any help is appreciated.
* PUF
vdd vdd gnd dc 1v
Mp1 out2 out1 vdd vdd pmos w= 90nm l= 45nm
Mn1 out2 out gnd gnd nmos w=45nm l= 45nm
Mp2 out1 out2 vdd vdd pmos w= 90nm l= 45nm
Mn2 out1 out2 gnd gnd nmos w=45nm l= 45nm
*transient analysis
.model p1_ra mosra level=1
+tit0 = 5e-8 titfd = 7.5e-10 tittd = 1.45e-20
+tn = 0.25
.appendmodel p1_ra mosra p1 pmos
.mosra reltotaltime= 1e8
.tran .1ps 5ns
.options post
.print V(out2) V(out1)
* PTM Low Power 45nm Metal Gate / High-K / Strained-Si
* nominal Vdd = 1.1V
.model nmos nmos level = 54
+version = 4.0 binunit = 1 paramchk= 1 mobmod = 0
+capmod = 2 igcmod = 1 igbmod = 1 geomod = 1
+diomod = 1 rdsmod = 0 rbodymod= 1 rgatemod= 1
+permod = 1 acnqsmod= 0 trnqsmod= 0
+tnom = 27 toxe = 1.8e-009 toxp = 1.5e-009 toxm = 1.8e-009
+dtox = 3e-010 epsrox = 3.9 wint = 5e-009 lint = 0
+ll = 0 wl = 0 lln = 1 wln = 1
+lw = 0 ww = 0 lwn = 1 wwn = 1
+lwl = 0 wwl = 0 xpart = 0 toxref = 1.8e-009
+vth0 = 0.62261 k1 = 0.4 k2 = 0 k3 = 0
+k3b = 0 w0 = 2.5e-006 dvt0 = 1 dvt1 = 2
+dvt2 = 0 dvt0w = 0 dvt1w = 0 dvt2w = 0
+dsub = 0.1 minv = 0.05 voffl = 0 dvtp0 = 1e-010
+dvtp1 = 0.1 lpe0 = 0 lpeb = 0 xj = 1.4e-008
+ngate = 1e+023 ndep = 3.24e+018 nsd = 2e+020 phin = 0
+cdsc = 0 cdscb = 0 cdscd = 0 cit = 0
+voff = -0.13 nfactor = 1.6 eta0 = 0.0125 etab = 0
+vfb = -0.55 u0 = 0.049 ua = 6e-010 ub = 1.2e-018
+uc = 0 vsat = 130000 a0 = 1 ags = 0
+a1 = 0 a2 = 1 b0 = 0 b1 = 0
+keta = 0.04 dwg = 0 dwb = 0 pclm = 0.02
+pdiblc1 = 0.001 pdiblc2 = 0.001 pdiblcb = -0.005 drout = 0.5
+pvag = 1e-020 delta = 0.01 pscbe1 = 8.14e+008 pscbe2 = 1e-007
+fprout = 0.2 pdits = 0.08 pditsd = 0.23 pditsl = 2300000
+rsh = 5 rdsw = 210 rsw = 80 rdw = 80
+rdswmin = 0 rdwmin = 0 rswmin = 0 prwg = 0
+prwb = 0 wr = 1 alpha0 = 0.074 alpha1 = 0.005
+beta0 = 30 agidl = 0.0002 bgidl = 2.1e+009 cgidl = 0.0002
+egidl = 0.8 aigbacc = 0.012 bigbacc = 0.0028 cigbacc = 0.002
+nigbacc = 1 aigbinv = 0.014 bigbinv = 0.004 cigbinv = 0.004
+eigbinv = 1.1 nigbinv = 3 aigc = 0.015211 bigc = 0.0027432
+cigc = 0.002 aigsd = 0.015211 bigsd = 0.0027432 cigsd = 0.002
+nigc = 1 poxedge = 1 pigcd = 1 ntox = 1
+xrcrg1 = 12 xrcrg2 = 5
+cgso = 1.1e-010 cgdo = 1.1e-010 cgbo = 2.56e-011 cgdl = 2.653e-010
+cgsl = 2.653e-010 ckappas = 0.03 ckappad = 0.03 acde = 1
+moin = 15 noff = 0.9 voffcv = 0.02
+kt1 = -0.11 kt1l = 0 kt2 = 0.022 ute = -1.5
+ua1 = 4.31e-009 ub1 = 7.61e-018 uc1 = -5.6e-011 prt = 0
+at = 33000
+fnoimod = 1 tnoimod = 0
+jss = 0.0001 jsws = 1e-011 jswgs = 1e-010 njs = 1
+ijthsfwd= 0.01 ijthsrev= 0.001 bvs = 10 xjbvs = 1
+jsd = 0.0001 jswd = 1e-011 jswgd = 1e-010 njd = 1
+ijthdfwd= 0.01 ijthdrev= 0.001 bvd = 10 xjbvd = 1
+pbs = 1 cjs = 0.0005 mjs = 0.5 pbsws = 1
+cjsws = 5e-010 mjsws = 0.33 pbswgs = 1 cjswgs = 3e-010
+mjswgs = 0.33 pbd = 1 cjd = 0.0005 mjd = 0.5
+pbswd = 1 cjswd = 5e-010 mjswd = 0.33 pbswgd = 1
+cjswgd = 5e-010 mjswgd = 0.33 tpb = 0.005 tcj = 0.001
+tpbsw = 0.005 tcjsw = 0.001 tpbswg = 0.005 tcjswg = 0.001
+xtis = 3 xtid = 3
+dmcg = 0 dmci = 0 dmdg = 0 dmcgt = 0
+dwj = 0 xgw = 0 xgl = 0
+rshg = 0.4 gbmin = 1e-010 rbpb = 5 rbpd = 15
+rbps = 15 rbdb = 15 rbsb = 15 ngcon = 1
.model pmos pmos level = 54
+version = 4.0 binunit = 1 paramchk= 1 mobmod = 0
+capmod = 2 igcmod = 1 igbmod = 1 geomod = 1
+diomod = 1 rdsmod = 0 rbodymod= 1 rgatemod= 1
+permod = 1 acnqsmod= 0 trnqsmod= 0
+tnom = 27 toxe = 1.82e-009 toxp = 1.5e-009 toxm = 1.82e-009
+dtox = 3.2e-010 epsrox = 3.9 wint = 5e-009 lint = 0
+ll = 0 wl = 0 lln = 1 wln = 1
+lw = 0 ww = 0 lwn = 1 wwn = 1
+lwl = 0 wwl = 0 xpart = 0 toxref = 1.82e-009
+vth0 = -0.587 k1 = 0.4 k2 = -0.01 k3 = 0
+k3b = 0 w0 = 2.5e-006 dvt0 = 1 dvt1 = 2
+dvt2 = -0.032 dvt0w = 0 dvt1w = 0 dvt2w = 0
+dsub = 0.1 minv = 0.05 voffl = 0 dvtp0 = 1e-011
+dvtp1 = 0.05 lpe0 = 0 lpeb = 0 xj = 1.4e-008
+ngate = 1e+023 ndep = 2.44e+018 nsd = 2e+020 phin = 0
+cdsc = 0 cdscb = 0 cdscd = 0 cit = 0
+voff = -0.126 nfactor = 1.8 eta0 = 0.0125 etab = 0
+vfb = 0.55 u0 = 0.021 ua = 2e-009 ub = 5e-019
+uc = 0 vsat = 90000 a0 = 1 ags = 1e-020
+a1 = 0 a2 = 1 b0 = 0 b1 = 0
+keta = -0.047 dwg = 0 dwb = 0 pclm = 0.12
+pdiblc1 = 0.001 pdiblc2 = 0.001 pdiblcb = 3.4e-008 drout = 0.56
+pvag = 1e-020 delta = 0.01 pscbe1 = 8.14e+008 pscbe2 = 9.58e-007
+fprout = 0.2 pdits = 0.08 pditsd = 0.23 pditsl = 2300000
+rsh = 5 rdsw = 250 rsw = 75 rdw = 75
+rdswmin = 0 rdwmin = 0 rswmin = 0 prwg = 0
+prwb = 0 wr = 1 alpha0 = 0.074 alpha1 = 0.005
+beta0 = 30 agidl = 0.0002 bgidl = 2.1e+009 cgidl = 0.0002
+egidl = 0.8 aigbacc = 0.012 bigbacc = 0.0028 cigbacc = 0.002
+nigbacc = 1 aigbinv = 0.014 bigbinv = 0.004 cigbinv = 0.004
+eigbinv = 1.1 nigbinv = 3 aigc = 0.0097 bigc = 0.00125
+cigc = 0.0008 aigsd = 0.0097 bigsd = 0.00125 cigsd = 0.0008
+nigc = 1 poxedge = 1 pigcd = 1 ntox = 1
+xrcrg1 = 12 xrcrg2 = 5
+cgso = 1.1e-010 cgdo = 1.1e-010 cgbo = 2.56e-011 cgdl = 2.653e-010
+cgsl = 2.653e-010 ckappas = 0.03 ckappad = 0.03 acde = 1
+moin = 15 noff = 0.9 voffcv = 0.02
+kt1 = -0.11 kt1l = 0 kt2 = 0.022 ute = -1.5
+ua1 = 4.31e-009 ub1 = 7.61e-018 uc1 = -5.6e-011 prt = 0
+at = 33000
+fnoimod = 1 tnoimod = 0
+jss = 0.0001 jsws = 1e-011 jswgs = 1e-010 njs = 1
+ijthsfwd= 0.01 ijthsrev= 0.001 bvs = 10 xjbvs = 1
+jsd = 0.0001 jswd = 1e-011 jswgd = 1e-010 njd = 1
+ijthdfwd= 0.01 ijthdrev= 0.001 bvd = 10 xjbvd = 1
+pbs = 1 cjs = 0.0005 mjs = 0.5 pbsws = 1
+cjsws = 5e-010 mjsws = 0.33 pbswgs = 1 cjswgs = 3e-010
+mjswgs = 0.33 pbd = 1 cjd = 0.0005 mjd = 0.5
+pbswd = 1 cjswd = 5e-010 mjswd = 0.33 pbswgd = 1
+cjswgd = 5e-010 mjswgd = 0.33 tpb = 0.005 tcj = 0.001
+tpbsw = 0.005 tcjsw = 0.001 tpbswg = 0.005 tcjswg = 0.001
+xtis = 3 xtid = 3
+dmcg = 0 dmci = 0 dmdg = 0 dmcgt = 0
+dwj = 0 xgw = 0 xgl = 0
+rshg = 0.4 gbmin = 1e-010 rbpb = 5 rbpd = 15
+rbps = 15 rbdb = 15 rbsb = 15 ngcon = 1
.end

uWSGI lazy-apps and ThreadPool

Running uWSGI with
$ cat /etc/uwsgi/uwsgi.cfg
[uwsgi]
callable = app
socket = /var/run/arivale-service/uwsgi.sock
chmod-socket = 666
pidfile = /var/run/arivale-service/uwsgi.pid
master = true
enable-threads = true
single-interpreter = true
thunder-lock
need-app
processes = 4
Without lazy-apps enabled, a request to the calling following endpoint hangs
import boto3
# ...irrelevant imports
from multiprocessing.dummy import Pool as ThreadPool
POOL = ThreadPool(6)
# ...irrelevant setup
def get_ecs_task_definitions(service_name):
ecs_service_name, _ = get_ecs_service_name_and_cluster(service_name)
def get_task_definition(task_definition_arn):
formatted_task_definition = {}
task_definition = ECS.describe_task_definition(taskDefinition=task_definition_arn)['taskDefinition']
# ...
# build formatted_task_definition from task_definition
# ...
return formatted_task_definition
task_definition_arns = ECS.list_task_definitions(
familyPrefix=ecs_service_name, status='ACTIVE')['taskDefinitionArns']
return POOL.map(get_task_definition, task_definition_arns)
#service.api('/api/services/<service_name>/ecs/task-definitions')
def get_task_definitions(service_name):
return {'service_name': service_name, 'task_definitions': get_ecs_task_definitions(service_name)}
NGINX is balancing uWSGI apps, and this is what it says in error.log (NGINX):
Jun 10 03:54:26 93e04e04e2cf nginx_error: 2017/06/10 03:54:26 [error] 49#49: *33 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 172.16.254.95, server: localhost, request: "GET /api/services/data-analysis-service/ecs/task-definitions HTTP/1.1",upstream: "uwsgi://unix:/var/run/arivale-service/uwsgi.sock", host: "devops-service.arivale.com"
Each request to the endpoint hangs a worker (below is the output of uwsgitop after 2 requests):
uwsgi-2.0.15 - Sat Jun 10 21:26:10 2017 - req: 0 - RPS: 0 - lq: 0 - tx: 0
node: localhost - cwd: /var/www/arivale-service/web - uid: 0 - gid: 0 - masterpid: 45
WID % PID REQ RPS EXC SIG STATUS AVG RSS VSZ TX ReSpwn HC RunT LastSpwn
1 0.0 74 0 0 0 0 busy 0ms 0 0 0 1 0 0 21:23:20
2 0.0 75 0 0 0 0 busy 0ms 0 0 0 1 0 0 21:23:20
3 0.0 76 0 0 0 0 idle 0ms 0 0 0 1 0 0 21:23:20
4 0.0 77 0 0 0 0 idle 0ms 0 0 0 1 0 0 21:23:20
Enabling lazy-apps fixes the issue. Does anyone know with certainty why?
This happened because uWSGI workers were unable to access the thread pool created in the master, see https://stackoverflow.com/a/39890941/2419669.
Using #postfork fixes this:
global THREAD_POOL = None
#postfork
def _make_thread_pool():
global THREAD_POOL
THREAD_POOL = ThreadPool(8)

Audio data dumping to audio sink but no audio from speaker

I am using a Baytrail intel z3735 tablet. I am trying to run ubuntu 14.04/15.04 with linux kernel version 3.16/4.2.0. When I play an audio file the audio data is dumping to the audio sink but there is no audio coming from the speaker. I am able get the sound card detected as below...
sanj#sanj:~$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: bytrt5640 [byt-rt5640], device 0: Audio rt5640-aif1-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0
sanj#sanj:~$
Audio Sink nodes :
sanj#sanj:~$ pactl list sinks
Sink #0
State: SUSPENDED
Name: alsa_output.platform-byt-rt5640.analog-stereo
Description: byt-rt5640 Analog Stereo
Driver: module-alsa-card.c
Sample Specification: s16le 2ch 48000Hz
Channel Map: front-left,front-right
Owner Module: 6
Mute: no
Volume: front-left: 99957 / 153% / 11.00 dB, front-right: 99957 / 153% / 11.00 dB
balance 0.00
Base Volume: 41350 / 63% / -12.00 dB
Monitor Source: alsa_output.platform-byt-rt5640.analog-stereo.monitor
Latency: 0 usec, configured 0 usec
Flags: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY
Properties:
alsa.resolution_bits = "16"
device.api = "alsa"
device.class = "sound"
alsa.class = "generic"
alsa.subclass = "generic-mix"
alsa.name = ""
alsa.id = "Audio rt5640-aif1-0"
alsa.subdevice = "0"
alsa.subdevice_name = "subdevice #0"
alsa.device = "0"
alsa.card = "0"
alsa.card_name = "byt-rt5640"
alsa.long_card_name = "byt-rt5640"
alsa.driver_name = "snd_soc_sst_byt_rt5640_mach"
device.bus_path = "platform-byt-rt5640"
sysfs.path = "/devices/platform/80860F28:00/byt-rt5640/sound/card0"
device.string = "hw:0"
device.buffering.buffer_size = "96000"
device.buffering.fragment_size = "48000"
device.access_mode = "mmap+timer"
device.profile.name = "analog-stereo"
device.profile.description = "Analog Stereo"
device.description = "byt-rt5640 Analog Stereo"
module-udev-detect.discovered = "1"
device.icon_name = "audio-card"
Ports:
analog-output-speaker: Speakers (priority: 10000)
analog-output-headphones: Headphones (priority: 9000)
Active Port: analog-output-speaker
Formats:
pcm
Audio Source nodes :
sanj#sanj:~$ pactl list sources
Source #0
State: SUSPENDED
Name: alsa_output.platform-byt-rt5640.analog-stereo.monitor
Description: Monitor of byt-rt5640 Analog Stereo
Driver: module-alsa-card.c
Sample Specification: s16le 2ch 48000Hz
Channel Map: front-left,front-right
Owner Module: 6
Mute: no
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
Monitor of Sink: alsa_output.platform-byt-rt5640.analog-stereo
Latency: 0 usec, configured 0 usec
Flags: DECIBEL_VOLUME LATENCY
Properties:
device.description = "Monitor of byt-rt5640 Analog Stereo"
device.class = "monitor"
alsa.card = "0"
alsa.card_name = "byt-rt5640"
alsa.long_card_name = "byt-rt5640"
alsa.driver_name = "snd_soc_sst_byt_rt5640_mach"
device.bus_path = "platform-byt-rt5640"
sysfs.path = "/devices/platform/80860F28:00/byt-rt5640/sound/card0"
device.string = "0"
module-udev-detect.discovered = "1"
device.icon_name = "audio-card"
Formats:
pcm
Source #1
State: SUSPENDED
Name: alsa_input.platform-byt-rt5640.analog-stereo
Description: byt-rt5640 Analog Stereo
Driver: module-alsa-card.c
Sample Specification: s16le 2ch 48000Hz
Channel Map: front-left,front-right
Owner Module: 6
Mute: no
Volume: front-left: 93554 / 143% / 9.27 dB, front-right: 93554 / 143% / 9.27 dB
balance 0.00
Base Volume: 65536 / 100% / 0.00 dB
Monitor of Sink: n/a
Latency: 0 usec, configured 0 usec
Flags: HARDWARE DECIBEL_VOLUME LATENCY
Properties:
alsa.resolution_bits = "16"
device.api = "alsa"
device.class = "sound"
alsa.class = "generic"
alsa.subclass = "generic-mix"
alsa.name = ""
alsa.id = "Audio rt5640-aif1-0"
alsa.subdevice = "0"
alsa.subdevice_name = "subdevice #0"
alsa.device = "0"
alsa.card = "0"
alsa.card_name = "byt-rt5640"
alsa.long_card_name = "byt-rt5640"
alsa.driver_name = "snd_soc_sst_byt_rt5640_mach"
device.bus_path = "platform-byt-rt5640"
sysfs.path = "/devices/platform/80860F28:00/byt-rt5640/sound/card0"
device.string = "hw:0"
device.buffering.buffer_size = "96000"
device.buffering.fragment_size = "48000"
device.access_mode = "mmap+timer"
device.profile.name = "analog-stereo"
device.profile.description = "Analog Stereo"
device.description = "byt-rt5640 Analog Stereo"
module-udev-detect.discovered = "1"
device.icon_name = "audio-card"
Ports:
analog-input: Analog Input (priority: 10000)
Active Port: analog-input
Formats:
pcm
sanj#sanj:~$
To test whether audio is coming to sink or not, I am using pulseaudio commands paplay and parecord from different terminals. Since source 0 is the source-monitor node for sink node 0, I captured audio from it.
sanj#sanj:~$ paplay Dhaakad.wav
sanj#sanj:~$ parecord -d 0 > test.wav
Then I tested the captured audio file test.wav with audacity on a PC and it was playing fine. I am not able to figure out why the audio not coming from speaker. I also tried to change the audio settings with alsamixer but nothing worked out.

snmpwalk is not showing all information required

I am trying to collect the data from the server through SNMP.
snmpwalk does not return back any essential data as a web interface does, but I need to fetch that kind of data via SNMP.
snmpwalk -c public -v 1 <ip> .
iso.3.6.1.2.1.1.1.0 = STRING: "OCMF agent SNMP"
iso.3.6.1.2.1.1.2.0 = OID: iso.3.6.1.4.1.11606.0
iso.3.6.1.2.1.1.3.0 = Timeticks: (95236803) 11 days, 0:32:48.03
iso.3.6.1.2.1.1.4.0 = STRING: "helpdesk#pbn.com.au"
iso.3.6.1.2.1.1.5.0 = STRING: "Copyright(c)2004 Pacific Broadband Networks"
iso.3.6.1.2.1.1.6.0 = STRING: "8 Keith Campbell Court"
iso.3.6.1.2.1.1.7.0 = INTEGER: 0
iso.3.6.1.2.1.11.1.0 = Counter32: 6505
iso.3.6.1.2.1.11.2.0 = Counter32: 6580
iso.3.6.1.2.1.11.3.0 = Counter32: 127
iso.3.6.1.2.1.11.6.0 = Counter32: 41
iso.3.6.1.2.1.11.15.0 = Counter32: 225
iso.3.6.1.2.1.11.16.0 = Counter32: 6285
iso.3.6.1.2.1.11.17.0 = Counter32: 0
iso.3.6.1.2.1.11.18.0 = Counter32: 0
iso.3.6.1.2.1.11.19.0 = Counter32: 0
iso.3.6.1.2.1.11.25.0 = Counter32: 0
iso.3.6.1.2.1.11.26.0 = Counter32: 0
iso.3.6.1.2.1.11.27.0 = Counter32: 0
iso.3.6.1.2.1.11.28.0 = Counter32: 6516
iso.3.6.1.2.1.11.29.0 = Counter32: 75
iso.3.6.1.4.1.11606.1.1 = INTEGER: 1
iso.3.6.1.4.1.11606.1.2 = INTEGER: 255
iso.3.6.1.4.1.11606.1.3 = INTEGER: 0
iso.3.6.1.4.1.11606.1.4 = INTEGER: 0
iso.3.6.1.4.1.11606.1.5 = INTEGER: 0
iso.3.6.1.4.1.11606.1.6 = INTEGER: 1357399287
iso.3.6.1.4.1.11606.1.15 = INTEGER: 1357399287
End of MIB
and if I enable OID resolving in /etc/snmp/snmp.conf I get:
SNMPv2-MIB::sysDescr.0 = STRING: OCMF agent SNMP
SNMPv2-MIB::sysObjectID.0 = OID: SNMPv2-SMI::enterprises.11606.0
DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (95258487) 11 days, 0:36:24.87
SNMPv2-MIB::sysContact.0 = STRING: helpdesk#pbn.com.au
SNMPv2-MIB::sysName.0 = STRING: Copyright(c)2004 Pacific Broadband Networks
SNMPv2-MIB::sysLocation.0 = STRING: 8 Keith Campbell Court
SNMPv2-MIB::sysServices.0 = INTEGER: 0
SNMPv2-MIB::snmpInPkts.0 = Counter32: 6534
SNMPv2-MIB::snmpOutPkts.0 = Counter32: 6609
SNMPv2-MIB::snmpInBadVersions.0 = Counter32: 127
SNMPv2-MIB::snmpInASNParseErrs.0 = Counter32: 41
SNMPv2-MIB::snmpInGetRequests.0 = Counter32: 225
SNMPv2-MIB::snmpInGetNexts.0 = Counter32: 6314
SNMPv2-MIB::snmpInSetRequests.0 = Counter32: 0
SNMPv2-MIB::snmpInGetResponses.0 = Counter32: 0
SNMPv2-MIB::snmpInTraps.0 = Counter32: 0
SNMPv2-MIB::snmpOutGetRequests.0 = Counter32: 0
SNMPv2-MIB::snmpOutGetNexts.0 = Counter32: 0
SNMPv2-MIB::snmpOutSetRequests.0 = Counter32: 0
SNMPv2-MIB::snmpOutGetResponses.0 = Counter32: 6545
SNMPv2-MIB::snmpOutTraps.0 = Counter32: 75
SNMPv2-SMI::enterprises.11606.1.1 = INTEGER: 1
SNMPv2-SMI::enterprises.11606.1.2 = INTEGER: 255
SNMPv2-SMI::enterprises.11606.1.3 = INTEGER: 0
SNMPv2-SMI::enterprises.11606.1.4 = INTEGER: 0
SNMPv2-SMI::enterprises.11606.1.5 = INTEGER: 0
SNMPv2-SMI::enterprises.11606.1.6 = INTEGER: 1357399287
SNMPv2-SMI::enterprises.11606.1.15 = INTEGER: 1357399287
End of MIB
I would like to fetch the same set of parameter as available in web interface
1.MTEMP 30C O
1.LCUR 61mA O
1.LPWR 09.9mW Z
1.OMI 04.2% Z
1.ERF 20.5dBmV O
1.RFI 41.9dBmV O
1.RFO 36.6dBmV Z
1.LTEMP 31C O
Is this possible?
The dump you've provided as a result of snmpwalk command is just a snapshot of RFC1213 (mib-2) data. And yes your assumptions are correct: It is not the information you're interested in as it only contains the set of data about network interfaces and common system information (system group of MIB-II). You'll need to contact your vendor to get specific set of MIB files for this particular device. Usually the target MIB files are available on vendor's web site in Download area. The data you'd like to retrieve is usually located in private enterprise specific branch of MIB tree.
From what I see the Enterprise OID 1.3.6.1.4.1.11606 belongs to Pacific Broadband Networks (PBN).
Also I've found the definition for the root element of this MIB module:
PBN-ROOT DEFINITIONS ::= BEGIN
IMPORTS
enterprises
FROM RFC1155-SMI;
pbn OBJECT IDENTIFIER ::= { enterprises 11606 }
END

Cent OS - sysctl.conf not working

The settings i have applied in my sysctl.conf are not working. Not on reboot or after applying it using sysctl -p
Below are my sysctl.conf settings. Can someone take a look and tell me what may be causing the issue?
# Controls IP packet forwarding
net.ipv4.ip_forward = 0
# Controls source route verification
net.ipv4.conf.default.rp_filter = 1
# Do not accept source routing
net.ipv4.conf.default.accept_source_route = 0
# Controls the System Request debugging functionality of the kernel
kernel.sysrq = 0
# Controls whether core dumps will append the PID to the core filename.
# Useful for debugging multi-threaded applications.
kernel.core_uses_pid = 1
# Controls the use of TCP syncookies
net.ipv4.tcp_syncookies = 1
# Controls the default maxmimum size of a mesage queue
kernel.msgmnb = 65536
# Controls the maximum size of a message, in bytes
kernel.msgmax = 65536
# Controls the maximum shared segment size, in bytes
kernel.shmmax = 68719476736
# Controls the maximum number of shared memory segments, in pages
kernel.shmall = 4294967296
net.ipv4.tcp_keepalive_time = 4
net.ipv4.tcp_keepalive_probes = 1
net.ipv4.tcp_keepalive_intvl = 2
net.ipv4.tcp_fin_timeout = 4
net.ipv4.tcp_no_metrics_save = 1
net.ipv4.tcp_window_scaling = 1
net.ipv4.tcp_rfc1337 = 1
net.ipv4.tcp_congestion_control= cubic
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_tw_reuse = 1
net.ipv4.route.flush = 1
net.ipv4.tcp_orphan_retries = 0
net.core.netdev_max_backlog = 400000
net.core.optmem_max = 10000000
net.core.rmem_default = 10000000
net.core.rmem_max = 10000000
net.core.somaxconn = 100000
net.core.wmem_default = 10000000
net.core.wmem_max = 10000000
net.ipv4.conf.all.rp_filter = 1
net.ipv4.ip_local_port_range = 1024 65535
net.ipv4.tcp_ecn = 0
net.ipv4.tcp_max_syn_backlog = 12000
net.ipv4.tcp_max_tw_buckets = 2000000
net.ipv4.tcp_mem = 10240 8738000 825829120
net.ipv4.tcp_rmem = 10240 8738000 825829120
net.ipv4.tcp_sack = 1
net.ipv4.tcp_timestamps = 1
net.ipv4.tcp_wmem = 10240 8738000 825829120
net.netfilter.nf_conntrack_max = 768000
net.netfilter.nf_conntrack_generic_timeout = 4
net.netfilter.nf_conntrack_tcp_timeout_established = 4
net.netfilter.nf_conntrack_tcp_timeout_time_wait = 4
net.netfilter.nf_conntrack_tcp_timeout_fin_wait = 4
net.netfilter.nf_conntrack_tcp_timeout_close_wait = 4
net.netfilter.nf_conntrack_tcp_timeout_last_ack = 4
net.netfilter.nf_conntrack_tcp_timeout_syn_sent = 4
net.netfilter.nf_conntrack_tcp_timeout_syn_recv = 4
net.netfilter.nf_conntrack_tcp_timeout_close = 4

Resources