Internal Device Error when playing sound after plugging/unplugging headphones - (R2018b 9.5.0.944444)
119 次查看(过去 30 天)
显示 更早的评论
Device used: Macbook Pro 2018 10.14.3
Matlab version: R2018b 9.5.0.944444
I am encoutering an error when using the sound/soundsc functions in Matlab, after plugging in (or unplugging) headphones. Matlab properly plays sound prior to plugging/unplugging them, but will throw the following error after, even if I began with them unplugged, and later plug them back in. Restarting Matlab fixes the issue with headphones in OR out, until plugging/unplugging headphones again.
My code:
fsamp = 11025;
dt = 1/fsamp;
dur = 1.8;
tt = 0:dt:dur;
psi = 2*pi*(500*tt.*tt + 200*tt);
xx = real(7.7*exp(1j*psi));
soundsc(xx,fsamp);
Error:
Error using sound (line 76)
Device Error: Internal Device Error
Error in soundsc (line 55)
sound(varargin{:});
Debugging the sound function shows me that the exception is thrown from line 74 in sound:
play(playerObj(end));
But I am unable to figure it out beyond this. I have checked the audioplayer and audioDeviceWriter objects, and they properly update when the headphones are plugged/unplugged. I'm not sure how related they are to this issue, and am wondering if this could be a Mac issue?
Any help or direction is appreciated,
E Blagg
16 个评论
Hugo Hugo
2022-11-24
Why is this issue still present in 2022a after 4 years? MacOS Ventura 13.0.1
The only workaround I have so far is to get the first device that's not bugged via audiodevinfo(0, 44100, 24, 1)
回答(2 个)
Jon Nissenbaum
2022-12-11
I don't know if others are still facing this issue. Previously I was plagued by it all the time and the only recourse was to quit and restart Matlab. More recently (version R2022a, MacOS 12.4), I no longer seem to get the error, but Matlab still does not recognize when I plug in headphones. In case this is happening to anyone else, I am now able to solve this problem by typing audiodevreset
2 个评论
Hugo Hugo
2022-12-11
Interesting, I’m still getting it with 2022a and MacOS 13.0.1. I’ll see if audiodevreset solves the bug.
Emily King
2023-11-13
Thank you! This is still an issue with 2023b and MacOS 14.1.1, but your solution fixes it.
Rishabh Gupta
2019-3-4
Hi Ethan,
I think the issue requires some detail investigation. I would suggest you to contact MathWorks Technical Support.
Thanks
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Startup and Shutdown 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!