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

No ability to adjust sound properties #1348

Closed
cqexbesd opened this issue Nov 28, 2023 · 5 comments · Fixed by #1356
Closed

No ability to adjust sound properties #1348

cqexbesd opened this issue Nov 28, 2023 · 5 comments · Fixed by #1356
Labels
bug Something isn't working frontend Contour Terminal Emulator (GUI frontend)

Comments

@cqexbesd
Copy link
Contributor

Contour Terminal version

0.4.0-master-9c3073db

Installer source

Github: source code cloned

Operating System

Arch Linux as of approx a week ago

Architecture

x86-64

Other Software

pavucontrol

Steps to reproduce

Since #985 Contour now beeps by playing sound. The problem is that it connects to the sound system very briefly to play it's beep sound and then disconnects. If you use a GUI client (e.g. pavuclient) to configure sound (e.g. volume, sink) then the entry for contour is too temporally brief to catch it and configure it.

Also the name shown is Qtm-PulseStream-something-something so you can't identify an entry as contour, and certainly not which window.

To reproduce open pavucontrol and make contour beep (e.g. by typing ^G).

Expected Behavior

Contour to show up for long enough to change things. Maybe I should use an alternative configuration mechanism?

Actual Behavior

contour shows up for less than a second

Additional notes

For some reason, probably not contours fault, some windows I have beep via the laptop speaker and some via my headphones. Some are loud and some are not. I can't change them easily.

echoing ^G in a tight loop doesn't work because contour still shows up very briefly, just repeatedly. It also causes contour to become unresponsive so even ^C doesn't seem to be processed. After killing the shell from elsewhere contour still takes up more than 100% CPU with the repeating strace output:

futex(0x7fff90f29080, FUTEX_WAIT_PRIVATE, 0, NULL) = 0
write(30, "\1\0\0\0\0\0\0\0", 8)        = 8
write(29, "\1\0\0\0\0\0\0\0", 8)        = 8
write(28, "\1\0\0\0\0\0\0\0", 8)        = 8
futex(0x7f5f3e7f9f88, FUTEX_WAKE_PRIVATE, 1) = 0
write(30, "\1\0\0\0\0\0\0\0", 8)        = 8
write(29, "\1\0\0\0\0\0\0\0", 8)        = 8
write(28, "\1\0\0\0\0\0\0\0", 8)        = 8
write(28, "\1\0\0\0\0\0\0\0", 8)        = 8
futex(0x7fff90f29080, FUTEX_WAIT_PRIVATE, 0, NULL) = 0
write(30, "\1\0\0\0\0\0\0\0", 8)        = 8
write(29, "\1\0\0\0\0\0\0\0", 8)        = 8
write(28, "\1\0\0\0\0\0\0\0", 8)        = 8
futex(0x7f5f3e7f9f88, FUTEX_WAKE_PRIVATE, 1) = 0
write(30, "\1\0\0\0\0\0\0\0", 8)        = 8
write(29, "\1\0\0\0\0\0\0\0", 8)        = 8
write(28, "\1\0\0\0\0\0\0\0", 8)        = 8
write(28, "\1\0\0\0\0\0\0\0", 8)        = 8
contour 153550 andrew   20u      REG               0,34     11968     1981 /tmp/#1981 (deleted)
contour 153550 andrew   21r      REG               0,34     11968     1981 /tmp/contour.UCZfbe.wav
contour 153550 andrew   22u  a_inode               0,15         0     1111 [eventfd:342]
contour 153550 andrew   24u  a_inode               0,15         0     1111 [eventpoll:25]
contour 153550 andrew   25u  a_inode               0,15         0     1111 [eventfd:326]
contour 153550 andrew   26u  a_inode               0,15         0     1111 [eventfd:327]
contour 153550 andrew   28u  a_inode               0,15         0     1111 [eventfd:367]
contour 153550 andrew   29u  a_inode               0,15         0     1111 [eventfd:368]
contour 153550 andrew   30u  a_inode               0,15         0     1111 [eventfd:370]
contour 153550 andrew   31r     FIFO               0,14       0t0   720583 pipe
contour 153550 andrew   32w     FIFO               0,14       0t0   720583 pipe
contour 153550 andrew   33u      REG                0,1  67108864      349 /memfd:pulseaudio (deleted)
contour 153550 andrew   34u     unix 0x0000000062465035       0t0   720584 type=STREAM (CONNECTED)

No actual beeps unless strace was attached. After 5 minutes I guess it caught up because it just exited.

@cqexbesd cqexbesd added the bug Something isn't working label Nov 28, 2023
@christianparpart
Copy link
Member

hm, good point, never thought about this. So we could keep it up registered for as long as contour is alive. However, I think there's no way around the fact, that you'd see an entry in the sound system for every contour instance (window). 🤔

@cqexbesd
Copy link
Contributor Author

If it went back to the X bell then I could just use xset - but of course then you can’t have a custom sound file per window ;-) And of course it didn’t work reliably.

I don’t know any good solutions. Possibilities, all with drawbacks, could be having contour allow you to configure these things or a key combo to make it attach to sound till you ^C the command, or finding the VT sequences to play music and see if that keeps the sound connection open long enough.

@cqexbesd
Copy link
Contributor Author

or finding the VT sequences to play music and see if that keeps the sound connection open long enough.

The answer is yes, that works but you, and everyone else, really notice in windows using the laptop speak and a high volume.

microsoft/terminal#8687 (comment)

@christianparpart
Copy link
Member

Seems like ensuring to be registered and shown in the operating system's audio app list is more hard than worth it. Also, the string "QtPulseAudio:%d" is hard coded into QtMultimedia (lol WHAT?). We can however just make the volume configurable on our end. Probably a config entry next to the bell.sound config node.

@christianparpart christianparpart added the frontend Contour Terminal Emulator (GUI frontend) label Dec 1, 2023
@christianparpart
Copy link
Member

@cqexbesd with the new PR, you should be able to adjust the bell volume via configuration:

profiles:
  your_profile:
    bell:
      volume: 0.25 # set bell volume to 25% system volume

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working frontend Contour Terminal Emulator (GUI frontend)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants