dragosprju / y50-subwoofer-linux-enabler

Lenovo Y50 Subwoofer Enabler for Linux
MIT License
33 stars 12 forks source link

not working in kali linux 2017.3 #4

Open Nicee1 opened 6 years ago

Nicee1 commented 6 years ago

Hello there, I am currently using kali linux 2017.3 in my lenovo y50. **uname -a** Linux BlackjacK 4.14.0-kali1-amd64 #1 SMP Debian 4.14.2-1kali1 (2017-12-04) x86_64 GNU/Linux I tried running your script and it failed to enable my subwoofer. I have attached the following outputs after reading other issues here.

>systemctl --user status subwoofer
● subwoofer.service - Lenovo Y50 Subwoofer Caretaker
   Loaded: loaded (/etc/systemd/user/subwoofer.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Thu 2017-12-14 14:00:03 IST; 14min ago
  Process: 1103 ExecStopPost=/usr/bin/python /opt/subwoofer.py exit (code=exited, status=0/SUCCESS)
  Process: 1098 ExecStart=/usr/bin/python /opt/subwoofer.py (code=exited, status=1/FAILURE)
 Main PID: 1098 (code=exited, status=1/FAILURE)

Dec 14 14:00:03 BlackjacK systemd[1002]: subwoofer.service: Service hold-off time over, scheduling restar
Dec 14 14:00:03 BlackjacK systemd[1002]: subwoofer.service: Scheduled restart job, restart counter is at 
Dec 14 14:00:03 BlackjacK systemd[1002]: Stopped Lenovo Y50 Subwoofer Caretaker.
Dec 14 14:00:03 BlackjacK systemd[1002]: subwoofer.service: Start request repeated too quickly.
Dec 14 14:00:03 BlackjacK systemd[1002]: subwoofer.service: Failed with result 'exit-code'.
Dec 14 14:00:03 BlackjacK systemd[1002]: Failed to start Lenovo Y50 Subwoofer Caretaker.
lines 1-13/13 (END)
>top -p 1098
top - 14:01:35 up 2 min,  1 user,  load average: 1.09, 0.82, 0.34
Tasks:   0 total,   0 running,   0 sleeping,   0 stopped,   0 zombie
%Cpu(s):  0.0 us,  0.1 sy,  0.0 ni, 99.6 id,  0.3 wa,  0.0 hi,  0.0 si,  0.0 st
KiB Mem :  8092664 total,  6153552 free,  1371612 used,   567500 buff/cache
KiB Swap:  8303612 total,  8303612 free,        0 used.  6538684 avail Mem

PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND       

The output of Suboofer.py:

>python /opt/subwoofer.py
Pulseaudio detected
Traceback (most recent call last):
File "/opt/subwoofer.py", line 259, in <module>
headphones_in_query()
File "/opt/subwoofer.py", line 167, in headphones_in_query
amixer = subprocess.Popen(["amixer", "-c", str(devId), "cget", "numid=22"], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
File "/usr/lib/python2.7/subprocess.py", line 394, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1047, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory

After running the script I tried these commands too:

systemctl --user disable subwoofer
 systemctl --user enable subwoofer
 reboot
 systemctl --user status subwoofer

But no luck. I got the same above output.

dragosprju commented 6 years ago

Hmm, see if amixer works in your terminal. If not, try sudo apt-get install alsa-tools in your terminal and show me what it says.

Error is OSError: [Errno 2] No such file or directory when Python tries to Popen (open the process) amixer = subprocess.Popen(["amixer", "-c", str(devId), "cget", "numid=22"], stdout=subprocess.PIPE, stderr=subprocess.PIPE). So, we're trying to see if amixer even exists/was installed in your Kali system.

Nicee1 commented 6 years ago

I checked for amixer and it was not there.

>sudo apt-get install alsa-tools
Reading package lists... Done
Building dependency tree       
Reading state information... Done
alsa-tools is already the newest version (1.1.3-1).
The following packages were automatically installed and are no longer required:
  dissy libarmadillo7 libbind9-141 libboost-atomic1.62.0
  libboost-program-options1.62.0 libboost-serialization1.62.0
  libboost-test1.62.0 libboost-timer1.62.0 libcaribou-gtk-module
  libcaribou-gtk3-module libcdio-cdda1 libcdio-paranoia1 libcdio13 libcdio16
  libcgal12 libdns190 libevent-2.0-5 libgom-1.0-common libhttp-parser2.1
  libisc189 libisccc140 libisccfg144 liblwres141 libnetcdf11 libntfs-3g872
  libqcustomplot1.3 libqt5opengl5 libqt5sql5 libqt5sql5-sqlite libradare2-2.0
  libsfcgal1 libxerces-c3.1 python-brotli python-cssutils python-rsvg
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.

I then installed it by the following command: sudo apt-get install libasound2 alsa-utils alsa-oss and got this:

>amixer
Simple mixer control 'Master',0
  Capabilities: pvolume pswitch pswitch-joined
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 65536
  Mono:
  Front Left: Playback 46820 [71%] [on]
  Front Right: Playback 46820 [71%] [on]
Simple mixer control 'Capture',0
  Capabilities: cvolume cswitch cswitch-joined
  Capture channels: Front Left - Front Right
  Limits: Capture 0 - 65536
  Front Left: Capture 65540 [100%] [off]
  Front Right: Capture 65540 [100%] [off]
>python /opt/subwoofer.py
Pulseaudio detected
Traceback (most recent call last):
  File "/opt/subwoofer.py", line 262, in <module>
    set_subwoofer()
  File "/opt/subwoofer.py", line 84, in set_subwoofer
    vol = get_biggest_volume()
  File "/opt/subwoofer.py", line 132, in get_biggest_volume
    if volumes[0] > volumes[1]:
IndexError: list index out of range

I tried the script again but not worked. Thanks for your reply.

dragosprju commented 6 years ago

Yeah, that needs Python debug. I am sorry but I do not have the time these days. :[

On Thu, Dec 14, 2017, 12:01 Defaul_t notifications@github.com wrote:

I checked for amixer and it was not there.

sudo apt-get install alsa-tools Reading package lists... Done Building dependency tree Reading state information... Done alsa-tools is already the newest version (1.1.3-1). The following packages were automatically installed and are no longer required: dissy libarmadillo7 libbind9-141 libboost-atomic1.62.0 libboost-program-options1.62.0 libboost-serialization1.62.0 libboost-test1.62.0 libboost-timer1.62.0 libcaribou-gtk-module libcaribou-gtk3-module libcdio-cdda1 libcdio-paranoia1 libcdio13 libcdio16 libcgal12 libdns190 libevent-2.0-5 libgom-1.0-common libhttp-parser2.1 libisc189 libisccc140 libisccfg144 liblwres141 libnetcdf11 libntfs-3g872 libqcustomplot1.3 libqt5opengl5 libqt5sql5 libqt5sql5-sqlite libradare2-2.0 libsfcgal1 libxerces-c3.1 python-brotli python-cssutils python-rsvg Use 'sudo apt autoremove' to remove them. 0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.

I then installed it by the following command: sudo apt-get install libasound2 alsa-utils alsa-oss and got this:

amixer Simple mixer control 'Master',0 Capabilities: pvolume pswitch pswitch-joined Playback channels: Front Left - Front Right Limits: Playback 0 - 65536 Mono: Front Left: Playback 46820 [71%] [on] Front Right: Playback 46820 [71%] [on] Simple mixer control 'Capture',0 Capabilities: cvolume cswitch cswitch-joined Capture channels: Front Left - Front Right Limits: Capture 0 - 65536 Front Left: Capture 65540 [100%] [off] Front Right: Capture 65540 [100%] [off]

python /opt/subwoofer.py Pulseaudio detected Traceback (most recent call last): File "/opt/subwoofer.py", line 262, in set_subwoofer() File "/opt/subwoofer.py", line 84, in set_subwoofer vol = get_biggest_volume() File "/opt/subwoofer.py", line 132, in get_biggest_volume if volumes[0] > volumes[1]: IndexError: list index out of range

I tried the script again but not worked. Thanks for your reply.

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/dragosprju/y50-subwoofer-linux-enabler/issues/4#issuecomment-351679038, or mute the thread https://github.com/notifications/unsubscribe-auth/ALN3jgAGYwq5JKWQQ3bQWUXWevoUS9LTks5tAQABgaJpZM4RBwN5 .

Nicee1 commented 6 years ago

K no problem. One request when you are free please suggest some solutions. Meanwhile i will try to figure out something. Thank you.