Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] pmctl splitting index wrong if there is a '#' in the string #59

Open
Fl1tzi opened this issue May 15, 2022 · 2 comments · May be fixed by #103
Open

[Bug] pmctl splitting index wrong if there is a '#' in the string #59

Fl1tzi opened this issue May 15, 2022 · 2 comments · May be fixed by #103
Assignees
Labels
good first issue Good for newcomers

Comments

@Fl1tzi
Copy link
Collaborator

Fl1tzi commented May 15, 2022

This bug was created using the conversation with Giovanni Gelijns#5347 on Discord.
Conversation: https://discord.com/channels/897428802412613632/922913613369454622/975418884108742776

bug
The output of pmctl list sinks should be the normal json, but if there is a # in the description (would probably also apply to all other fields) then the shell scripts splits it as thinking it is a new index, which results in a broken json return.

file which runs this: main/scripts/pmctl

broken json
{
  "id": 49,
  "name": "alsa_output.pci-0000_00_1f.3.analog-stereo",
  "description": "Built-in Audio Analog Stereo",
  "volume": 60
},
{
  "id": 835,
  "name": "alsa_output.usb-Astro_Gaming_Astro_A50-00.stereo-game",
  "description": "Astro A50 Game",
  "volume": 100
},
{
  "id": 836,
  "name": "alsa_output.usb-Astro_Gaming_Astro_A50-00.stereo-chat",
  "description": "Astro A50 Chat",
  "volume": 100
},
{
  "id": 1899,
  "name": "bluez_output.34_81_F4_F4_41_C9.a2dp-sink",
  "description": "SOUNDBOKS
},
{
  "id": 003110,
  "volume": 100
}
fixed json
{
  "id": 49,
  "name": "alsa_output.pci-0000_00_1f.3.analog-stereo",
  "description": "Built-in Audio Analog Stereo",
  "volume": 60
},
{
  "id": 835,
  "name": "alsa_output.usb-Astro_Gaming_Astro_A50-00.stereo-game",
  "description": "Astro A50 Game",
  "volume": 100
},
{
  "id": 836,
  "name": "alsa_output.usb-Astro_Gaming_Astro_A50-00.stereo-chat",
  "description": "Astro A50 Chat",
  "volume": 100
},
{
  "id": 1899,
  "name": "bluez_output.34_81_F4_F4_41_C9.a2dp-sink",
  "description": "SOUNDBOKS #003110"
  "volume": 100
}

Desktop (please complete the following information):

  • Distro: Fedora 36
  • audio Server: PipeWire
  • Python Version: 3.10.4

Additional context
Look at the conversation for additional data.

@Fl1tzi Fl1tzi added the good first issue Good for newcomers label May 21, 2022
@Fl1tzi
Copy link
Collaborator Author

Fl1tzi commented Jun 2, 2022

Good news! With Pulseaudio 16.0, pactl finally supports directly outputting json which would not break this. That would fix this for system with an updated Pulseaudio version.

@theRealCarneiro theRealCarneiro linked a pull request Nov 29, 2022 that will close this issue
7 tasks
@theRealCarneiro theRealCarneiro self-assigned this Nov 29, 2022
@theRealCarneiro
Copy link
Owner

As Pulseaudio 16.0 is not yet released in most distros, I wrote a wrapper to JSON myself, so closing this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants