Skip to content
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

[regression] --audio-device doesn't work with ao=oss #4122

Closed
yurivict opened this issue Feb 8, 2017 · 11 comments
Closed

[regression] --audio-device doesn't work with ao=oss #4122

yurivict opened this issue Feb 8, 2017 · 11 comments

Comments

@yurivict
Copy link

yurivict commented Feb 8, 2017

The argument -ao oss:device=/dev/dspN used to work. At some point options changed (https:/mpv-player/mpv/wiki/Option-replacement-list). It says --ao=oss:device => --audio-device (different semantics), but --ao=oss --audio-device=/dev/dspN doesn't play to that device.

@yurivict yurivict changed the title --audio-device doesn't work with ao=oss [regression] --audio-device doesn't work with ao=oss Feb 8, 2017
@kevmitch
Copy link
Member

kevmitch commented Feb 8, 2017

I think the key is in the "different semantics". I don't have working OSS to test, but it's probably something more like --audio-device='oss//dev/dspN. Check with --audio-device=help for the exact argument required.

@yurivict
Copy link
Author

yurivict commented Feb 8, 2017

This command doesn't even show the OSS devices

$ mpv --audio-device=help
List of detected audio devices:
  'auto' (Autoselect device)
  'pulse/oss_output.dsp0' (/dev/dsp0)
  'pulse/oss_output.dsp1' (/dev/dsp1)
  'pulse/oss_output.dsp2' (/dev/dsp2)
  'pulse/oss_output.dsp3' (/dev/dsp3)
  'pulse/oss_output.dsp4' (/dev/dsp4)
  'pulse/oss_output.dsp5' (/dev/dsp5)
  'oss' (Default)

'oss' shouldn't be the value for --audio-device. The correct values (/dev/dsp2, /dev/dsp3) aren't in this list.

@yurivict
Copy link
Author

yurivict commented Feb 8, 2017

I think it doesn't make sense to disable the old argument syntax when the new syntax has show-stopper problems like this.

@kevmitch
Copy link
Member

kevmitch commented Feb 8, 2017

Does my "guess" of --audio-device='oss//dev/dspN work? That should cause the oss code to open the /dev/dspN file if I'm reading the code right. It looks like the oss driver just doesn't have much in the way of code for listing the devices.

@yurivict
Copy link
Author

yurivict commented Feb 8, 2017

--audio-device=oss//dev/dspN doesn't work

@kevmitch
Copy link
Member

kevmitch commented Feb 8, 2017

Can you post a log generated with --log-file=verbose.log?

@yurivict
Copy link
Author

yurivict commented Feb 8, 2017

oss driver can list devices by listing /dev/ directory and selecting dspN parts.

@yurivict
Copy link
Author

yurivict commented Feb 8, 2017

[   0.005][v][cplayer] Command line options: '--log-file=verbose.log' '--ao=oss' '--audio-device=oss//dev/dsp1' 'http://xxx'
[   0.005][v][cplayer] mpv 0.23.0 (C) 2000-2016 mpv/MPlayer/mplayer2 projects
[   0.005][v][cplayer]  built on Tue Feb  7 19:19:52 PST 2017
[   0.005][v][cplayer] ffmpeg library versions:
[   0.005][v][cplayer]    libavutil       55.34.100
[   0.005][v][cplayer]    libavcodec      57.64.101
[   0.005][v][cplayer]    libavformat     57.56.100
[   0.005][v][cplayer]    libswscale      4.2.100
[   0.005][v][cplayer]    libavfilter     6.65.100
[   0.005][v][cplayer]    libswresample   2.3.100
[   0.005][v][cplayer] ffmpeg version: 3.2.2
[   0.005][v][cplayer] 
[   0.005][v][cplayer] Configuration: /usr/ports/multimedia/mpv/work/waf-waf-1.8.12/waf-light configure --docdir=/usr/local/share/examples/mpv --htmldir=/usr/local/share/doc/mpv/html --mandir=/usr/local/man --prefix=/usr/local --disable-debug-build --disable-d3d-hwaccel --disable-optimize --disable-pdf --disable-rubberband --disable-vaapi-wayland --disable-vapoursynth --disable-vapoursynth-lazy --disable-videotoolbox-hwaccel --disable-videotoolbox-gl --disable-wayland --enable-libmpv-shared --disable-lcms2 --lua=52fbsd --disable-manpage --disable-uchardet --enable-zsh-comp --disable-cdda --disable-libbluray --disable-libsmbclient --disable-caca --disable-alsa --disable-jack --disable-sdl2 --disable-sndio --prefix=/usr/local -j8
[   0.005][v][cplayer] List of enabled features: any-gl asm atomics audio-input avcodec-chroma-pos-api avframe-metadata avframe-skip-samples avutil-mastering-metadata bsd-fstatfs bsd-thread-name build-date c11-tls cplayer dlopen dvbin dvdnav dvdread egl-helpers egl-x11 encoding fchmod gbm gbm.h gcc-tls gl gl-x11 glob gnuc iconv jpeg libass libass-osd libav libavdevice libavfilter libdl libm libmpv-shared librt libswresample libv4l2 lua nanosleep oss-audio oss-audio-native plain-gl posix posix-or-mingw posix-spawn pthreads pulse resampler shm standard-gl stdatomic subprocess termios tv tv-v4l2 vaapi vaapi-egl vaapi-glx vaapi-hwaccel vaapi-x-egl vaapi-x11 vdpau vdpau-gl-x11 vdpau-hwaccel videodev x11 xext xinerama xrandr xss xv zlib zsh-comp
[   0.005][v][cplayer] Reading config file /home/yuri/.config/mpv/mpv.conf
[   0.005][v][cplayer] Setting option 'sub-paths' = 'ass:srt:sub:Sub:subs:Subs:subtitles:Subtitles' (flags = 4)
[   0.005][v][cplayer] Setting option 'log-file' = 'verbose.log' (flags = 8)
[   0.005][v][cplayer] Setting option 'ao' = 'oss' (flags = 8)
[   0.005][v][cplayer] Setting option 'audio-device' = 'oss//dev/dsp1' (flags = 8)
[   0.008][v][global] user path: 'verbose.log' -> 'verbose.log'
[   0.008][v][osc] Loading script @osc.lua...
[   0.008][v][global] config path: 'scripts' -/-> '/home/yuri/.config/mpv/scripts'
[   0.008][v][global] config path: 'scripts' -/-> '/home/yuri/.mpv/scripts'
[   0.008][v][global] config path: 'scripts' -/-> '/usr/local/etc/mpv/scripts'
[   0.008][v][osc] loading mp.defaults
[   0.009][v][osc] loading @osc.lua
[   0.012][v][global] config path: 'lua-settings/osc.conf' -/-> '/home/yuri/.config/mpv/lua-settings/osc.conf'
[   0.012][v][global] config path: 'lua-settings/osc.conf' -/-> '/home/yuri/.mpv/lua-settings/osc.conf'
[   0.012][v][global] config path: 'lua-settings/osc.conf' -/-> '/usr/local/etc/mpv/lua-settings/osc.conf'
[   0.012][v][osc] lua-settings/osc.conf not found. 
[   0.013][v][cplayer] Run command: define-section, flags=0, args=[showhide, mouse_move script-binding osc/__keybinding1
[   0.013][v][cplayer] mouse_leave script-binding osc/__keybinding2
[   0.013][v][cplayer] , force]
[   0.013][v][cplayer] Run command: enable-section, flags=0, args=[showhide, allow-hide-cursor+allow-vo-dragging]
[   0.013][v][cplayer] Run command: define-section, flags=0, args=[input, mouse_btn0 script-binding osc/__keybinding3
[   0.013][v][cplayer] shift+mouse_btn0 script-binding osc/__keybinding4
[   0.013][v][cplayer] mouse_btn2 script-binding osc/__keybinding5
[   0.013][v][cplayer] mouse_btn0_dbl ignore
[   0.013][v][cplayer] shift+mouse_btn0_dbl ignore
[   0.013][v][cplayer] mouse_btn2_dbl ignore
[   0.013][v][cplayer] , force]
[   0.013][v][cplayer] Run command: enable-section, flags=0, args=[input, ]
[   0.013][v][cplayer] Run command: define-section, flags=0, args=[input_osc, del script-binding osc/__keybinding6
[   0.013][v][cplayer] , default]
[   0.013][v][cplayer] Run command: enable-section, flags=0, args=[input_osc, allow-hide-cursor+allow-vo-dragging]
[   0.013][v][cplayer] Run command: define-section, flags=0, args=[input_forced_osc, , force]
[   0.013][v][cplayer] Run command: enable-section, flags=0, args=[input_forced_osc, allow-hide-cursor+allow-vo-dragging]
[   0.013][v][cplayer] Done loading @osc.lua.
[   0.013][v][ytdl_hook] Loading script @ytdl_hook.lua...
[   0.013][v][global] config path: 'scripts' -/-> '/home/yuri/.config/mpv/scripts'
[   0.013][v][global] config path: 'scripts' -/-> '/home/yuri/.mpv/scripts'
[   0.013][v][global] config path: 'scripts' -/-> '/usr/local/etc/mpv/scripts'
[   0.013][v][ytdl_hook] loading mp.defaults
[   0.014][v][cplayer] Run command: disable-section, flags=0, args=[input]
[   0.014][v][global] config path: 'fonts' -/-> '/home/yuri/.config/mpv/fonts'
[   0.014][v][global] config path: 'fonts' -/-> '/home/yuri/.mpv/fonts'
[   0.014][v][global] config path: 'fonts' -/-> '/usr/local/etc/mpv/fonts'
[   0.014][v][osd/libass] Shaper: FriBidi 0.19.7 (SIMPLE) HarfBuzz-ng 1.3.3 (COMPLEX)
[   0.014][v][global] config path: 'subfont.ttf' -/-> '/home/yuri/.config/mpv/subfont.ttf'
[   0.014][v][global] config path: 'subfont.ttf' -/-> '/home/yuri/.mpv/subfont.ttf'
[   0.014][v][global] config path: 'subfont.ttf' -/-> '/usr/local/etc/mpv/subfont.ttf'
[   0.014][v][global] config path: 'fonts.conf' -/-> '/home/yuri/.config/mpv/fonts.conf'
[   0.014][v][ytdl_hook] loading @ytdl_hook.lua
[   0.014][v][global] config path: 'fonts.conf' -/-> '/home/yuri/.mpv/fonts.conf'
[   0.014][v][global] config path: 'fonts.conf' -/-> '/usr/local/etc/mpv/fonts.conf'
[   0.014][v][osd/libass] Setting up fonts...
[   0.015][v][cplayer] Run command: hook-add, flags=0, args=[on_load, 1, 10]
[   0.015][v][cplayer] Run command: hook-add, flags=0, args=[on_preloaded, 2, 10]
[   0.015][v][cplayer] Done loading @ytdl_hook.lua.
[   0.015][v][global] config path: 'scripts' -/-> '/home/yuri/.config/mpv/scripts'
[   0.015][v][global] config path: 'scripts' -/-> '/home/yuri/.mpv/scripts'
[   0.015][v][global] config path: 'scripts' -/-> '/usr/local/etc/mpv/scripts'
[   0.015][v][global] config path: 'watch_later' -> '/home/yuri/.config/mpv/watch_later'
[   0.015][i][cplayer] Playing: http://xxx
[   0.015][v][cplayer] Running hook: ytdl_hook/on_load
[   0.020][v][osd/libass] Using font provider fontconfig
[   0.021][v][osd/libass] Done.
[   0.021][v][global] config path: 'youtube-dl' -/-> '/home/yuri/.config/mpv/youtube-dl'
[   0.021][v][global] config path: 'youtube-dl' -/-> '/home/yuri/.mpv/youtube-dl'
[   0.021][v][global] config path: 'youtube-dl' -/-> '/usr/local/etc/mpv/youtube-dl'
[   2.368][i][ytdl_hook] ERROR: Unable to download webpage: ICY 200 OK
[   2.368][i][ytdl_hook]  (caused by BadStatusLine('ICY 200 OK\r\n',)); please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; type  youtube-dl -U  to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
[   2.394][w][ytdl_hook] youtube-dl failed, trying to play URL directly ... 
[   2.394][v][cplayer] Run command: hook-ack, flags=0, args=[on_load]
[   2.395][v][ffmpeg] Opening http://xxx
[   2.824][v][ffmpeg] Could not set AVOption tls_verify='0'
[   2.824][v][ffmpeg] Mime-type: 'audio/aacp'
[   2.824][v][ffmpeg] Stream opened successfully.
[   2.825][v][cache] Cache size set to 150000 KiB (75000 KiB backbuffer)
[   2.825][v][demux] Trying demuxers for level=normal.
[   2.830][v][lavf] Found 'aac' at score=25 size=2048.
[   2.849][w][ffmpeg/audio] aac: element type mismatch 1 != 0
[   2.849][v][ffmpeg/demuxer] aac: max_analyze_duration 500000 reached at 510839 microseconds st:0
[   2.849][v][lavf] avformat_find_stream_info() finished after 32768 bytes.
[   2.849][v][demux] Detected file format: aac (libavformat)
[   2.849][v][demux] Stream is not seekable.
[   2.849][v][cache] blocking for STREAM_CTRL 6
[   2.868][v][global] config path: 'sub/' -/-> '/home/yuri/.config/mpv/sub/'
[   2.868][v][global] config path: 'sub/' -/-> '/home/yuri/.mpv/sub/'
[   2.868][v][global] config path: 'sub/' -/-> '/usr/local/etc/mpv/sub/'
[   2.868][v][global] config path: 'audio/' -/-> '/home/yuri/.config/mpv/audio/'
[   2.868][v][global] config path: 'audio/' -/-> '/home/yuri/.mpv/audio/'
[   2.868][v][global] config path: 'audio/' -/-> '/usr/local/etc/mpv/audio/'
[   2.868][v][cplayer] Running hook: ytdl_hook/on_preloaded
[   2.868][v][cplayer] Run command: hook-ack, flags=0, args=[on_preloaded]
[   2.868][i][cplayer]  (+) Audio --aid=1 (aac)
[   2.868][i][display-tags] File tags:
[   2.868][i][display-tags]  icy-title: text="" song_spot="O" MediaBaseId="0" itunesTrackId="0" amgTrackId="-1" amgArtistId="0" TAID="0" TPID="0" cartcutId="1"
[   2.869][v][ad] Codec list:
[   2.869][v][ad]     aac - AAC (Advanced Audio Coding)
[   2.869][v][ad]     aac_fixed (aac) - AAC (Advanced Audio Coding)
[   2.869][v][ad] Opening audio decoder aac
[   2.869][v][ad] Requesting 1 threads for decoding.
[   2.869][v][ad] Selected audio codec: aac (AAC (Advanced Audio Coding))
[   2.869][v][cplayer] Starting playback...
[   2.869][e][ffmpeg/audio] aac: skip_data_stream_element: Input buffer exhausted before END element found
[   2.869][e][ad] Error decoding audio.
[   2.869][w][ffmpeg/audio] aac: element type mismatch 1 != 0
[   2.869][v][af] Audio filter chain:
[   2.870][v][af]   [in] 44100Hz stereo 2ch floatp
[   2.870][v][af]   [out] 44100Hz stereo 2ch floatp
[   2.870][v][af]   [ao] 44100Hz stereo 2ch floatp
[   2.870][v][ao] Trying audio driver 'oss'
[   2.870][v][ao] Using preferred device '/dev/dsp1'
[   2.870][v][ao/oss] requested format: 44100 Hz, stereo channels, floatp
[   2.870][v][ao/oss] using '/dev/dsp' dsp device
[   2.870][v][ao/oss] using '/dev/mixer' mixer device
[   2.870][v][ao/oss] using 'pcm' mixer device
[   2.870][v][ao/oss] Unknown/not supported internal format: float
[   2.870][v][ao/oss] Unknown/not supported internal format: floatp
[   2.870][v][ao/oss] Unknown/not supported internal format: double
[   2.870][v][ao/oss] Unknown/not supported internal format: doublep
[   2.870][v][ao/oss] sample format: s32
[   2.870][v][ao/oss] Channel layouts:
[   2.870][v][ao/oss]  - mono
[   2.870][v][ao/oss]  - stereo
[   2.870][v][ao/oss]  - 2.1
[   2.870][v][ao/oss]  - quad
[   2.870][v][ao/oss]  - 5.0(alsa)
[   2.870][v][ao/oss]  - 5.1(alsa)
[   2.870][v][ao/oss]  - fl-fr-bl-br-fc-lfe-bc
[   2.870][v][ao/oss]  - 7.1(alsa)
[   2.870][v][ao/oss] result: stereo
[   2.870][v][ao/oss] using 2 channels (requested: 2)
[   2.870][v][ao/oss] using 44100 Hz samplerate
[   2.870][v][ao/oss] frags:  32/32  (4096 bytes/frag)  free: 131072
[   2.870][v][ao/oss] device buffer: 16384 samples.
[   2.870][v][ao/oss] using soft-buffer of 16384 samples.
[   2.871][i][cplayer] AO: [oss] 44100Hz stereo 2ch s32
[   2.871][v][cplayer] AO: Description: OSS/ioctl audio output
[   2.871][v][af] Adding filter lavrresample 
[   2.871][v][af] Audio filter chain:
[   2.871][v][af]   [in] 44100Hz stereo 2ch floatp
[   2.871][v][af]   [lavrresample] 44100Hz stereo 2ch s32 [a]
[   2.871][v][af]   [out] 44100Hz stereo 2ch s32
[   2.871][v][af]   [ao] 44100Hz stereo 2ch s32
[   2.873][v][cplayer] starting audio playback
[   2.873][v][cplayer] playback restart complete
[   3.732][v][cplayer] Run command: quit, flags=9, args=[4]
[   3.732][v][cplayer] EOF code: 6  
[   3.732][v][ad] Uninit audio decoder.
[   3.732][v][af] Removing filter lavrresample 
[   3.733][v][cache] Terminating cache...
[   3.772][v][cache] Cache exiting...
[   3.772][v][cplayer] finished playback, success (reason 3)
[   3.772][i][cplayer] 
[   3.772][i][cplayer] 
[   3.772][i][cplayer] Exiting... (Quit)
[   3.772][v][ytdl_hook] Exiting...
[   3.772][v][osc] Exiting...
[   3.774][v][ao/oss] draining...

