pzim-devdata / volumouse

A Python 3 program that allows you to change the volume with the mouse wheel using it at the four corners of the screen
MIT License
12 stars 1 forks source link

invalid literal for int() with base 10: 'b' when volume up work 5% then crash #4

Closed konshul closed 2 months ago

konshul commented 2 months ago

Version 0.0.2 volume- works OK, but when volume up it's maximize 5% then crash with error invalid literal for int() with base 10: 'b' Old your version with “Volumouse_pactl_1_right.py” work OK, but volume+ without max_volume limit. Now I delete line 661: if int(str(subprocess.check_output("pactl get-sink-volume "+Top_right_card+" | grep % | cut -d '/' -f2 | cut -d'%' -f1", shell=True).rstrip()).replace("b' ","").replace("'","")) > max_volume_top_right : And it's work without crash, but volume up at one moment 150%. Volume down minimize OK(5%) My OS - Rosa Fresh KDE (kde 5.27.10) In other OS on my PC it works without problems. Is there any thoughts about it? In any case - Thank you for your volumouse!

pzim-devdata commented 2 months ago

Hello,

Thank you for your feedback.

Could you modify line 661 to : if int(subprocess.check_output(f"pactl get-sink-volume {Top_right_card} | grep % | cut -d '/' -f2 | cut -d'%' -f1", shell=True, text=True).strip()) > max_volume_top_right: and tell me if it's ok ?

You can also comment or delete lines 660, 661, 662, 663 and 680, 681, 682, 683 and 698, 699, 700, 701 and 716, 717, 718, 719. To comment a line just add # at he beginning of the line :

#                          if str(Top_right_card) != 'no_soundcard':
#                              if int(str(subprocess.check_output("pactl get-sink-volume "+Top_right_card+" | grep % | cut -d '/' -f2 | cut -d'%' -f1", shell=True).rstrip()).replace("b' ","").replace("'","")) > max_volume_top_right :
#                                print("Volume exceeded the maximum value : "+str(max_volume_top_right)+"% !")
#                                subprocess.run("pactl set-sink-volume "+Top_right_card+" "+str(max_volume_top_right)+"% & pid=$!",shell=True)

In this case the volume will exceed max_volume (150%)

Thanks

konshul commented 2 months ago

Thanks for your answer. Replacing line 661 did not help. Error - invalid literal for int() with base 10: '' Comments lines it's like your first version - works step +&- 5%, but without limit max level 150%. I think its problem my RosaOS. Linux Mint and Alt OS(also kde) works with your app very well. So its the better then without one. My notebook isn't so much loudness.

pzim-devdata commented 2 months ago

Thank you for your answer.

Could you modify line 661 to : if int(str(subprocess.check_output(f"pactl get-sink-volume {Top_right_card} | grep % | cut -d '/' -f2 | cut -d'%' -f1", shell=True, text=True).strip().replace('"',''))) > max_volume_top_right:

And tell me if it's ok ?

If not, it could be a problem with python or your system has not been updated for a long time

konshul commented 2 months ago

Again crash - invalid literal for int() with base 10: '' Well, thats all right without line 661. Its problem RosaOS. Don't worry. Thanks for your attention and efforts to resolve it. Anyway, thanks for your app! Very usefull for me.

pzim-devdata commented 2 months ago

Ok. I will give you a last try for modifying line 661 : if int(str(subprocess.check_output(f"pactl get-sink-volume {Top_right_card} | grep % | cut -d '/' -f2 | cut -d'%' -f1", shell=True, text=True).strip().replace("'","").replace('"',''))) > max_volume_top_right: