OpenShot / openshot-qt

OpenShot Video Editor is an award-winning free and open-source video editor for Linux, Mac, and Windows, and is dedicated to delivering high quality video editing and animation solutions to the world.
http://www.openshot.org
Other
4.36k stars 544 forks source link

Audio out of sync - preferences will not save #5644

Open paulyingling opened 4 weeks ago

paulyingling commented 4 weeks ago

Describe the bug: Audio from imported video is delayed approximately 1 second on start and delayed 1 second after pressing pause. Changed playback audio device (preferences > preview > playback audio device) from default to windows audio: desktop speakers). when reopening Openshot the default preference for audio has not been retained

Steps to reproduce the behavior:

  1. Import video with audio
  2. place on time line
  3. play in preview (audio will be delayed on start)
  4. press pause in preview (audio will be delayed to stop)
  5. verified default audio sample rate is the same as video (48000) in preferences > preview
  6. changed playback audio device from default to windows audio: desktop speakers (preferences > Preview > playback audio device)
  7. closed Openshot for preferences to take effect
  8. reopened Openshot
  9. selected edit > preferences > preview - changed default audio did not save

Expected behavior: Expect audio to be synched with video since it is from the same source after editing playback audio device and restarting Openshot

System Details:

Preferences before change image Preferences after change image Closed Openshot after saving and restarted openshot. Preferences reverted to default. image

Colorjet3 commented 4 weeks ago

Hello @paulyingling. I need some clarification in your testing steps so I can try and replicate your issue.

Step 1: Before you execute step one to import a video file are you starting openshot and opening up an existing project or are you just starting with a new project ("Untitled Project")?

Step 7: When you close OpenShot, it will ask you to restart OpenShot for the change to take effect. So you click OK on that prompt and then when you close OpenShot it should ask you if you want to "Save changes to project before closing?". What do you select here (Yes or No)?

I went ahead and did some testing myself in my Winodws 11 Pro environment using the latest dev daily build #12980. Test 01

  1. Start OpenShot. Do not open a project or import any files at this time.
  2. Go to Edit | Preferences | Preview | and at the bottom of the screen click on "Restore Defaults: Preview". This just ensures that OpenShot is back to it original/default settings.
  3. Restart OpenShot.
  4. Go to Edit | Preferences | Preview and note that the "Playback Audio Device" is set to "Default".
  5. Change the "Playback Audio Device" from Default to "Windows audio: Speakers (.....)" and click Click Close.
  6. You are prompted to restart OpenShot. Click OK and Restart Openshot.
  7. Go to Edit | Preferences | Preview and note that the "Playback Audio Device" is still set to Step 5.
  8. Change the "Playback Audio Device" to "DirectSound: Primary Sound Driver", Click OK, Restart OpenShot.
  9. Go to Edit | Preferences | Preview and note that the "Playback Audio Device" is still set to "DirectSound: Primary Sound Driver".

This means the Preview settings are being preserved in this test.

Test 02

  1. Start OpenShot, Go to Edit | Preferences | Preview, Click on "Restor Defaults: Preview".
  2. Restart OpenShot.
  3. Import a video/audio file.
  4. Preview on the timeline (no dealy in audio experienced by my testing).
  5. Press Pause in preview. No delay in the pause function. audio stops immediately.
  6. Default sample rate is still at 48000.
  7. Changed playback audio device from "Default" to "Windows Audio: Speakers".
  8. Restarted OpenShot but did NOT save the project.
  9. Verified that the playback audio device was still set to "Windows Audio: Speakers".
  10. Imported a video/audio file and saved it as a project.
  11. Dragged the video file onto the track and previewed and paused without any issues.
  12. Saved the project again.
  13. Changed the playback audio device to "Default" and clicked OK for the restart prompte due to audio change.
  14. Restarted Openshot and did not get prompted to save teh project because I already did in setep 12 and didn't make any other changes other than the playback audio.
  15. Did not open the project yet.
  16. Go to Edit | Preferences | Preview and verified that the playback audio device is still set to "Default" (step 13) and it is.
  17. Opened my saved project and confirmed the playback audio device to be still set to "Default".

I am wondering if you have some kind of a lock on the c:\users\username.openshot_qt\openshot.settings file.

Please do this:

  1. Start OpenShot and confirm that the build # is 12980. This is the latest dev daily build (openshot.org/download/#daily).
  2. Close OpenShot if running.
  3. Make a backup of c:\users\username.openshot_q\openshot.settings file.
  4. Delete c:\users\username.openshot_qt\openshot.settings file.
  5. Start OpenShot and run through Test 01 testing steps.

Let me know how things are working.

paulyingling commented 4 weeks ago

Thanks for looking into this.

To answer your questions for Step 1, I have discovered the error to replicate with both an existing project and with a new project. Therefore the error will reproduce in all cases.

For Step 7 I have tried both methods you list whereas I click the OK prompt for restarting and then I have selected both Yes and No on separate occasions of saving the project before closing. Both result in the Property value not being saved to change the audio setting.

I'll go ahead and perform the steps you recommend for troubleshooting then report the findings. I will post them within the next 12 hours. Thanks again for your expertise in troubleshooting.

paulyingling commented 4 weeks ago

So here are the results and process:

Test 1

Updated to daily build image

Step 4. Playback Audio Device is set to "Direct Sound: Primary Sound Driver" and not "Default" > Changed to Windows Audio: (...) Step 7: Playback Audio Device reverted back to "Direct Sound: Primary Sound Driver" before accomplishing Step 8.

Test Results > Audio is still delayed as originally posted with both new OpenShot build and established OpenShot build.. Playback Audio device reverted to Direct Sound unprompted.

Test 2

Still in Daily Build as above.

Beginning at Step 4, there is still audio delay with starting and pause. At Step 6 verified 48000 but the Audio Playback Device reverted to DirectSound: Primary Sound Driver Changed setting in Step 7 to Windows Audio and restarted without saving as in Step 8 - ther playback audio again reverts to DirectSound. Since it continues to revert, I stopped testing Test 2.

Recommended Follow up steps 1-5

  1. Confirmed build 12980
  2. Closed OpenShot
  3. Backup created
  4. Deleted C drive settings file
  5. Running Test 1 - RESULTS BELOW

Test 3 Results

Completed Steps 1-3 Step 4. Playback Audio settings NOT set to "Default" Is set to DirectSound Primary Sound Driver. Selected "Default" Restarted OpenShot. Ran through Step 4 again. Playback Settings returned to "DirectSound: Primary Sound Driver.

And this is the problem I was originally seeing and had also attempted to troubleshoot. Continued to Step 5 and 6.

Step 7. Selection has reverted to DirectSound and did not hold selection of Windows Audio.

Imported video/audio fole - same results of delayed Audio.

Hope this helps and isn't too confusing. Are there other steps you would recommend taking to continue troubleshooting since the problem seems to be with the retention of the Preferences?

Colorjet3 commented 4 weeks ago

Thank you for the information you provided.

Did you try this:

"Please do this:

  1. Start OpenShot and confirm that the build # is 12980. This is the latest dev daily build (openshot.org/download/#daily).
  2. Close OpenShot if running.
  3. Make a backup of c:\users\username.openshot_q\openshot.settings file.
  4. Delete c:\users\username.openshot_qt\openshot.settings file.
  5. Start OpenShot and run through Test 01 testing steps."
paulyingling commented 4 weeks ago

Yes, I'm sorry about the lack of clarity - that was what "Test 3 results" were.

Colorjet3 commented 3 weeks ago

Hmmm....not sure why you are having this issue.

  1. Is this a laptop or computer?
  2. Are you using headphones or speakers?
  3. Using the latest dev daily build #12980, please make some other changes in Edit | Preferences (other than the Preview tab) and see if those changes are saved when you restart OpenShot.
  4. Did you by any chance upgrade from a previous version (2.5.x or 2.6.x) or was this the first time you are installing OpenShot v3.x.x?
paulyingling commented 3 weeks ago

I'm not sure why I'm having the issue either :D So to answer the questions:

  1. I'm having the issue on the desktop. Specs are listed in the first post. It is a new computer with a lot of processing power running windows 11. I am not having the issue on my laptop which is older with less processing power and running Windows 10.

  2. I'm always running speakers on the desktop. They're Logitech Z313 which is a 2.1 surround sound plugged into the assigned input/output female recepticle.

  3. Made changes in Preferences: Default Profile in Preferences > Preview. Result: kept setting after close and restart. Autosave History limit in Preferences > Autosave. Result: kept setting after close and restart. Changed Cache pre roll: max frames in Preferences > Cache. Result: kept setting after close and restart.

Finally, rechecked Playback Audio Device and changed: Preferences > Preview. Reverted to DirectSound: Primary Sound Driver as in previous attempts.

  1. Since this is a new computer the first instance of OpenShot that was installed and downloaded was 3.2.1 build #12654 which is the same build installed on the laptop that has no issues. The laptop had previous releases/ versions before upgrading to 3.2.1 So this is one of the only differences between the two setups.

Thanks again for continuing to think of possible ways to resolve this issue. Cheers.

Colorjet3 commented 3 weeks ago

Ok. What you are telling me is that any other changes you make in Edit | Preferences are retained/saved when you restart OpenShot with the exception of "Playback Audio Setting".

Please provide me with a screen shot of your audio devices in Windows 11:

  1. In the Search box type Control Panel and press Enter.
  2. In the Sound section click on "Manage Audio Devices". A windows will be displayed with the title of "Sound" which will have all you audio devices listed.
  3. Take a screen shot and share it here.
paulyingling commented 3 weeks ago

I'd agree that all Edit | Preferences I change are saved with the exception of "Playback Audio Setting".

Here is a screenshot of the audio devices:

image

The Desktop Speakers are primary and always enabled/on for everyday use. They allow me to listen to music, play games and create videos with OpenShot.

Colorjet3 commented 3 weeks ago

Everything looks good. I am running out of ideas as to why this issue is persisting on this computer.

Something else to try is to reinstall the latest dev daily build by:

  1. Close Openshot, if running.
  2. Go to Add or Remove Programs, find OpenShot and uninstall it.
  3. Delete c:\users\username.openshot_qt folder.
  4. go to c:\program files\OpenShot Video Editor folder. If there are any files in there delete them all. This will require Administrative rights.
  5. Install the latest dev daily build #12980, as of this writing.
  6. Test again and see if the Preference for the "Playback Audio Setting" persists.
paulyingling commented 3 weeks ago

Well I certainly appreciate all the time you've taken so far to help.

I ran through all of the steps you listed and the issue continues to persist on the desktop using Windows 11 and the current Dev build #12980.

The preferences for playback audio setting will not save.

At this point 'll probably just use it on the laptop on the road and start learning KDen Live for the desktop...

Thanks again for the help. If you have any other suggestions I'll try them out as you post.

Colorjet3 commented 3 weeks ago

No worries @paulyingling. It has to be something simple that we are just unable to find.

I am going to keep this open in hopes the lead developer will review this and see if he can come up with other ideas.

Sprinkletoe commented 3 weeks ago

Hello, just wanted to chime in here! Hope that's okay. I found this thread through the bug report option, so rather than submit a brand new ticket, I thought it may be more helpful to add a comment.

I'm having the exact same issue as the original poster, word for word, including the bit about the audio settings that won't save. The issue persists on any project I use in OpenShot, even old ones that worked fine before, and I never had a similar issue previously. I've tried all the troubleshooting steps above and those on similar Reddit posts without success. My exports work fine without the audio delays--it's just that OpenShot's preview that isn't syncing for some reason. I hadn't used OpenShot for a month or two prior to yesterday, so it is definitely a fairly new issue. The only change to my computer in that time that I can think of is the typical Windows updates. Fingers crossed a solution is found! It is virtually unusable for me at the moment, but I would love to keep using the software in the future.

LettiScreams commented 3 days ago

Hi, I'm having this identical problem too, it started when I got a Windows update this past weekend.

Colorjet3 commented 3 days ago

Thank you @Sprinkletoe and @LettiScreams for reporting this issue as well.

Please confirm and do the following so I can have all the information I need for the lead developer.

  1. Please confirm your operating system/version (Windows 10 Pro? Ubuntu 22.04 lts? etc.?)
  2. Please confirm the version of OpenShot (help | about Openshot)?
  3. @LettiScreams - Please confirm that you have tried the troubleshooting steps provided in this thread.
  4. @LettiScreams If possible, can you please rollback the Winodws updates from this past weekend and test again?

Here is another thing to try:

  1. Close OpenShot if running.
  2. Go to Add or Remove Programs and uninstall OpenShot. If you see 2 entries (this can happen if you upgraded from v2.x.x), then uninstall both.
  3. Make a backup of c:\users\username.openshot_qt folder.
  4. Delete c:\users\username.openshot_qt folder.
  5. Download a fresh copy of Openshot v3.2.1 (openshot.org) or download the latest dev daily build #12980 (development v3.2.1).
  6. Delete c:\program files\openshot video editor folder. This will requie administrative permissions.
  7. Install the new downloaded OpenShot v3.2.1.
  8. Before opening an existing project, go to Edit | Preferences | Preview tab and confirm and confirm that the "Playback Audio Device" is set to Default.
  9. Now change the Default to "Windows Audio: youraudiodevicename".
  10. Restart OpenShot.
  11. Confirm the "Playback Audio Device" setting, either way.

I have a Windows 11 Pro and I keep up with all the updates and for the life of me I am unable to replicate this problem. I also run Windows 11 Home and Windows 10 Pro in an Oracle Virtualbox environment and I can not replicate the issue there either. However, the Oracle Virtualbox guest sessions have different audio device/drivers so things behave slightly differently in those environments.

Any way, I really appreciate any additional information you can provide so I can add it to the submitted issue that is in the queue.

MiGrandjean commented 2 days ago

I came across this yesterday for the first time. I'm running OpenShot 3.2.1 on Windows 11 Home (24H2), and I went through the troubleshooting steps provided above, including removing everything and installing the latest daily build. But something keeps resetting the "Playback Audio Device" to a "DirectSound" device when opening OpenShot.

I tried a couple of things and even made a video about it: https://youtu.be/m--tig2hAT8

Colorjet3 commented 2 days ago

Hello @paulyingling Please confirm your Windows 11 version (Home, Pro, etc.) and the version (23h2? 24h2?).

From the desktop, type "about your pc", excluding the quote and run it. Provide the Edition and Version.

Colorjet3 commented 2 days ago

Thank you @MiGrandjean for all the information you provided. I will be referencing this thread in the posted issue ticket for the lead developer to review.

Colorjet3 commented 2 days ago

Hello @Sprinkletoe & @LettiScreams

Please confirm your Windows 11 version (Home, Pro, etc.) and the version (23h2? 24h2?).

From the desktop, type "about your pc", excluding the quote and run it. Provide the Edition and Version.

Also, don't forget to go through the troubleshooting steps I provided above.

LettiScreams commented 2 days ago

Hi, I'm on Windows 11 Home and I went back to 23H2 earlier, which seems to have solved my problem. It was definitely the 24H where things went wrong. I can confirm I tried the initial troubleshooting steps mentioned in this thread.

Colorjet3 commented 2 days ago

Hi @LettiScreams Thank you so much for the update. My system has not yet received the 24H2 update.

@Sprinkletoe, @MiGrandjean, and @paulyingling Can you guys also rollback your environments back to 23H2 and see if that resolves the issue? This will help the lead developer to better understand the 24H2 upgrade and see why the conflict with OpenSHot?

Colorjet3 commented 2 days ago

I did a quick search on Windows 11 24H2 update and it looks like Microsoft has stopped the deployment which explains why I don't have it yet. There seems to be lots of issues with 24H2 so I really would like to see you guys rolling back the 24H2 and see if the issue with OpenShot disappears.

MiGrandjean commented 1 day ago

Can you guys also rollback your environments back to 23H2 and see if that resolves the issue? This will help the lead developer to better understand the 24H2 upgrade and see why the conflict with OpenSHot?

Can confirm, went back to 23H2 and now I can change the "Playback Audio Device" to a "Windows Sound" device and it stays that way :) No more audio lag after restarting OpenShot.

For everyone else: Looks like you have to be quick, apparently you can only rollback the 24H2 update for 10 days after it gets installed.

If anyone wonders how to do it (I didn't have to rollback an update since Windows 7): Go to Settings (pressing Windows + I) and then go to Windows Update > Advanced Options > Recovery > Go back. Worked like a charm for me, but please make sure to have a recent backup of your data, just in case.

Colorjet3 commented 1 day ago

Hello @MiGrandjean Thank you so much for rolling back, testing, and posting the results.

It is unfortunate that Microsoft is limiting the rollback to within 10 days only. I did a bit of research and it looks like the only way to go back to the previous version of Windows 11 (Pre 24h2) is to reinstall Win 11 from scratch. Meaning you need to make a copy of all your data, make a list of all your installed applications, and start over.

Let's hope that Microsoft figures things out sooner than later. I have not heard from the OpenShot lead developers so I am not sure if he might be able to figure out what is going on but it may not be in his control to fix this issue.

paulyingling commented 1 day ago

Hello @paulyingling Please confirm your Windows 11 version (Home, Pro, etc.) and the version (23h2? 24h2?).

From the desktop, type "about your pc", excluding the quote and run it. Provide the Edition and Version.

Thanks for looking into this and the posts following - I won't be home until December, so I'm going to miss that 10 day rollback window. But I'll look into things again when I return home.

Colorjet3 commented 1 day ago

No worries @paulyingling. I'll keep this open for a while until we see something from Microsoft regarding the 24H2 update.