@yurivict
Copy link
Author

yurivict commented Feb 8, 2017

Pulse doesn't work for me either, --ao=pulse --audio-device=pulse/oss_output.dsp2 doesn't play anything. paplay --device=oss_output.dsp2 x.wav plays sound okay.

@kevmitch
Copy link
Member

kevmitch commented Feb 8, 2017

Ok, well it seems --audio-device is currently broken / ignored with oss. I'm looking at fixing this now. In the mean time, the --oss-device option seems to work fine. Just ignore the deprecation warning.

@yurivict
Copy link
Author

yurivict commented Feb 8, 2017

This works, thanks!

kevmitch added a commit to kevmitch/mpv that referenced this issue Feb 8, 2017
Fall back on PATH_DEV_DSP if nothing is set.

This mirrors the behaviour of --audio-device / --alsa-device.

There doesn't appear to be a general way to list devices with oss, so
--audio-device=help doesn't list oss devices except for the default one if the
file exists.

Previously --audio-device was ignored entirely by ao_oss.

fixes mpv-player#4122
kevmitch added a commit to kevmitch/mpv that referenced this issue Feb 8, 2017
Fall back on PATH_DEV_DSP if nothing is set.

This mirrors the behaviour of --audio-device / --alsa-device.

There doesn't appear to be a general way to list devices with oss, so
--audio-device=help doesn't list oss devices except for the default one if the
file exists.

Previously --audio-device was ignored entirely by ao_oss.

fixes mpv-player#4122
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants