Bug 439543

Summary: Kwave Playback settings dialog loads incorrectly until you switch playback methods
Product: [Applications] kwave Reporter: nyanpasu64 <nyanpasu64>
Component: generalAssignee: Thomas Eschenbacher <Thomas.Eschenbacher>
Status: RESOLVED FIXED    
Severity: normal CC: mrp
Priority: NOR    
Version: 21.04.2   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description nyanpasu64 2021-07-06 08:25:58 UTC
SUMMARY
In Kwave, if you click Settings -> Playback, the Device selector is incorrect until you switch playback methods.

STEPS TO REPRODUCE
1. Open Kwave.
2. In the menu, click Settings -> Playback.
3. Look at the Device: selector.

OBSERVED RESULT
The dropdown of devices is empty. The Select... button produces a glitched file picker. The white tree view underneath is empty.

EXPECTED RESULT
Once you switch to another playback method, the dropdown and Select... button disappear, and the tree view fills as expected.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux
KDE Plasma Version: 5.22.2
KDE Frameworks Version: 5.83.0
Qt Version: 5.15.2
Kernel Version: 5.12.14-zen1-1-zen (64-bit)
Graphics Platform: X11
Processors: 12 × AMD Ryzen 5 5600X 6-Core Processor
Memory: 15.6 GiB of RAM
Graphics Processor: NVIDIA GeForce GT 730/PCIe/SSE2

ADDITIONAL INFORMATION
Comment 1 Mark Penner 2024-08-07 00:27:26 UTC
It sounds like it is opening with the OSS playback method selected and you probably don't have any OSS devices available. In that case what you report is expected (not sure what you mean by "glitched file picker", though). I'm not sure if any modern distros even come with OSS, maybe we should just remove it.

I'm closing this as not a bug. If my assumption of the playback method being OSS and you not having OSS is not correct, feel free to reopen with more information.
Comment 2 Mark Penner 2024-09-10 03:12:16 UTC
I did a little more investigation, and there is indeed a bug here. It can be triggered by deleting `~/.config/kwaverc`, or just deleting the `[plugin playback]` section in that file and running Kwave. When the Playback dialog is opened, the dialog is not set up correctly. Terminal output is:
```
 plugin:setup(playback) 
PlayBackDialog::setDevice(): '' -> ''
PlayBackDialog::setBitsPerSample(): 16 -> 16
PlayBackDialog::setChannels(): 2 -> 2
PlayBackDialog::setChannels(): 2 -> 2
PlayBackDialog::setBitsPerSample(): 16 -> 16
PlayBackDialog::setChannels(): 2 -> 2
PlayBackDialog::setMethod('alsa' [0])
SAVE:    'alsa' (0) -> ''
playback method 'alsa' (0) not supported -> falling back to 'qt_audio' (2)
    method has changed: 0 -> 2
```
Comment 3 Bug Janitor Service 2024-10-08 03:00:31 UTC
A possibly relevant merge request was started @ https://invent.kde.org/multimedia/kwave/-/merge_requests/33
Comment 4 Thomas Eschenbacher 2024-10-09 16:06:22 UTC
Git commit c8af6e4bae1746bf9c6948f5eddd3b8ecde0ea71 by Thomas Eschenbacher, on behalf of Mark Penner.
Committed on 09/10/2024 at 16:01.
Pushed by eschenbacher into branch 'master'.

make sure a valid method gets selected when PlayBackDialog opens

M  +6    -3    plugins/playback/PlayBackDialog.cpp

https://invent.kde.org/multimedia/kwave/-/commit/c8af6e4bae1746bf9c6948f5eddd3b8ecde0ea71