Skip to content

Commit

Permalink
Fix possible sound problems on Linux (Qt)
Browse files Browse the repository at this point in the history
  • Loading branch information
vpyk committed Jan 13, 2025
1 parent 353643e commit eb9d9ca
Show file tree
Hide file tree
Showing 6 changed files with 124 additions and 124 deletions.
223 changes: 112 additions & 111 deletions doc/Emu80 v4 Manual.rtf

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions src/Version.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Emu80 v. 4.x
* © Viktor Pykhonin <pyk@mail.ru>, 2018-2024
* © Viktor Pykhonin <pyk@mail.ru>, 2018-2025
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand All @@ -19,8 +19,8 @@
#ifndef VERSION_H
#define VERSION_H

#define VER_STR "4.0.500"
#define VER_COMMA_SEP 4,0,500,0
#define VER_STR "4.0.501"
#define VER_COMMA_SEP 4,0,501,0

#define VI_FILE_DESCR "Emu80 executable"
#define VI_COPYRIGHT "Copyright © Viktor Pykhonin, 2016-2025"
Expand Down
10 changes: 4 additions & 6 deletions src/qt/qtAudioDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,13 @@
#include "qtAudioDevice.h"


EmuAudioIoDevice::EmuAudioIoDevice(int sampleRate/*, int frameRate*/) : QIODevice(nullptr)
EmuAudioIoDevice::EmuAudioIoDevice() : QIODevice(nullptr)
{
m_buffer = new QByteArray();
m_pos = 0;
/*if (frameRate == 0 || frameRate > 60)
frameRate = 60;*/
const int frameRate = 60; // !!!
m_minSamples = sampleRate / (frameRate - 6);
m_maxSamples = (sampleRate / (frameRate - 2)) * 5;

m_minSamples = 1024;
m_maxSamples = 4096;

memset(m_buf, 0, sizeof(m_buf));
}
Expand Down
4 changes: 2 additions & 2 deletions src/qt/qtAudioDevice.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Emu80 v. 4.x
* © Viktor Pykhonin <pyk@mail.ru>, 2017-2024
* © Viktor Pykhonin <pyk@mail.ru>, 2017-2025
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand All @@ -26,7 +26,7 @@ class EmuAudioIoDevice : public QIODevice
Q_OBJECT

public:
EmuAudioIoDevice(int sampleRate/*, int frameRate*/);
EmuAudioIoDevice();
//~EmuAudioIoDevice();

void addSample(int16_t sample); // mono
Expand Down
2 changes: 1 addition & 1 deletion src/qt/qtPal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ void palStart()
#endif

audio->setBufferSize(sampleRate / 5);
audioDevice = new EmuAudioIoDevice(sampleRate/*, frameRate*/);
audioDevice = new EmuAudioIoDevice();
audioDevice->start();
audio->start(audioDevice);

Expand Down
3 changes: 2 additions & 1 deletion whatsnew.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
! Известная проблема


Изменения в текущей git-версии:
Изменения в версии 4.0.501:

- Исправлена ошибка загрузки мультиблочных LVT-файлов на ПК "Львов"
- Исправлено возможное пропадание звука на Linux
- Исправлена работоспособность wx/sdl и lite-версий на Linux
- Исправлена ошибка при сборке с помощью MSVC 2015
- Исправлена передача в командной строке Windows-версий файлов, содержащих в пути кириллицу или другие unicode-символы
Expand Down

0 comments on commit eb9d9ca

Please sign in to comment.