feishin
feishin copied to clipboard
Feishin cannot play media - Mpv Socket is closed
Expected Behavior
Feishin should play media.
Current Behavior
Currently, Feishin is unable to produce media for myself on Windows 11. It was working fine, but I am not sure what changed. From the console log it seems that Mpv isn't functioning properly.
Console log:
C:\Users\jhoncen\AppData\Local\Programs\feishin>
13:59:18.151 > Checking for update
Initializing MPV with data: {
extraParameters: [],
properties: {
speed: 1,
'audio-exclusive': 'no',
'gapless-audio': 'weak',
replaygain: 'no',
'replaygain-clip': true,
'replaygain-preamp': 0
}
}
Setting mpv params: [
'--idle=yes',
'--no-config',
'--load-scripts=no',
'--prefetch-playlist=yes'
]
Error in main process Error: Socket is closed
at new NodeError (node:internal/errors:399:5)
at Socket._writeGeneric (node:net:920:8)
at Socket._write (node:net:942:8)
at writeOrBuffer (node:internal/streams/writable:392:12)
at _write (node:internal/streams/writable:333:10)
at Socket.Writable.write (node:internal/streams/writable:337:10)
at C:\Users\jhoncen\AppData\Local\Programs\feishin\resources\app.asar\dist\main\main.js:14:343343
at new Promise (<anonymous>)
at l.send (C:\Users\jhoncen\AppData\Local\Programs\feishin\resources\app.asar\dist\main\main.js:14:343069)
at l.setProperty (C:\Users\jhoncen\AppData\Local\Programs\feishin\resources\app.asar\dist\main\main.js:14:342089) {
code: 'ERR_SOCKET_CLOSED'
}
MPV failed to set volume {
errcode: 8,
verbose: 'MPV is not running',
method: 'volume()',
stackTrace: 'Error: \n' +
' at e.exports.errorMessage (C:\\Users\\jhoncen\\AppData\\Local\\Programs\\feishin\\resources\\app.asar\\dist\\main\\main.js:14:340955)\n' +
' at C:\\Users\\jhoncen\\AppData\\Local\\Programs\\feishin\\resources\\app.asar\\dist\\main\\main.js:14:343165\n' +
' at new Promise (<anonymous>)\n' +
' at l.send (C:\\Users\\jhoncen\\AppData\\Local\\Programs\\feishin\\resources\\app.asar\\dist\\main\\main.js:14:343069)\n' +
' at l.setProperty (C:\\Users\\jhoncen\\AppData\\Local\\Programs\\feishin\\resources\\app.asar\\dist\\main\\main.js:14:342089)\n' +
' at y.setProperty (C:\\Users\\jhoncen\\AppData\\Local\\Programs\\feishin\\resources\\app.asar\\dist\\main\\main.js:14:344520)\n' +
' at y.volume (C:\\Users\\jhoncen\\AppData\\Local\\Programs\\feishin\\resources\\app.asar\\dist\\main\\main.js:14:346750)\n' +
' at IpcMainImpl.<anonymous> (C:\\Users\\jhoncen\\AppData\\Local\\Programs\\feishin\\resources\\app.asar\\dist\\main\\main.js:14:501125)\n' +
' at IpcMainImpl.emit (node:events:513:28)\n' +
' at WebContents.<anonymous> (node:electron/js2c/browser_init:2:88632)'
}
(node:11204) UnhandledPromiseRejectionWarning: #<Object>
(Use `Feishin --trace-warnings ...` to show where the warning was created)
(node:11204) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
Setting MPV properties: {
speed: 1,
'audio-exclusive': 'no',
'gapless-audio': 'weak',
replaygain: 'no',
'replaygain-clip': true,
'replaygain-preamp': 0
}
MPV Event: status mute false []
MPV Event: status pause false []
MPV Event: status duration undefined []
MPV Event: status volume 100 []
MPV Event: status filename undefined []
MPV Event: status path undefined []
MPV Event: status media-title undefined []
MPV Event: status playlist-pos -1 []
MPV Event: status playlist-count 0 []
MPV Event: status loop false []
MPV failed to remove song from playlist {
errcode: 3,
verbose: 'ipcCommand invalid',
method: null,
arguments: [ 0 ],
errmessage: 'error running command',
stackTrace: 'Error: \n' +
' at e.exports.errorMessage (C:\\Users\\jhoncen\\AppData\\Local\\Programs\\feishin\\resources\\app.asar\\dist\\main\\main.js:14:340955)\n' +
' at e.exports.reject (C:\\Users\\jhoncen\\AppData\\Local\\Programs\\feishin\\resources\\app.asar\\dist\\main\\main.js:14:343787)\n' +
' at C:\\Users\\jhoncen\\AppData\\Local\\Programs\\feishin\\resources\\app.asar\\dist\\main\\main.js:14:341561\n' +
' at Array.forEach (<anonymous>)\n' +
' at l.dataHandler (C:\\Users\\jhoncen\\AppData\\Local\\Programs\\feishin\\resources\\app.asar\\dist\\main\\main.js:14:341300)\n' +
' at Socket.<anonymous> (C:\\Users\\jhoncen\\AppData\\Local\\Programs\\feishin\\resources\\app.asar\\dist\\main\\main.js:14:342761)\n' +
' at Socket.emit (node:events:513:28)\n' +
' at addChunk (node:internal/streams/readable:324:12)\n' +
' at readableAddChunk (node:internal/streams/readable:297:9)\n' +
' at Socket.Readable.push (node:internal/streams/readable:234:10)'
}
MPV Event: status pause true []
Steps to Reproduce
-
Open Feishin
-
Play Song
-
Nothing can be heard
Context
FYI I tried a few solutions on my own - uninstalling / reinstalling Feishin, trying past versions, using older / newer versions of Mpv (I am currently using the approved known good version). Still receiving the issue.
Your Environment
- Feishin 0.5.1
- Mpv 0.36.0
- Windows 11 Version 10.0.22621 Build 22621
- Jellyfin 10.8.12
Have you tried deleting this folder: C:\Users\jhoncen\AppData\Local\Programs\feishin\ when you uninstalled before reinstalling? That's the first thing id check in case some broken files persisted the uninstall.
Have you tried deleting this folder: C:\Users\jhoncen\AppData\Local\Programs\feishin\ when you uninstalled before reinstalling? That's the first thing id check in case some broken files persisted the uninstall.
Aye, I did. No luck, unfortunately.
I've experienced a similar issue on macOS, where I could view my entire library, but clicking the play button (or double clicking on media) resulted in no sound and a permanent "0:00" playtime marker stuck at the beginning of the song.
In my case, I had recently blown away my homebrew installation, and of course MPV disappeared. Oddly, I was still able to play media for a couple of days, so there must be some caching involved.
If you experience a similar issue, I strongly recommend uninstalling and reinstalling MPV, then double-checking that your MPV path hasn't been broken by a version update or something similar.
I've experienced a similar issue on macOS, where I could view my entire library, but clicking the play button (or double clicking on media) resulted in no sound and a permanent "0:00" playtime marker stuck at the beginning of the song.
In my case, I had recently blown away my homebrew installation, and of course MPV disappeared. Oddly, I was still able to play media for a couple of days, so there must be some caching involved.
If you experience a similar issue, I strongly recommend uninstalling and reinstalling MPV, then double-checking that your MPV path hasn't been broken by a version update or something similar.
Thank you for the advice. I did try to do this as well, tried multiple versions of MPV and changed the path correctly each time, tried different paths, tried clearing out all configuration data for Feishin and trying again. No luck. No idea what issue may be, and it works fine on my Linux system, but not on Windows.
One thing I would try is to run mpv standalone via with CLI and see if it works.
One thing I would try is to run mpv standalone via with CLI and see if it works.
Aye, it works fine when I run it through the CLI.
I just ran into this issue. For me, it looks like the app is resolving the symlink from /opt/homebrew/bin/mpv
to the specific version directory. When old mpv version gets cleaned up, it breaks playback. Could it be changed to not resolve symlinks?
I had the same issue. I noticed that feishin was compIaining about missing the connection to \\.\pipe\mpvserver
, so I solved this by running mpv like this: mpv.exe --input-ipc-server \\.\pipe\mpvserver
. This creates another window however (mpv), but the audio comes through. Maybe someone with more insight can help out.
Another observation: I had to run Feishin in a terminal with administrator rights
In my case, I experienced this on windows 11 after installing Feishin and MPV.
I first installed MPV via chocolatey and experienced Feishin not playing the music i selected after pointing Feishin to mpv via Feishin's settings.
To resolve this I:
- Uninstalled mpv via chocolatey
- Closed Feishin
- Installed MPV via Sourceforge
- Looked up MPV in the start menu
- Opened it's file location which showed a shortcut
- Right clicked, selected properties
- Copied the filepath that the shortcut points to
- Updated MPV's path in Feishins settings
- IMPORTANT: Open MPV via start menu, it gives a warning that the program can't be trust.
- Click more info
- Click run anyways
- MPV should open, asking you to drag and drop audio to it to play something
- Close MPV
- Relaunch Feishin
- Audio plays
The issue, as far as i see it, is that Windows 11 blocks MPV from being launched by Feishin until the user instructs Windows 11 to trust MPV. Unfortunately, there is no way to instruct Windows 11 to trust MPV from Feishin. You must launch MPV first yourself.
If others can confirm this fixes their issue, it may be worth documenting this for other new users.
That fixed it for me! It's working fine by simply downloading the Sourceforge version and installing it in my Downloads folder (temporary), pointing Feishin there instead of to Chocolatey's version, and restarting Feishin (required). I thought it might've been a permission issue with Chocolatey's version, but moving the Sourceforge version into C:/ProgramData
still works, and running Feishin as admin with Chocolatey's version still doesn't work.
Here's my experience so far:
OSX: Works fine. Installed MPV via homebrew. Pointed Feishin to use mpv installed at which mpv | pbcopy
.
Windows 11: Had to follow the steps I outlined above.
Windows 10: Sadly I haven't been able to get it to work. I've tried mpv installed from Sourceforge and Scoop. Neither worked. Web playback works but the sound quality is terrible.
Feishin version 0.5.3.
Something definitely seems off. I'm also not sure @Recolate got the console log output. I'm also not able to see find any error logs in the electron browser debugger relating to feishin struggling with mpv. I'll have to install feishin from source and run it from my terminal, I'm assuming the feishin is using mpv via node, not the frontend.
Same issue with latest Feishin v0.5.3, Jellyfin v10.8.13, and MPV v0.37.0 in Windows 10, hope there could be a solution.
Not a fix, but on Windows 10 if I click play on an album/song twice, it plays and everything works afterwards. If I only double click it once, it doesn't play as stated above.
Not a fix, but on Windows 10 if I click play on an album/song twice, it plays and everything works afterwards. If I only double click it once, it doesn't play as stated above.
I think you misunderstood this issue, it’s not the same thing. It is true that there needs two double click to play properly, but this issue is that no matter how you click and trigger that, it won’t play, something that can prove this is that the Web Backend Audio Player can be played without error, and if you change to the MPV backend, there would be socket error shown in the terminal, and the time bar is not played neither in Feishin, nor detected in Jellyfin (If you play properly, there will be a synced real-time time bar shown in Jellyfin). I would say it might be some error related to the MPV backend in Feishin. Sorry if any incorrect terminology wording, I’m not a pro in this.
~~When I say double click I'm referring to double clicking on the track or album twice. I've had mpv get stuck on a socket error before similarly to what was described in this issue, but at least on windows double clicking twice (so 4 clicks) on a track gets mpv running again for me.~~
~~Granted, if that still doesn't work then I'm probably having another issue with similar behavior.~~
nevermind, i misread your entire sentence right there my bad
~When I say double click I'm referring to double clicking on the track or album twice. I've had mpv get stuck on a socket error before similarly to what was described in this issue, but at least on windows double clicking twice (so 4 clicks) on a track gets mpv running again for me.~
~Granted, if that still doesn't work then I'm probably having another issue with similar behavior.~
nevermind, i misread your entire sentence right there my bad
Ah I think that’s a real issue too. I met the same problem with you a few versions before. It’s like the first double click is not responsive.
I was able to reproduce this error on my end on one system (windows 10) with winget mpv, but not on another system with a different mpv install. Specifically, the issue is that while I am able to run mpv outside feishin, it just hangs immediately when spawning in electron. Can you try:
- Using a build from https://drive.proton.me/urls/TM0VYW1304#oSG4D4otiA5F (there are a few fixes, notably one that makes MPV initialization more synchronous now).
- Use the MPV build from https://sourceforge.net/projects/mpv-player-windows/files/ (choose 64bit/64bit-v3). With this version I was able to start MPV in a clean windows 10 environment.
I do not see the same issue on Windows 11, and I'm not sure what the issue is preventing the executable from running on 10. I'll look into providing a way to run Feishin without MPV
I was able to reproduce this error on my end on one system (windows 10) with winget mpv, but not on another system with a different mpv install. Specifically, the issue is that while I am able to run mpv outside feishin, it just hangs immediately when spawning in electron. Can you try:
- Using a build from https://drive.proton.me/urls/TM0VYW1304#oSG4D4otiA5F (there are a few fixes, notably one that makes MPV initialization more synchronous now).
- Use the MPV build from https://sourceforge.net/projects/mpv-player-windows/files/ (choose 64bit/64bit-v3). With this version I was able to start MPV in a clean windows 10 environment.
I do not see the same issue on Windows 11, and I'm not sure what the issue is preventing the executable from running on 10. I'll look into providing a way to run Feishin without MPV
Hi, thanks for the fix! With this special version of Feishin, the socket warning no longer exists. But the audio could still not be played, and here is the command line output.
PS C:\Users\ENDzZ\AppData\Local\Programs\feishin> 21:30:42.737 > Checking for update
Initializing MPV with data: {
extraParameters: [],
properties: {
speed: 1,
'audio-exclusive': 'no',
'gapless-audio': 'weak',
replaygain: 'no',
'replaygain-clip': true,
'replaygain-preamp': 0
}
}
Setting mpv params: [
'--idle=yes',
'--no-config',
'--load-scripts=no',
'--prefetch-playlist=yes'
]
21:31:14.992 > Error: Error: net::ERR_TIMED_OUT
at SimpleURLLoaderWrapper.<anonymous> (node:electron/js2c/browser_init:2:50076)
at SimpleURLLoaderWrapper.emit (node:events:514:28)
(node:27436) UnhandledPromiseRejectionWarning: Error: net::ERR_TIMED_OUT
at SimpleURLLoaderWrapper.<anonymous> (node:electron/js2c/browser_init:2:50076)
at SimpleURLLoaderWrapper.emit (node:events:514:28)
(Use `Feishin --trace-warnings ...` to show where the warning was created)
(node:27436) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
I always use sourceforge version mpv, so it seems not only related to winget version mpv? May I ask if there is a way to clean mpv and feishin environment? I only deleted C:\Users\Username\Local\Programs\feishin and C:\Users\Username\Roaming\feishin for cleaning, I don't know if there are any other directories to clean.
I was able to reproduce this error on my end on one system (windows 10) with winget mpv, but not on another system with a different mpv install. Specifically, the issue is that while I am able to run mpv outside feishin, it just hangs immediately when spawning in electron. Can you try:
- Using a build from https://drive.proton.me/urls/TM0VYW1304#oSG4D4otiA5F (there are a few fixes, notably one that makes MPV initialization more synchronous now).
- Use the MPV build from https://sourceforge.net/projects/mpv-player-windows/files/ (choose 64bit/64bit-v3). With this version I was able to start MPV in a clean windows 10 environment.
I do not see the same issue on Windows 11, and I'm not sure what the issue is preventing the executable from running on 10. I'll look into providing a way to run Feishin without MPV
Hi, thanks for the fix! With this special version of Feishin, the socket warning no longer exists. But the audio could still not be played, and here is the command line output.
PS C:\Users\ENDzZ\AppData\Local\Programs\feishin> 21:30:42.737 > Checking for update Initializing MPV with data: { extraParameters: [], properties: { speed: 1, 'audio-exclusive': 'no', 'gapless-audio': 'weak', replaygain: 'no', 'replaygain-clip': true, 'replaygain-preamp': 0 } } Setting mpv params: [ '--idle=yes', '--no-config', '--load-scripts=no', '--prefetch-playlist=yes' ] 21:31:14.992 > Error: Error: net::ERR_TIMED_OUT at SimpleURLLoaderWrapper.<anonymous> (node:electron/js2c/browser_init:2:50076) at SimpleURLLoaderWrapper.emit (node:events:514:28) (node:27436) UnhandledPromiseRejectionWarning: Error: net::ERR_TIMED_OUT at SimpleURLLoaderWrapper.<anonymous> (node:electron/js2c/browser_init:2:50076) at SimpleURLLoaderWrapper.emit (node:events:514:28) (Use `Feishin --trace-warnings ...` to show where the warning was created) (node:27436) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
I always use sourceforge version mpv, so it seems not only related to winget version mpv? May I ask if there is a way to clean mpv and feishin environment? I only deleted C:\Users\Username\Local\Programs\feishin and C:\Users\Username\Roaming\feishin for cleaning, I don't know if there are any other directories to clean.
Yeah, looks like similar issue (Feishin unable to spawn mpv). Just to confirm, are you able to manually run the mpv
executable?
If you want to delete all data from Feishin, you can delete C:\Users\YourUsername\AppData\Roaming\Feishin
Yeah, looks like similar issue (Feishin unable to spawn mpv). Just to confirm, are you able to manually run the
mpv
executable? If you want to delete all data from Feishin, you can deleteC:\Users\YourUsername\AppData\Roaming\Feishin
Yep, I'm able to manually run the mpv executable and drag audio to play normally. A bit more information if it helps: I tried closing the firewall and giving the administrator permission, but it seemed useless.
No, firewall/admin permissions are unrelated as far as I can tell. Can you try https://drive.proton.me/urls/TM0VYW1304#oSG4D4otiA5F (new builds)? Note that it may reset some of your settings again. Notably, MPV should be detected properly if it's on your path (and there is additional logging now)
No, firewall/admin permissions are unrelated as far as I can tell. Can you try https://drive.proton.me/urls/TM0VYW1304#oSG4D4otiA5F (new builds)? Note that it may reset some of your settings again. Notably, MPV should be detected properly if it's on your path (and there is additional logging now)
Hi, here is the new log after re-installing.
PS C:\Users\ENDzZ\AppData\Local\Programs\feishin> ./Feishin.exe
PS C:\Users\ENDzZ\AppData\Local\Programs\feishin>
20:52:55.263 > [SYSTEM] Checking for update
20:52:56.310 > [AUDIO PLAYER] Attempting to initialize mpv with parameters: {"extraParameters":[],"properties":{"speed":1,"audio-exclusive":"no","gapless-audio":"weak","replaygain":"no","replaygain-clip":true,"replaygain-preamp":0}}
20:52:56.362 > [AUDIO PLAYER] Setting properties: {"speed":1}
20:53:27.729 > [SYSTEM] Error: Error: net::ERR_TIMED_OUT
at SimpleURLLoaderWrapper.<anonymous> (node:electron/js2c/browser_init:2:50076)
at SimpleURLLoaderWrapper.emit (node:events:514:28)
(node:17616) UnhandledPromiseRejectionWarning: Error: net::ERR_TIMED_OUT
at SimpleURLLoaderWrapper.<anonymous> (node:electron/js2c/browser_init:2:50076)
at SimpleURLLoaderWrapper.emit (node:events:514:28)
(Use `Feishin --trace-warnings ...` to show where the warning was created)
(node:17616) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
I think my last ask is, try this:
- Install winget/scoop/etc mpv (or make sure that
mpv
is on your path). - Completely reset settings settings
- Run this again, and do not set MPV path. Then switch from web player to MPV
Good news! The solution is to use the latest build of mpv from sourceforge, the one I tested is 20240211-git-f5c4f0b, there is no issue about audio play. But if I use any stable release build like 0.35.0, 0.35.1, 0.36.0, or even the latest 0.37.0, the issue persists. Maybe the issue is fixed in recent mpv development. But I have another issue encountered since I used Feishin, presented in every Feishin build, reminded by iiPythonx who have the same issue with me. You need to have two double-clicks on a song, two clicks on an album to play an audio in Feishin, etc. In brief, it's like the first play operation on an object you do after entering Feishin is useless and not responsive. Is this an issue you can reproduce, thanks. Maybe we should open another issue on this?
You need to have two double-click on a song or two click on an album for example to play an audio in Feishin. In brief, it's like the first double-click or click on an object is useless and not responsive.
I've had this issue forever on Windows and one of my Linux boxes, but strangely another one of them DOES work first try.
Might be a Feishin issue but I'm not sure, they all have the same MPV version (0.37).
(granted that's another issue altogether so I'm avoiding putting too much in this topic)
But I have another issue encountered since I used Feishin, presented in every Feishin build, reminded by iiPythonx who have the same issue with me. You need to have two double-clicks on a song, two clicks on an album to play an audio in Feishin, etc. In brief, it's like the first play operation on an object you do after entering Feishin is useless and not responsive. Is this an issue you can reproduce, thanks. Maybe we should open another issue on this?
There have been reports of this before (#210). I was able to fix it (at least on my system) and since then I've never been able to reproduce it. I would need someone who's still experiencing the issue to actually debug it from their side.
Any easy way to test would be to set audio_only
to false and check mpv's playback state and queue directly when adding songs from Feishin on startup.
https://github.com/jeffvli/feishin/blob/20b161ee864747773e0f46484adbb1aab067007a/src/main/features/core/player/index.ts#L96
Good news! The solution is to use the latest build of mpv from sourceforge, the one I tested is 20240211-git-f5c4f0b, there is no issue about audio play. But if I use any stable release build like 0.35.0, 0.35.1, 0.36.0, or even the latest 0.37.0, the issue persists. Maybe the issue is fixed in recent mpv development. But I have another issue encountered since I used Feishin, presented in every Feishin build, reminded by iiPythonx who have the same issue with me. You need to have two double-clicks on a song, two clicks on an album to play an audio in Feishin, etc. In brief, it's like the first play operation on an object you do after entering Feishin is useless and not responsive. Is this an issue you can reproduce, thanks. Maybe we should open another issue on this?
I think I should mention this: I re-installed build 0.5.3 from GitHub Releases, and it seemed that the socket error is still presented in the log, but the audio can be played without any problem. While the new build provided (https://drive.proton.me/urls/TM0VYW1304#oSG4D4otiA5F) could prevent the socket error from happening. So, the new build is actually fixing something, yet might not necessarily be related to this issue.
Any easy way to test would be to set
audio_only
to false and check mpv's playback state and queue directly when adding songs from Feishin on startup.https://github.com/jeffvli/feishin/blob/20b161ee864747773e0f46484adbb1aab067007a/src/main/features/core/player/index.ts#L96
Sorry but where can I set audio_only
to false? Is this a setting in Feishin?
Any easy way to test would be to set audio_only to false and check mpv's playback state and queue directly when adding songs from Feishin on startup.
Seems like MPV loads the stream just fine but then never plays:
https://github.com/jeffvli/feishin/assets/35084023/5dd4f494-115c-4338-9446-4c2adb4b1d23
Also, mpv --version
doesn't do anything for me on Windows. Not sure why, but pretty sure that's why Feishin is defaulting back to web.