-
Notifications
You must be signed in to change notification settings - Fork 129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Any way to select audio device through pyradio? #118
Comments
hi @hmm3 I suppose this could be done. I'm thinking about redesigning the "player selection" config window, adding the possibolity to pass command line parameters and have them saved in PyRadio's config file. We could even have a list of "profiles" that could be enabled or disabled as desired. In fact, the more I think about it, the more I like the idea! The only problem is that the user would be able to render the player unusable (if incorrect command line parameters are used). What do you think about it? |
I think the solution is perfect. I also assume anyone who is using pyradio is also sophisticated enough that they could fix any issues with misconfigurations, and for those who aren't, having a default config file that they can fall back on should be good enough. |
Glad we agree! ok, I'm putting this one on my TODO list... |
I started working on this one and I would like you to test it, if you don't mind So, I decided to have a command line parameter to pass "extra player parameters" (implemented) and have the player selection as well (not implemented yet). So here's what you do
Then execute
This should use your usb dac. If it does not, or if anything goes wrong, please do execute:
and post If you want to see what command |
Hi. Sorry didn't notice the update. I tried to git clone, etc. but the git fetch hmm3 returns the error "fatal: not a git repository (or any parent up to mount point /) Anyways. I just checked which files you modified and then modified the edits directly into my installed .local version. It looks like pyradio -epp "mpv:--audio-device='alsa/front:CARD=Audio,DEV=0'" is working with no problems! Thanks. |
Actually it looks like I spoke too soon. I forgot that I had edited the files to use a profile under the mpv config file, earlier, and was simply switching between mpv and vlc as a player to switch devices. After I did a reinstall of pyradio, and edited the files, it didn't work. Music still plays through my laptop speakers rather than through my usb dac. I used htop, and it looks like the extra parameters aren't being used by mpv. Here's the debug file2020-12-29 02:40:31,133 - pyradio.radio - ERROR - DE ========== |
ok, we are probably not in the right branch (my bad; the commands were not correct - sorry about that) So here's what you do
This should give you this output:
If it does not, we are not testing the code we want to test... If it does, just go on and repeat the test |
Ahh. I guess I don't know what I'm doing with git. I got all the above messages, etc., and devel/build_install_pyradio, but I couldn't find the executable. Anyways, I ended up doing pip3 install https://github.com/coderholic/pyradio/archive/hmm3.zip --user --upgrade and it ended up pulling the right files. It's somewhat working. If I use the command: pyradio -epp "mpv:--audio-device=alsa/front:CARD=Audio,DEV=0", it works. ps aux shows mpv --no-video --quiet --playlist=https://scenesat.com/listen/normal/max.m3u --input-ipc-server=/tmp/mpvsocket.42504 --audio-device=alsa/front:CARD=Audio,DEV=0 If I use the command: pyradio -epp "mpv:--audio-device='alsa/front:CARD=Audio,DEV=0'", it doesn't work. ps aux shows "mpv" with no commands running in the background. It's not a big deal, but using ' should also work, as I can run the command from the debug log: mpv --no-video --quiet --playlist=https://scenesat.com/listen/normal/max.m3u --input-ipc-server=/tmp/mpvsocket.41851 --audio-device='alsa/front:CARD=Audio,DEV=0' and it works with no problem. Thanks. |
This one blew me away! oh, ok, the single quote somehow breaks it. The good thing is that you got it to work! So I will continue with redesigning the players config window. |
I know I can try setting the audio device through e.g. mpv's config file, but because I sometimes use a usb dac, I would like to be able to simply be able to choose which audio device I want mpv to use when running pyradio.
E.g. pyradio -u "mpv --audio-device='alsa/front:CARD=Audio,DEV=0'"
Thanks.
The text was updated successfully, but these errors were encountered: